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

Commit 73a53868 authored by Hongguang Chen's avatar Hongguang Chen Committed by Gerrit Code Review
Browse files

Merge "Skip filter event test for passthrough filters" into android14-tests-dev

parents ffd124ac 17a3bf0b
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -100,7 +100,9 @@ void TunerFilterAidlTest::reconfigSingleFilterInDemuxTest(FilterConfig filterCon
    ASSERT_TRUE(mFilterTests.configFilter(filterReconf.settings, filterId));
    ASSERT_TRUE(mFilterTests.startFilter(filterId));
    ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/));
    if (!isPassthroughFilter(filterReconf)) {
        ASSERT_TRUE(mFilterTests.startIdTest(filterId));
    }
    ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/));
    ASSERT_TRUE(mFilterTests.stopFilter(filterId));
    ASSERT_TRUE(mFilterTests.closeFilter(filterId));
@@ -152,7 +154,9 @@ void TunerBroadcastAidlTest::broadcastSingleFilterTest(FilterConfig filterConf,
    ASSERT_TRUE(mFilterTests.startFilter(filterId));
    // tune test
    ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/));
    if (!isPassthroughFilter(filterConf)) {
        ASSERT_TRUE(filterDataOutputTest());
    }
    ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/));
    ASSERT_TRUE(mFilterTests.stopFilter(filterId));
    ASSERT_TRUE(mFilterTests.closeFilter(filterId));
@@ -210,7 +214,9 @@ void TunerBroadcastAidlTest::mediaFilterUsingSharedMemoryTest(FilterConfig filte
    ASSERT_TRUE(mFilterTests.startFilter(filterId));
    // tune test
    ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/));
    if (!isPassthroughFilter(filterConf)) {
        ASSERT_TRUE(filterDataOutputTest());
    }
    ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/));
    ASSERT_TRUE(mFilterTests.stopFilter(filterId));
    ASSERT_TRUE(mFilterTests.releaseShareAvHandle(filterId));
+22 −0
Original line number Diff line number Diff line
@@ -89,6 +89,28 @@ void clearIds() {
    sectionFilterIds.clear();
}

bool isPassthroughFilter(FilterConfig filterConfig) {
    auto type = filterConfig.type;
    if (type.mainType == DemuxFilterMainType::TS) {
        auto subType = type.subType.get<DemuxFilterSubType::Tag::tsFilterType>();
        if (subType == DemuxTsFilterType::AUDIO || subType == DemuxTsFilterType::VIDEO) {
            auto tsFilterSettings = filterConfig.settings.get<DemuxFilterSettings::Tag::ts>();
            auto avSettings = tsFilterSettings.filterSettings
                    .get<DemuxTsFilterSettingsFilterSettings::Tag::av>();
            return avSettings.isPassthrough;
        }
    } else if (filterConfig.type.mainType != DemuxFilterMainType::MMTP) {
        auto subType = type.subType.get<DemuxFilterSubType::Tag::mmtpFilterType>();
        if (subType == DemuxMmtpFilterType::AUDIO || subType == DemuxMmtpFilterType::VIDEO) {
            auto mmtpFilterSettings = filterConfig.settings.get<DemuxFilterSettings::Tag::mmtp>();
            auto avSettings = mmtpFilterSettings.filterSettings
                    .get<DemuxMmtpFilterSettingsFilterSettings::Tag::av>();
            return avSettings.isPassthrough;
        }
    }
    return false;
}

enum class Dataflow_Context { LNBRECORD, RECORD, DESCRAMBLING, LNBDESCRAMBLING };

class TunerLnbAidlTest : public testing::TestWithParam<std::string> {