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

Commit 17a3bf0b authored by Ray Chin's avatar Ray Chin
Browse files

Skip filter event test for passthrough filters

For passthrough filter, the media event won't be sent through tuner
framework. We should skip those tests in vts.

Bug: 369466988
Test: atest VtsHalTvTunertargetTest on cf_x86_tv
Change-Id: Iccf7ed728440e4b6ab4282e29bc7d96067d10ff6
parent f6833397
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> {