Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 101901bf authored by Amy Zhang's avatar Amy Zhang Committed by Automerger Merge Worker
Browse files

Merge "Refactoring the Dvr data flow tests in the Tuner VTS" into rvc-dev am: 5a49885b

Change-Id: Ifdfe6b21fafbd6ddf3915719f7ca6a3fd29ee051
parents f26b11ea 5a49885b
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -73,18 +73,22 @@ Return<Result> Filter::configure(const DemuxFilterSettings& settings) {
    switch (mType.mainType) {
        case DemuxFilterMainType::TS:
            mTpid = settings.ts().tpid;
            if (mType.subType.tsFilterType() == DemuxTsFilterType::AUDIO ||
                mType.subType.tsFilterType() == DemuxTsFilterType::VIDEO) {
                mIsMediaFilter = true;
            }
            break;
        case DemuxFilterMainType::MMTP:
            /*mmtpSettings*/
            if (mType.subType.mmtpFilterType() == DemuxMmtpFilterType::AUDIO ||
                mType.subType.mmtpFilterType() == DemuxMmtpFilterType::VIDEO) {
                mIsMediaFilter = true;
            }
            break;
        case DemuxFilterMainType::IP:
            /*ipSettings*/
            break;
        case DemuxFilterMainType::TLV:
            /*tlvSettings*/
            break;
        case DemuxFilterMainType::ALP:
            /*alpSettings*/
            break;
        default:
            break;
@@ -241,9 +245,7 @@ void Filter::filterThreadLoop() {
}

void Filter::freeAvHandle() {
    if (mType.mainType != DemuxFilterMainType::TS ||
        (mType.subType.tsFilterType() == DemuxTsFilterType::AUDIO &&
         mType.subType.tsFilterType() == DemuxTsFilterType::VIDEO)) {
    if (!mIsMediaFilter) {
        return;
    }
    for (int i = 0; i < mFilterEvent.events.size(); i++) {
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ class Filter : public IFilter {
    uint32_t mFilterId;
    uint32_t mBufferSize;
    DemuxFilterType mType;
    bool mIsMediaFilter = false;
    DemuxFilterSettings mFilterSettings;

    uint16_t mTpid;
+3 −3
Original line number Diff line number Diff line
@@ -186,14 +186,14 @@ void DvrCallback::stopRecordThread() {
    android::Mutex::Autolock autoLock(mRecordThreadLock);
}

AssertionResult DvrTests::openDvrInDemux(DvrType type) {
AssertionResult DvrTests::openDvrInDemux(DvrType type, uint32_t bufferSize) {
    Result status;
    EXPECT_TRUE(mDemux) << "Test with openDemux first.";

    // Create dvr callback
    mDvrCallback = new DvrCallback();

    mDemux->openDvr(type, FMQ_SIZE_1M, mDvrCallback, [&](Result result, const sp<IDvr>& dvr) {
    mDemux->openDvr(type, bufferSize, mDvrCallback, [&](Result result, const sp<IDvr>& dvr) {
        mDvr = dvr;
        status = result;
    });
+3 −3
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ class DvrTests {
    void setService(sp<ITuner> tuner) { mService = tuner; }
    void setDemux(sp<IDemux> demux) { mDemux = demux; }

    void startPlaybackInputThread(string dataInputFile, PlaybackSettings settings) {
    void startPlaybackInputThread(string& dataInputFile, PlaybackSettings& settings) {
        PlaybackConf conf{
                .inputDataFile = dataInputFile,
                .setting = settings,
@@ -162,7 +162,7 @@ class DvrTests {
    void testRecordOutput() { mDvrCallback->testRecordOutput(); }
    void stopRecordThread() { mDvrCallback->stopPlaybackThread(); }

    AssertionResult openDvrInDemux(DvrType type);
    AssertionResult openDvrInDemux(DvrType type, uint32_t bufferSize);
    AssertionResult configDvr(DvrSettings setting);
    AssertionResult getDvrMQDescriptor();
    AssertionResult attachFilterToDvr(sp<IFilter> filter);
+3 −3
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ bool FilterCallback::dumpAvData(DemuxFilterMediaEvent event) {
    return true;
}

AssertionResult FilterTests::openFilterInDemux(DemuxFilterType type) {
AssertionResult FilterTests::openFilterInDemux(DemuxFilterType type, uint32_t bufferSize) {
    Result status;
    EXPECT_TRUE(mDemux) << "Test with openDemux first.";

@@ -136,7 +136,7 @@ AssertionResult FilterTests::openFilterInDemux(DemuxFilterType type) {
    mFilterCallback = new FilterCallback();

    // Add filter to the local demux
    mDemux->openFilter(type, FMQ_SIZE_16M, mFilterCallback,
    mDemux->openFilter(type, bufferSize, mFilterCallback,
                       [&](Result result, const sp<IFilter>& filter) {
                           mFilter = filter;
                           status = result;
Loading