Merge "Fix issues in Tuner VTS Dvr testing" into rvc-dev am: a3f9fae571
am: 24ecb4a927
am: 170186ba2a
am: 29cf6be5c9
Change-Id: If84f27886109917929d5e58ca5ec335429b5ae37
This commit is contained in:
commit
81e4a16fc3
10 changed files with 100 additions and 89 deletions
|
@ -71,7 +71,7 @@ Return<void> Demux::openFilter(const DemuxFilterType& type, uint32_t bufferSize,
|
|||
mUsedFilterIds.insert(filterId);
|
||||
|
||||
if (cb == nullptr) {
|
||||
ALOGW("callback can't be null");
|
||||
ALOGW("[Demux] callback can't be null");
|
||||
_hidl_cb(Result::INVALID_ARGUMENT, new Filter());
|
||||
return Void();
|
||||
}
|
||||
|
@ -82,9 +82,14 @@ Return<void> Demux::openFilter(const DemuxFilterType& type, uint32_t bufferSize,
|
|||
_hidl_cb(Result::UNKNOWN_ERROR, filter);
|
||||
return Void();
|
||||
}
|
||||
mFilters[filterId] = filter;
|
||||
|
||||
_hidl_cb(Result::SUCCESS, filter);
|
||||
mFilters[filterId] = filter;
|
||||
bool result = true;
|
||||
if (mDvr != nullptr && mDvr->getType() == DvrType::PLAYBACK) {
|
||||
result = mDvr->addPlaybackFilter(filter);
|
||||
}
|
||||
|
||||
_hidl_cb(result ? Result::SUCCESS : Result::INVALID_ARGUMENT, filter);
|
||||
return Void();
|
||||
}
|
||||
|
||||
|
@ -130,7 +135,7 @@ Return<void> Demux::openDvr(DvrType type, uint32_t bufferSize, const sp<IDvrCall
|
|||
ALOGV("%s", __FUNCTION__);
|
||||
|
||||
if (cb == nullptr) {
|
||||
ALOGW("DVR callback can't be null");
|
||||
ALOGW("[Demux] DVR callback can't be null");
|
||||
_hidl_cb(Result::INVALID_ARGUMENT, new Dvr());
|
||||
return Void();
|
||||
}
|
||||
|
@ -174,11 +179,11 @@ Result Demux::removeFilter(uint32_t filterId) {
|
|||
|
||||
void Demux::startBroadcastTsFilter(vector<uint8_t> data) {
|
||||
set<uint32_t>::iterator it;
|
||||
uint16_t pid = ((data[1] & 0x1f) << 8) | ((data[2] & 0xff));
|
||||
if (DEBUG_DEMUX) {
|
||||
ALOGW("[Demux] start ts filter pid: %d", pid);
|
||||
}
|
||||
for (it = mUsedFilterIds.begin(); it != mUsedFilterIds.end(); it++) {
|
||||
uint16_t pid = ((data[1] & 0x1f) << 8) | ((data[2] & 0xff));
|
||||
if (DEBUG_FILTER) {
|
||||
ALOGW("start ts filter pid: %d", pid);
|
||||
}
|
||||
if (pid == mFilters[*it]->getTpid()) {
|
||||
mFilters[*it]->updateFilterOutput(data);
|
||||
}
|
||||
|
@ -187,10 +192,10 @@ void Demux::startBroadcastTsFilter(vector<uint8_t> data) {
|
|||
|
||||
void Demux::sendFrontendInputToRecord(vector<uint8_t> data) {
|
||||
set<uint32_t>::iterator it;
|
||||
if (DEBUG_DEMUX) {
|
||||
ALOGW("[Demux] update record filter output");
|
||||
}
|
||||
for (it = mRecordFilterIds.begin(); it != mRecordFilterIds.end(); it++) {
|
||||
if (DEBUG_FILTER) {
|
||||
ALOGW("update record filter output");
|
||||
}
|
||||
mFilters[*it]->updateRecordOutput(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ class Demux : public IDemux {
|
|||
int mPesSizeLeft = 0;
|
||||
vector<uint8_t> mPesOutput;
|
||||
|
||||
const bool DEBUG_FILTER = false;
|
||||
const bool DEBUG_DEMUX = false;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
|
|
|
@ -71,13 +71,10 @@ Return<Result> Dvr::attachFilter(const sp<IFilter>& filter) {
|
|||
}
|
||||
|
||||
// check if the attached filter is a record filter
|
||||
|
||||
mFilters[filterId] = filter;
|
||||
mIsRecordFilterAttached = true;
|
||||
if (!mDemux->attachRecordFilter(filterId)) {
|
||||
return Result::INVALID_ARGUMENT;
|
||||
}
|
||||
mDemux->setIsRecording(mIsRecordStarted | mIsRecordFilterAttached);
|
||||
|
||||
return Result::SUCCESS;
|
||||
}
|
||||
|
@ -110,7 +107,6 @@ Return<Result> Dvr::detachFilter(const sp<IFilter>& filter) {
|
|||
// If all the filters are detached, record can't be started
|
||||
if (mFilters.empty()) {
|
||||
mIsRecordFilterAttached = false;
|
||||
mDemux->setIsRecording(mIsRecordStarted | mIsRecordFilterAttached);
|
||||
}
|
||||
|
||||
return Result::SUCCESS;
|
||||
|
@ -132,8 +128,7 @@ Return<Result> Dvr::start() {
|
|||
pthread_setname_np(mDvrThread, "playback_waiting_loop");
|
||||
} else if (mType == DvrType::RECORD) {
|
||||
mRecordStatus = RecordStatus::DATA_READY;
|
||||
mIsRecordStarted = true;
|
||||
mDemux->setIsRecording(mIsRecordStarted | mIsRecordFilterAttached);
|
||||
mDemux->setIsRecording(mType == DvrType::RECORD);
|
||||
}
|
||||
|
||||
// TODO start another thread to send filter status callback to the framework
|
||||
|
@ -149,7 +144,7 @@ Return<Result> Dvr::stop() {
|
|||
std::lock_guard<std::mutex> lock(mDvrThreadLock);
|
||||
|
||||
mIsRecordStarted = false;
|
||||
mDemux->setIsRecording(mIsRecordStarted | mIsRecordFilterAttached);
|
||||
mDemux->setIsRecording(false);
|
||||
|
||||
return Result::SUCCESS;
|
||||
}
|
||||
|
@ -175,7 +170,7 @@ bool Dvr::createDvrMQ() {
|
|||
std::unique_ptr<DvrMQ> tmpDvrMQ =
|
||||
std::unique_ptr<DvrMQ>(new (std::nothrow) DvrMQ(mBufferSize, true));
|
||||
if (!tmpDvrMQ->isValid()) {
|
||||
ALOGW("Failed to create FMQ of DVR");
|
||||
ALOGW("[Dvr] Failed to create FMQ of DVR");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -256,7 +251,6 @@ bool Dvr::readPlaybackFMQ() {
|
|||
int playbackPacketSize = mDvrSettings.playback().packetSize;
|
||||
vector<uint8_t> dataOutputBuffer;
|
||||
dataOutputBuffer.resize(playbackPacketSize);
|
||||
|
||||
// Dispatch the packet to the PID matching filter output buffer
|
||||
for (int i = 0; i < size / playbackPacketSize; i++) {
|
||||
if (!mDvrMQ->read(dataOutputBuffer.data(), playbackPacketSize)) {
|
||||
|
@ -283,7 +277,6 @@ void Dvr::startTpidFilter(vector<uint8_t> data) {
|
|||
|
||||
bool Dvr::startFilterDispatcher() {
|
||||
std::map<uint32_t, sp<IFilter>>::iterator it;
|
||||
|
||||
// Handle the output data per filter type
|
||||
for (it = mFilters.begin(); it != mFilters.end(); it++) {
|
||||
if (mDemux->startFilterHandler(it->first) != Result::SUCCESS) {
|
||||
|
@ -296,7 +289,10 @@ bool Dvr::startFilterDispatcher() {
|
|||
|
||||
bool Dvr::writeRecordFMQ(const std::vector<uint8_t>& data) {
|
||||
std::lock_guard<std::mutex> lock(mWriteLock);
|
||||
ALOGW("[Dvr] write record FMQ");
|
||||
if (mRecordStatus == RecordStatus::OVERFLOW) {
|
||||
ALOGW("[Dvr] stops writing and wait for the client side flushing.");
|
||||
return true;
|
||||
}
|
||||
if (mDvrMQ->write(data.data(), data.size())) {
|
||||
mDvrEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_READY));
|
||||
maySendRecordStatusCallback();
|
||||
|
@ -333,6 +329,27 @@ RecordStatus Dvr::checkRecordStatusChange(uint32_t availableToWrite, uint32_t av
|
|||
return mRecordStatus;
|
||||
}
|
||||
|
||||
bool Dvr::addPlaybackFilter(sp<IFilter> filter) {
|
||||
uint32_t filterId;
|
||||
Result status;
|
||||
|
||||
filter->getId([&](Result result, uint32_t id) {
|
||||
filterId = id;
|
||||
status = result;
|
||||
});
|
||||
|
||||
if (status != Result::SUCCESS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mFilters[filterId] = filter;
|
||||
return true;
|
||||
}
|
||||
|
||||
DvrType Dvr::getType() {
|
||||
return mType;
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V1_0
|
||||
} // namespace tuner
|
||||
|
|
|
@ -81,6 +81,8 @@ class Dvr : public IDvr {
|
|||
bool createDvrMQ();
|
||||
void sendBroadcastInputToDvrRecord(vector<uint8_t> byteBuffer);
|
||||
bool writeRecordFMQ(const std::vector<uint8_t>& data);
|
||||
DvrType getType();
|
||||
bool addPlaybackFilter(sp<IFilter> filter);
|
||||
|
||||
private:
|
||||
// Demux service
|
||||
|
|
|
@ -149,7 +149,7 @@ bool Filter::createFilterMQ() {
|
|||
std::unique_ptr<FilterMQ> tmpFilterMQ =
|
||||
std::unique_ptr<FilterMQ>(new (std::nothrow) FilterMQ(mBufferSize, true));
|
||||
if (!tmpFilterMQ->isValid()) {
|
||||
ALOGW("Failed to create FMQ of filter with id: %d", mFilterId);
|
||||
ALOGW("[Filter] Failed to create FMQ of filter with id: %d", mFilterId);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -290,13 +290,11 @@ uint16_t Filter::getTpid() {
|
|||
|
||||
void Filter::updateFilterOutput(vector<uint8_t> data) {
|
||||
std::lock_guard<std::mutex> lock(mFilterOutputLock);
|
||||
ALOGD("[Filter] filter output updated");
|
||||
mFilterOutput.insert(mFilterOutput.end(), data.begin(), data.end());
|
||||
}
|
||||
|
||||
void Filter::updateRecordOutput(vector<uint8_t> data) {
|
||||
std::lock_guard<std::mutex> lock(mRecordFilterOutputLock);
|
||||
ALOGD("[Filter] record filter output updated");
|
||||
mRecordFilterOutput.insert(mRecordFilterOutput.end(), data.begin(), data.end());
|
||||
}
|
||||
|
||||
|
@ -438,7 +436,6 @@ Result Filter::startMediaFilterHandler() {
|
|||
if (mFilterOutput.empty()) {
|
||||
return Result::SUCCESS;
|
||||
}
|
||||
|
||||
for (int i = 0; i < mFilterOutput.size(); i += 188) {
|
||||
if (mPesSizeLeft == 0) {
|
||||
uint32_t prefix = (mFilterOutput[i + 4] << 16) | (mFilterOutput[i + 5] << 8) |
|
||||
|
|
|
@ -76,7 +76,7 @@ class Frontend : public IFrontend {
|
|||
FrontendId mId = 0;
|
||||
bool mIsLocked = false;
|
||||
|
||||
const string FRONTEND_STREAM_FILE = "/vendor/etc/dumpTs3.ts";
|
||||
const string FRONTEND_STREAM_FILE = "/vendor/etc/segment000000.ts";
|
||||
std::ifstream mFrontendData;
|
||||
};
|
||||
|
||||
|
|
|
@ -16,17 +16,13 @@
|
|||
|
||||
#include "DvrTests.h"
|
||||
|
||||
void DvrCallback::startPlaybackInputThread(PlaybackConf playbackConf,
|
||||
void DvrCallback::startPlaybackInputThread(string& dataInputFile, PlaybackSettings& settings,
|
||||
MQDesc& playbackMQDescriptor) {
|
||||
mInputDataFile = dataInputFile;
|
||||
mPlaybackSettings = settings;
|
||||
mPlaybackMQ = std::make_unique<FilterMQ>(playbackMQDescriptor, true /* resetPointers */);
|
||||
EXPECT_TRUE(mPlaybackMQ);
|
||||
struct PlaybackThreadArgs* threadArgs =
|
||||
(struct PlaybackThreadArgs*)malloc(sizeof(struct PlaybackThreadArgs));
|
||||
threadArgs->user = this;
|
||||
threadArgs->playbackConf = &playbackConf;
|
||||
threadArgs->keepWritingPlaybackFMQ = &mKeepWritingPlaybackFMQ;
|
||||
|
||||
pthread_create(&mPlaybackThread, NULL, __threadLoopPlayback, (void*)threadArgs);
|
||||
pthread_create(&mPlaybackThread, NULL, __threadLoopPlayback, this);
|
||||
pthread_setname_np(mPlaybackThread, "test_playback_input_loop");
|
||||
}
|
||||
|
||||
|
@ -37,15 +33,13 @@ void DvrCallback::stopPlaybackThread() {
|
|||
android::Mutex::Autolock autoLock(mPlaybackThreadLock);
|
||||
}
|
||||
|
||||
void* DvrCallback::__threadLoopPlayback(void* threadArgs) {
|
||||
DvrCallback* const self =
|
||||
static_cast<DvrCallback*>(((struct PlaybackThreadArgs*)threadArgs)->user);
|
||||
self->playbackThreadLoop(((struct PlaybackThreadArgs*)threadArgs)->playbackConf,
|
||||
((struct PlaybackThreadArgs*)threadArgs)->keepWritingPlaybackFMQ);
|
||||
void* DvrCallback::__threadLoopPlayback(void* user) {
|
||||
DvrCallback* const self = static_cast<DvrCallback*>(user);
|
||||
self->playbackThreadLoop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DvrCallback::playbackThreadLoop(PlaybackConf* playbackConf, bool* keepWritingPlaybackFMQ) {
|
||||
void DvrCallback::playbackThreadLoop() {
|
||||
android::Mutex::Autolock autoLock(mPlaybackThreadLock);
|
||||
mPlaybackThreadRunning = true;
|
||||
|
||||
|
@ -56,10 +50,10 @@ void DvrCallback::playbackThreadLoop(PlaybackConf* playbackConf, bool* keepWriti
|
|||
android::OK);
|
||||
|
||||
// open the stream and get its length
|
||||
std::ifstream inputData(playbackConf->inputDataFile, std::ifstream::binary);
|
||||
int writeSize = playbackConf->setting.packetSize * 6;
|
||||
std::ifstream inputData(mInputDataFile.c_str(), std::ifstream::binary);
|
||||
int writeSize = mPlaybackSettings.packetSize * 6;
|
||||
char* buffer = new char[writeSize];
|
||||
ALOGW("[vts] playback thread loop start %s", playbackConf->inputDataFile.c_str());
|
||||
ALOGW("[vts] playback thread loop start %s!", mInputDataFile.c_str());
|
||||
if (!inputData.is_open()) {
|
||||
mPlaybackThreadRunning = false;
|
||||
ALOGW("[vts] Error %s", strerror(errno));
|
||||
|
@ -67,7 +61,7 @@ void DvrCallback::playbackThreadLoop(PlaybackConf* playbackConf, bool* keepWriti
|
|||
|
||||
while (mPlaybackThreadRunning) {
|
||||
// move the stream pointer for packet size * 6 every read until the end
|
||||
while (*keepWritingPlaybackFMQ) {
|
||||
while (mKeepWritingPlaybackFMQ) {
|
||||
inputData.read(buffer, writeSize);
|
||||
if (!inputData) {
|
||||
int leftSize = inputData.gcount();
|
||||
|
@ -105,6 +99,7 @@ void DvrCallback::testRecordOutput() {
|
|||
while (mDataOutputBuffer.empty()) {
|
||||
if (-ETIMEDOUT == mMsgCondition.waitRelative(mMsgLock, WAIT_TIMEOUT)) {
|
||||
EXPECT_TRUE(false) << "record output matching pid does not output within timeout";
|
||||
stopRecordThread();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -138,6 +133,7 @@ void DvrCallback::recordThreadLoop(RecordSettings* /*recordSettings*/, bool* kee
|
|||
ALOGD("[vts] DvrCallback record threadLoop start.");
|
||||
android::Mutex::Autolock autoLock(mRecordThreadLock);
|
||||
mRecordThreadRunning = true;
|
||||
mKeepReadingRecordFMQ = true;
|
||||
|
||||
// Create the EventFlag that is used to signal the HAL impl that data have been
|
||||
// read from the Record FMQ
|
||||
|
@ -183,7 +179,6 @@ bool DvrCallback::readRecordFMQ() {
|
|||
void DvrCallback::stopRecordThread() {
|
||||
mKeepReadingRecordFMQ = false;
|
||||
mRecordThreadRunning = false;
|
||||
android::Mutex::Autolock autoLock(mRecordThreadLock);
|
||||
}
|
||||
|
||||
AssertionResult DvrTests::openDvrInDemux(DvrType type, uint32_t bufferSize) {
|
||||
|
@ -198,6 +193,9 @@ AssertionResult DvrTests::openDvrInDemux(DvrType type, uint32_t bufferSize) {
|
|||
status = result;
|
||||
});
|
||||
|
||||
if (status == Result::SUCCESS) {
|
||||
mDvrCallback->setDvr(mDvr);
|
||||
}
|
||||
return AssertionResult(status == Result::SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,15 +54,10 @@ using android::hardware::tv::tuner::V1_0::Result;
|
|||
|
||||
#define WAIT_TIMEOUT 3000000000
|
||||
|
||||
struct PlaybackConf {
|
||||
string inputDataFile;
|
||||
PlaybackSettings setting;
|
||||
};
|
||||
|
||||
class DvrCallback : public IDvrCallback {
|
||||
public:
|
||||
virtual Return<void> onRecordStatus(DemuxFilterStatus status) override {
|
||||
ALOGW("[vts] record status %hhu", status);
|
||||
ALOGD("[vts] record status %hhu", status);
|
||||
switch (status) {
|
||||
case DemuxFilterStatus::DATA_READY:
|
||||
break;
|
||||
|
@ -70,7 +65,12 @@ class DvrCallback : public IDvrCallback {
|
|||
break;
|
||||
case DemuxFilterStatus::HIGH_WATER:
|
||||
case DemuxFilterStatus::OVERFLOW:
|
||||
ALOGW("[vts] record overflow. Flushing");
|
||||
ALOGD("[vts] record overflow. Flushing.");
|
||||
EXPECT_TRUE(mDvr) << "Dvr callback is not set with an IDvr";
|
||||
if (mDvr) {
|
||||
Result result = mDvr->flush();
|
||||
ALOGD("[vts] Flushing result %d.", result);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return Void();
|
||||
|
@ -78,16 +78,16 @@ class DvrCallback : public IDvrCallback {
|
|||
|
||||
virtual Return<void> onPlaybackStatus(PlaybackStatus status) override {
|
||||
// android::Mutex::Autolock autoLock(mMsgLock);
|
||||
ALOGW("[vts] playback status %d", status);
|
||||
ALOGD("[vts] playback status %d", status);
|
||||
switch (status) {
|
||||
case PlaybackStatus::SPACE_EMPTY:
|
||||
case PlaybackStatus::SPACE_ALMOST_EMPTY:
|
||||
ALOGW("[vts] keep playback inputing %d", status);
|
||||
ALOGD("[vts] keep playback inputing %d", status);
|
||||
mKeepWritingPlaybackFMQ = true;
|
||||
break;
|
||||
case PlaybackStatus::SPACE_ALMOST_FULL:
|
||||
case PlaybackStatus::SPACE_FULL:
|
||||
ALOGW("[vts] stop playback inputing %d", status);
|
||||
ALOGD("[vts] stop playback inputing %d", status);
|
||||
mKeepWritingPlaybackFMQ = false;
|
||||
break;
|
||||
}
|
||||
|
@ -98,21 +98,19 @@ class DvrCallback : public IDvrCallback {
|
|||
void testRecordOutput();
|
||||
void stopRecordThread();
|
||||
|
||||
void startPlaybackInputThread(PlaybackConf playbackConf, MQDesc& playbackMQDescriptor);
|
||||
void startPlaybackInputThread(string& dataInputFile, PlaybackSettings& settings,
|
||||
MQDesc& playbackMQDescriptor);
|
||||
void startRecordOutputThread(RecordSettings recordSettings, MQDesc& recordMQDescriptor);
|
||||
static void* __threadLoopPlayback(void* threadArgs);
|
||||
static void* __threadLoopPlayback(void* user);
|
||||
static void* __threadLoopRecord(void* threadArgs);
|
||||
void playbackThreadLoop(PlaybackConf* playbackConf, bool* keepWritingPlaybackFMQ);
|
||||
void playbackThreadLoop();
|
||||
void recordThreadLoop(RecordSettings* recordSetting, bool* keepWritingPlaybackFMQ);
|
||||
|
||||
bool readRecordFMQ();
|
||||
|
||||
void setDvr(sp<IDvr> dvr) { mDvr = dvr; }
|
||||
|
||||
private:
|
||||
struct PlaybackThreadArgs {
|
||||
DvrCallback* user;
|
||||
PlaybackConf* playbackConf;
|
||||
bool* keepWritingPlaybackFMQ;
|
||||
};
|
||||
struct RecordThreadArgs {
|
||||
DvrCallback* user;
|
||||
RecordSettings* recordSettings;
|
||||
|
@ -137,6 +135,10 @@ class DvrCallback : public IDvrCallback {
|
|||
bool mRecordThreadRunning;
|
||||
pthread_t mPlaybackThread;
|
||||
pthread_t mRecordThread;
|
||||
string mInputDataFile;
|
||||
PlaybackSettings mPlaybackSettings;
|
||||
|
||||
sp<IDvr> mDvr = nullptr;
|
||||
|
||||
// int mPidFilterOutputCount = 0;
|
||||
};
|
||||
|
@ -147,11 +149,7 @@ class DvrTests {
|
|||
void setDemux(sp<IDemux> demux) { mDemux = demux; }
|
||||
|
||||
void startPlaybackInputThread(string& dataInputFile, PlaybackSettings& settings) {
|
||||
PlaybackConf conf{
|
||||
.inputDataFile = dataInputFile,
|
||||
.setting = settings,
|
||||
};
|
||||
mDvrCallback->startPlaybackInputThread(conf, mDvrMQDescriptor);
|
||||
mDvrCallback->startPlaybackInputThread(dataInputFile, settings, mDvrMQDescriptor);
|
||||
};
|
||||
|
||||
void startRecordOutputThread(RecordSettings settings) {
|
||||
|
|
|
@ -130,7 +130,6 @@ void TunerPlaybackHidlTest::playbackSingleFilterTest(FilterConfig filterConf, Dv
|
|||
uint32_t demuxId;
|
||||
sp<IDemux> demux;
|
||||
uint32_t filterId;
|
||||
sp<IFilter> filter;
|
||||
|
||||
ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
|
||||
mFilterTests.setDemux(demux);
|
||||
|
@ -142,8 +141,6 @@ void TunerPlaybackHidlTest::playbackSingleFilterTest(FilterConfig filterConf, Dv
|
|||
ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId(filterId));
|
||||
ASSERT_TRUE(mFilterTests.configFilter(filterConf.settings, filterId));
|
||||
ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId));
|
||||
filter = mFilterTests.getFilterById(filterId);
|
||||
ASSERT_TRUE(filter != nullptr);
|
||||
mDvrTests.startPlaybackInputThread(dvrConf.playbackInputFile, dvrConf.settings.playback());
|
||||
ASSERT_TRUE(mDvrTests.startDvr());
|
||||
ASSERT_TRUE(mFilterTests.startFilter(filterId));
|
||||
|
@ -181,12 +178,14 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf,
|
|||
ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId));
|
||||
filter = mFilterTests.getFilterById(filterId);
|
||||
ASSERT_TRUE(filter != nullptr);
|
||||
ASSERT_TRUE(mDvrTests.attachFilterToDvr(filter));
|
||||
mDvrTests.startRecordOutputThread(dvrConf.settings.record());
|
||||
ASSERT_TRUE(mDvrTests.attachFilterToDvr(filter));
|
||||
ASSERT_TRUE(mDvrTests.startDvr());
|
||||
ASSERT_TRUE(mFilterTests.startFilter(filterId));
|
||||
ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf));
|
||||
mDvrTests.testRecordOutput();
|
||||
mDvrTests.stopRecordThread();
|
||||
ASSERT_TRUE(mFrontendTests.stopTuneFrontend());
|
||||
ASSERT_TRUE(mFilterTests.stopFilter(filterId));
|
||||
ASSERT_TRUE(mDvrTests.stopDvr());
|
||||
ASSERT_TRUE(mDvrTests.detachFilterToDvr(filter));
|
||||
|
@ -280,11 +279,6 @@ TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowAudioFilterTest) {
|
|||
broadcastSingleFilterTest(filterArray[TS_AUDIO0], frontendArray[DVBS]);
|
||||
}
|
||||
|
||||
TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowTsFilterTest) {
|
||||
description("Test TS Filter functionality in Broadcast use case.");
|
||||
broadcastSingleFilterTest(filterArray[TS_TS0], frontendArray[DVBS]);
|
||||
}
|
||||
|
||||
TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowSectionFilterTest) {
|
||||
description("Test Section Filter functionality in Broadcast use case.");
|
||||
broadcastSingleFilterTest(filterArray[TS_SECTION0], frontendArray[DVBS]);
|
||||
|
@ -295,9 +289,9 @@ TEST_P(TunerBroadcastHidlTest, IonBufferTest) {
|
|||
broadcastSingleFilterTest(filterArray[TS_VIDEO0], frontendArray[DVBS]);
|
||||
}
|
||||
|
||||
TEST_P(TunerPlaybackHidlTest, PlaybackDataFlowWithTsRecordFilterTest) {
|
||||
description("Feed ts data from playback and configure Ts filter to get output");
|
||||
playbackSingleFilterTest(filterArray[TS_VIDEO1], dvrArray[DVR_PLAYBACK0]);
|
||||
TEST_P(TunerPlaybackHidlTest, PlaybackDataFlowWithTsSectionFilterTest) {
|
||||
description("Feed ts data from playback and configure Ts section filter to get output");
|
||||
playbackSingleFilterTest(filterArray[TS_SECTION0], dvrArray[DVR_PLAYBACK0]);
|
||||
}
|
||||
|
||||
TEST_P(TunerRecordHidlTest, AttachFiltersToRecordTest) {
|
||||
|
|
|
@ -153,18 +153,18 @@ inline void initFilterConfig() {
|
|||
filterArray[TS_VIDEO0].type.mainType = DemuxFilterMainType::TS;
|
||||
filterArray[TS_VIDEO0].type.subType.tsFilterType(DemuxTsFilterType::VIDEO);
|
||||
filterArray[TS_VIDEO0].bufferSize = FMQ_SIZE_16M;
|
||||
filterArray[TS_VIDEO0].settings.ts().tpid = 119;
|
||||
filterArray[TS_VIDEO0].settings.ts().tpid = 256;
|
||||
filterArray[TS_VIDEO0].settings.ts().filterSettings.av({.isPassthrough = false});
|
||||
filterArray[TS_VIDEO1].type.mainType = DemuxFilterMainType::TS;
|
||||
filterArray[TS_VIDEO1].type.subType.tsFilterType(DemuxTsFilterType::VIDEO);
|
||||
filterArray[TS_VIDEO1].bufferSize = FMQ_SIZE_16M;
|
||||
filterArray[TS_VIDEO1].settings.ts().tpid = 81;
|
||||
filterArray[TS_VIDEO1].settings.ts().tpid = 256;
|
||||
filterArray[TS_VIDEO1].settings.ts().filterSettings.av({.isPassthrough = false});
|
||||
// TS AUDIO filter setting
|
||||
filterArray[TS_AUDIO0].type.mainType = DemuxFilterMainType::TS;
|
||||
filterArray[TS_AUDIO0].type.subType.tsFilterType(DemuxTsFilterType::AUDIO);
|
||||
filterArray[TS_AUDIO0].bufferSize = FMQ_SIZE_16M;
|
||||
filterArray[TS_AUDIO0].settings.ts().tpid = 84;
|
||||
filterArray[TS_AUDIO0].settings.ts().tpid = 256;
|
||||
filterArray[TS_AUDIO0].settings.ts().filterSettings.av({.isPassthrough = false});
|
||||
// TS PES filter setting
|
||||
filterArray[TS_PES0].type.mainType = DemuxFilterMainType::TS;
|
||||
|
@ -179,19 +179,19 @@ inline void initFilterConfig() {
|
|||
filterArray[TS_PCR0].type.mainType = DemuxFilterMainType::TS;
|
||||
filterArray[TS_PCR0].type.subType.tsFilterType(DemuxTsFilterType::PCR);
|
||||
filterArray[TS_PCR0].bufferSize = FMQ_SIZE_16M;
|
||||
filterArray[TS_PCR0].settings.ts().tpid = 81;
|
||||
filterArray[TS_PCR0].settings.ts().tpid = 256;
|
||||
filterArray[TS_PCR0].settings.ts().filterSettings.noinit();
|
||||
// TS filter setting
|
||||
filterArray[TS_TS0].type.mainType = DemuxFilterMainType::TS;
|
||||
filterArray[TS_TS0].type.subType.tsFilterType(DemuxTsFilterType::TS);
|
||||
filterArray[TS_TS0].bufferSize = FMQ_SIZE_16M;
|
||||
filterArray[TS_TS0].settings.ts().tpid = 18;
|
||||
filterArray[TS_TS0].settings.ts().tpid = 256;
|
||||
filterArray[TS_TS0].settings.ts().filterSettings.noinit();
|
||||
// TS SECTION filter setting
|
||||
filterArray[TS_SECTION0].type.mainType = DemuxFilterMainType::TS;
|
||||
filterArray[TS_SECTION0].type.subType.tsFilterType(DemuxTsFilterType::SECTION);
|
||||
filterArray[TS_SECTION0].bufferSize = FMQ_SIZE_16M;
|
||||
filterArray[TS_SECTION0].settings.ts().tpid = 48;
|
||||
filterArray[TS_SECTION0].settings.ts().tpid = 256;
|
||||
filterArray[TS_SECTION0].settings.ts().filterSettings.section({
|
||||
.isRaw = false,
|
||||
});
|
||||
|
@ -224,7 +224,7 @@ inline void initDvrConfig() {
|
|||
.packetSize = 188,
|
||||
};
|
||||
dvrArray[DVR_PLAYBACK0].type = DvrType::PLAYBACK;
|
||||
dvrArray[DVR_PLAYBACK0].playbackInputFile = "/vendor/etc/test1.ts";
|
||||
dvrArray[DVR_PLAYBACK0].playbackInputFile = "/vendor/etc/segment000000.ts";
|
||||
dvrArray[DVR_PLAYBACK0].bufferSize = FMQ_SIZE_4M;
|
||||
dvrArray[DVR_PLAYBACK0].settings.playback(playbackSettings);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue