From e6915053455ec7a2b616a5ecb82cb6c82e32c307 Mon Sep 17 00:00:00 2001 From: Amy Zhang Date: Tue, 30 Mar 2021 13:44:43 -0700 Subject: [PATCH] Refactor Tuner 1.0 vts to use dynamic configuration This CL starts the refatoring of Tuner 1.0 vts configuration file to replace the previous manual config with the current dynamic config using xml/xsd. Note that this CL only connects the frontend setting section with the dynamic config. The CLs to connect other hardware configs will come as child CLs. This CL also has some default implementation/vts test impl changes to sync the sc-dev vts 1.0 with the aosp. Child CL will also replace the 1.1 manual config with the dynamic config. Test: atest VtsHalTvTunerV1_0TargetTest Bug: 182519645 CTS-Coverage-Bug: 184077478 Change-Id: I13e6ea3d91e474c10e4f822a6ce59d99cc7c7d1d --- tv/tuner/1.0/default/Tuner.cpp | 2 + tv/tuner/1.0/vts/functional/Android.bp | 12 + tv/tuner/1.0/vts/functional/FrontendTests.h | 1 + .../VtsHalTvTunerV1_0TargetTest.cpp | 101 +++--- .../functional/VtsHalTvTunerV1_0TargetTest.h | 36 ++- .../VtsHalTvTunerV1_0TestConfigurations.h | 114 +++---- tv/tuner/1.1/default/Tuner.cpp | 2 + tv/tuner/config/Android.bp | 31 ++ tv/tuner/config/TunerTestingConfigReader.h | 293 ++++++++++++++++++ tv/tuner/config/api/current.txt | 143 +++++++++ tv/tuner/config/api/last_current.txt | 0 tv/tuner/config/api/last_removed.txt | 0 tv/tuner/config/api/removed.txt | 1 + tv/tuner/config/sample_tuner_vts_config.xml | 75 +++++ .../tuner_testing_dynamic_configuration.xsd | 188 +++++++++++ 15 files changed, 882 insertions(+), 117 deletions(-) create mode 100644 tv/tuner/config/Android.bp create mode 100644 tv/tuner/config/TunerTestingConfigReader.h create mode 100644 tv/tuner/config/api/current.txt create mode 100644 tv/tuner/config/api/last_current.txt create mode 100644 tv/tuner/config/api/last_removed.txt create mode 100644 tv/tuner/config/api/removed.txt create mode 100644 tv/tuner/config/sample_tuner_vts_config.xml create mode 100644 tv/tuner/config/tuner_testing_dynamic_configuration.xsd diff --git a/tv/tuner/1.0/default/Tuner.cpp b/tv/tuner/1.0/default/Tuner.cpp index 9a6ecf704f..c4f610ee23 100644 --- a/tv/tuner/1.0/default/Tuner.cpp +++ b/tv/tuner/1.0/default/Tuner.cpp @@ -139,6 +139,8 @@ Return Tuner::getDemuxCaps(getDemuxCaps_cb _hidl_cb) { // IP filter can be an MMTP filter's data source. caps.linkCaps = {0x00, 0x00, 0x02, 0x00, 0x00}; + // Support time filter testing + caps.bTimeFilter = true; _hidl_cb(Result::SUCCESS, caps); return Void(); } diff --git a/tv/tuner/1.0/vts/functional/Android.bp b/tv/tuner/1.0/vts/functional/Android.bp index c27a935c2e..6187c738ee 100644 --- a/tv/tuner/1.0/vts/functional/Android.bp +++ b/tv/tuner/1.0/vts/functional/Android.bp @@ -35,6 +35,15 @@ cc_test { "DescramblerTests.cpp", "LnbTests.cpp", ], + generated_headers: [ + "tuner_testing_dynamic_configuration_V1_0_enums", + "tuner_testing_dynamic_configuration_V1_0_parser", + ], + generated_sources: [ + "tuner_testing_dynamic_configuration_V1_0_enums", + "tuner_testing_dynamic_configuration_V1_0_parser", + ], + header_libs: ["libxsdc-utils"], static_libs: [ "android.hardware.cas@1.0", "android.hardware.cas@1.1", @@ -49,9 +58,12 @@ cc_test { ], shared_libs: [ "libbinder", + "libxml2", ], data: [ ":tuner_frontend_input_ts", + ":tuner_frontend_input_es", + ":tuner_testing_dynamic_configuration_V1_0", ], test_suites: [ "general-tests", diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.h b/tv/tuner/1.0/vts/functional/FrontendTests.h index 4974ff351e..33ff603b85 100644 --- a/tv/tuner/1.0/vts/functional/FrontendTests.h +++ b/tv/tuner/1.0/vts/functional/FrontendTests.h @@ -132,6 +132,7 @@ class FrontendTests { static AssertionResult failure() { return ::testing::AssertionFailure(); } static AssertionResult success() { return ::testing::AssertionSuccess(); } + // TODO: replace with customized dvr input void getDefaultSoftwareFrontendPlaybackConfig(DvrConfig& dvrConfig) { PlaybackSettings playbackSettings{ .statusMask = 0xf, diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp index 891619a810..92996f9dc7 100644 --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp @@ -18,16 +18,15 @@ namespace { -AssertionResult TunerBroadcastHidlTest::filterDataOutputTest(vector /*goldenOutputFiles*/) { +AssertionResult TunerBroadcastHidlTest::filterDataOutputTest() { return filterDataOutputTestBase(mFilterTests); } -AssertionResult TunerPlaybackHidlTest::filterDataOutputTest(vector /*goldenOutputFiles*/) { +AssertionResult TunerPlaybackHidlTest::filterDataOutputTest() { return filterDataOutputTestBase(mFilterTests); } -AssertionResult TunerDescramblerHidlTest::filterDataOutputTest( - vector /*goldenOutputFiles*/) { +AssertionResult TunerDescramblerHidlTest::filterDataOutputTest() { return filterDataOutputTestBase(mFilterTests); } @@ -62,8 +61,14 @@ void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) { } uint32_t demuxId; sp demux; + DemuxCapabilities caps; ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId)); + // TODO: add time filter hardware support checker + ASSERT_TRUE(mDemuxTests.getDemuxCaps(caps)); + if (!caps.bTimeFilter) { + return; + } mFilterTests.setDemux(demux); ASSERT_TRUE(mFilterTests.openTimeFilterInDemux()); ASSERT_TRUE(mFilterTests.setTimeStamp(filterConf.timeStamp)); @@ -75,9 +80,6 @@ void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) { void TunerBroadcastHidlTest::broadcastSingleFilterTest(FilterConfig filterConf, FrontendConfig frontendConf) { - if (!frontendConf.enable) { - return; - } uint32_t feId; uint32_t demuxId; sp demux; @@ -106,7 +108,7 @@ void TunerBroadcastHidlTest::broadcastSingleFilterTest(FilterConfig filterConf, ASSERT_TRUE(mFilterTests.startFilter(filterId)); // tune test ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); - ASSERT_TRUE(filterDataOutputTest(goldenOutputFiles)); + ASSERT_TRUE(filterDataOutputTest()); ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); ASSERT_TRUE(mFilterTests.stopFilter(filterId)); ASSERT_TRUE(mFilterTests.closeFilter(filterId)); @@ -119,12 +121,12 @@ void TunerBroadcastHidlTest::broadcastSingleFilterTestWithLnb(FilterConfig filte LnbConfig lnbConf) { vector ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); - if (!lnbConf.usingLnb) { + if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); - *mLnbId = ids[0]; + mLnbId = &ids[0]; ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); @@ -152,7 +154,7 @@ void TunerPlaybackHidlTest::playbackSingleFilterTest(FilterConfig filterConf, Dv mDvrTests.startPlaybackInputThread(dvrConf.playbackInputFile, dvrConf.settings.playback()); ASSERT_TRUE(mDvrTests.startDvrPlayback()); ASSERT_TRUE(mFilterTests.startFilter(filterId)); - ASSERT_TRUE(filterDataOutputTest(goldenOutputFiles)); + ASSERT_TRUE(filterDataOutputTest()); mDvrTests.stopPlaybackThread(); ASSERT_TRUE(mFilterTests.stopFilter(filterId)); ASSERT_TRUE(mDvrTests.stopDvrPlayback()); @@ -163,9 +165,6 @@ void TunerPlaybackHidlTest::playbackSingleFilterTest(FilterConfig filterConf, Dv void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf, FrontendConfig frontendConf, DvrConfig dvrConf) { - if (!frontendConf.enable) { - return; - } uint32_t feId; uint32_t demuxId; sp demux; @@ -215,12 +214,12 @@ void TunerRecordHidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf, DvrConfig dvrConf, LnbConfig lnbConf) { vector ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); - if (!lnbConf.usingLnb) { + if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); ASSERT_TRUE(mLnbTests.openLnbById(ids[0])); - *mLnbId = ids[0]; + mLnbId = &ids[0]; ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage)); ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone)); @@ -271,9 +270,6 @@ void TunerRecordHidlTest::attachSingleFilterToRecordDvrTest(FilterConfig filterC void TunerDescramblerHidlTest::scrambledBroadcastTest(set mediaFilterConfs, FrontendConfig frontendConf, DescramblerConfig descConfig) { - if (!frontendConf.enable) { - return; - } uint32_t feId; uint32_t demuxId; sp demux; @@ -319,7 +315,7 @@ void TunerDescramblerHidlTest::scrambledBroadcastTest(set m } // tune test ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); - ASSERT_TRUE(filterDataOutputTest(goldenOutputFiles)); + ASSERT_TRUE(filterDataOutputTest()); ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); for (id = filterIds.begin(); id != filterIds.end(); id++) { ASSERT_TRUE(mFilterTests.stopFilter(*id)); @@ -337,21 +333,27 @@ void TunerDescramblerHidlTest::scrambledBroadcastTest(set m TEST_P(TunerFrontendHidlTest, TuneFrontend) { description("Tune one Frontend with specific setting and check Lock event"); - mFrontendTests.tuneTest(frontendArray[defaultFrontend]); + mFrontendTests.tuneTest(frontendMap[live.frontendId]); } TEST_P(TunerFrontendHidlTest, AutoScanFrontend) { description("Run an auto frontend scan with specific setting and check lock scanMessage"); - mFrontendTests.scanTest(frontendScanArray[defaultScanFrontend], FrontendScanType::SCAN_AUTO); + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_AUTO); } TEST_P(TunerFrontendHidlTest, BlindScanFrontend) { description("Run an blind frontend scan with specific setting and check lock scanMessage"); - mFrontendTests.scanTest(frontendScanArray[defaultScanFrontend], FrontendScanType::SCAN_BLIND); + mFrontendTests.scanTest(frontendMap[scan.frontendId], FrontendScanType::SCAN_BLIND); } TEST_P(TunerLnbHidlTest, OpenLnbByName) { description("Open and configure an Lnb with name then send a diseqc msg to it."); + // TODO: add lnb hardware support checker + vector ids; + ASSERT_TRUE(mLnbTests.getLnbIds(ids)); + if (ids.size() == 0) { + return; + } ASSERT_TRUE(mLnbTests.openLnbByName(lnbArray[LNB_EXTERNAL].name)); ASSERT_TRUE(mLnbTests.setLnbCallback()); ASSERT_TRUE(mLnbTests.setVoltage(lnbArray[LNB_EXTERNAL].voltage)); @@ -365,7 +367,7 @@ TEST_P(TunerLnbHidlTest, SendDiseqcMessageToLnb) { description("Open and configure an Lnb with specific settings then send a diseqc msg to it."); vector ids; ASSERT_TRUE(mLnbTests.getLnbIds(ids)); - if (!lnbArray[LNB0].usingLnb) { + if (ids.size() == 0) { return; } ASSERT_TRUE(ids.size() > 0); @@ -383,7 +385,7 @@ TEST_P(TunerDemuxHidlTest, openDemux) { uint32_t feId; uint32_t demuxId; sp demux; - mFrontendTests.getFrontendIdByType(frontendArray[defaultFrontend].type, feId); + mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback()); @@ -403,7 +405,7 @@ TEST_P(TunerDemuxHidlTest, getAvSyncTime) { uint32_t avSyncHwId; sp mediaFilter; - mFrontendTests.getFrontendIdByType(frontendArray[defaultFrontend].type, feId); + mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback()); @@ -431,7 +433,7 @@ TEST_P(TunerDemuxHidlTest, getAvSyncTime) { TEST_P(TunerFilterHidlTest, StartFilterInDemux) { description("Open and start a filter in Demux."); // TODO use paramterized tests - configSingleFilterInDemuxTest(filterArray[TS_VIDEO0], frontendArray[defaultFrontend]); + configSingleFilterInDemuxTest(filterArray[TS_VIDEO0], frontendMap[live.frontendId]); } TEST_P(TunerFilterHidlTest, SetFilterLinkage) { @@ -472,27 +474,27 @@ TEST_P(TunerFilterHidlTest, testTimeFilter) { TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowVideoFilterTest) { description("Test Video Filter functionality in Broadcast use case."); - broadcastSingleFilterTest(filterArray[TS_VIDEO1], frontendArray[defaultFrontend]); + broadcastSingleFilterTest(filterArray[TS_VIDEO1], frontendMap[live.frontendId]); } TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowAudioFilterTest) { description("Test Audio Filter functionality in Broadcast use case."); - broadcastSingleFilterTest(filterArray[TS_AUDIO0], frontendArray[defaultFrontend]); + broadcastSingleFilterTest(filterArray[TS_AUDIO0], frontendMap[live.frontendId]); } TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowSectionFilterTest) { description("Test Section Filter functionality in Broadcast use case."); - broadcastSingleFilterTest(filterArray[TS_SECTION0], frontendArray[defaultFrontend]); + broadcastSingleFilterTest(filterArray[TS_SECTION0], frontendMap[live.frontendId]); } TEST_P(TunerBroadcastHidlTest, IonBufferTest) { description("Test the av filter data bufferring."); - broadcastSingleFilterTest(filterArray[TS_VIDEO0], frontendArray[defaultFrontend]); + broadcastSingleFilterTest(filterArray[TS_VIDEO0], frontendMap[live.frontendId]); } TEST_P(TunerBroadcastHidlTest, LnbBroadcastDataFlowVideoFilterTest) { description("Test Video Filter functionality in Broadcast with Lnb use case."); - broadcastSingleFilterTest(filterArray[TS_VIDEO0], frontendArray[DVBS]); + broadcastSingleFilterTest(filterArray[TS_VIDEO0], frontendMap[live.frontendId]); } TEST_P(TunerBroadcastHidlTest, BroadcastEsDataFlowMediaFiltersTest) { @@ -502,7 +504,7 @@ TEST_P(TunerBroadcastHidlTest, BroadcastEsDataFlowMediaFiltersTest) { sp demux; uint32_t filterId; - mFrontendTests.getFrontendIdByType(frontendArray[defaultFrontend].type, feId); + mFrontendTests.getFrontendIdByType(frontendMap[live.frontendId].type, feId); if (feId == INVALID_ID) { // TODO broadcast test on Cuttlefish needs licensed ts input, // these tests are runnable on vendor device with real frontend module @@ -528,6 +530,7 @@ TEST_P(TunerBroadcastHidlTest, BroadcastEsDataFlowMediaFiltersTest) { ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterArray[TS_VIDEO1].getMqDesc)); ASSERT_TRUE(mFilterTests.startFilter(filterId)); // tune test + // TODO: replace with customized dvr input PlaybackSettings playbackSettings{ .statusMask = 0xf, .lowThreshold = 0x1000, @@ -542,9 +545,8 @@ TEST_P(TunerBroadcastHidlTest, BroadcastEsDataFlowMediaFiltersTest) { }; dvrConfig.settings.playback(playbackSettings); mFrontendTests.setSoftwareFrontendDvrConfig(dvrConfig); - ASSERT_TRUE( - mFrontendTests.tuneFrontend(frontendArray[defaultFrontend], true /*testWithDemux*/)); - ASSERT_TRUE(filterDataOutputTest(goldenOutputFiles)); + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendMap[live.frontendId], true /*testWithDemux*/)); + ASSERT_TRUE(filterDataOutputTest()); ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); ASSERT_TRUE(mFilterTests.stopFilter(filterId)); ASSERT_TRUE(mFilterTests.closeFilter(filterId)); @@ -560,27 +562,40 @@ TEST_P(TunerPlaybackHidlTest, PlaybackDataFlowWithTsSectionFilterTest) { TEST_P(TunerRecordHidlTest, AttachFiltersToRecordTest) { description("Attach a single filter to the record dvr test."); // TODO use paramterized tests - attachSingleFilterToRecordDvrTest(filterArray[TS_RECORD0], frontendArray[defaultFrontend], + if (!record.support) { + return; + } + attachSingleFilterToRecordDvrTest(filterArray[TS_RECORD0], frontendMap[record.frontendId], dvrArray[DVR_RECORD0]); } TEST_P(TunerRecordHidlTest, RecordDataFlowWithTsRecordFilterTest) { description("Feed ts data from frontend to recording and test with ts record filter"); - recordSingleFilterTest(filterArray[TS_RECORD0], frontendArray[defaultFrontend], + if (!record.support) { + return; + } + recordSingleFilterTest(filterArray[TS_RECORD0], frontendMap[record.frontendId], dvrArray[DVR_RECORD0]); } TEST_P(TunerRecordHidlTest, LnbRecordDataFlowWithTsRecordFilterTest) { description("Feed ts data from Fe with Lnb to recording and test with ts record filter"); - recordSingleFilterTest(filterArray[TS_RECORD0], frontendArray[DVBS], dvrArray[DVR_RECORD0]); + if (record.support) { + return; + } + recordSingleFilterTestWithLnb(filterArray[TS_RECORD0], frontendMap[lnbRecord.frontendId], + dvrArray[DVR_RECORD0], lnbArray[LNB0]); } TEST_P(TunerDescramblerHidlTest, CreateDescrambler) { description("Create Descrambler"); + if (descrambling.support) { + return; + } uint32_t feId; uint32_t demuxId; sp demux; - mFrontendTests.getFrontendIdByType(frontendArray[defaultFrontend].type, feId); + mFrontendTests.getFrontendIdByType(frontendMap[descrambling.frontendId].type, feId); ASSERT_TRUE(feId != INVALID_ID); ASSERT_TRUE(mFrontendTests.openFrontendById(feId)); ASSERT_TRUE(mFrontendTests.setFrontendCallback()); @@ -594,10 +609,14 @@ TEST_P(TunerDescramblerHidlTest, CreateDescrambler) { TEST_P(TunerDescramblerHidlTest, ScrambledBroadcastDataFlowMediaFiltersTest) { description("Test ts audio filter in scrambled broadcast use case"); + if (descrambling.support) { + return; + } set filterConfs; filterConfs.insert(filterArray[TS_AUDIO0]); filterConfs.insert(filterArray[TS_VIDEO1]); - scrambledBroadcastTest(filterConfs, frontendArray[defaultFrontend], descramblerArray[DESC_0]); + scrambledBroadcastTest(filterConfs, frontendMap[descrambling.frontendId], + descramblerArray[DESC_0]); } INSTANTIATE_TEST_SUITE_P( diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h index 5a23ca5f4a..d1f6a45366 100644 --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.h @@ -28,14 +28,24 @@ static AssertionResult success() { namespace { -void initConfiguration() { +bool initConfiguration() { + if (!TunerTestingConfigReader::checkConfigFileExists()) { + return false; + } initFrontendConfig(); - initFrontendScanConfig(); + connectHardwaresToTestCases(); + if (!validateConnections()) { + ALOGW("[vts] failed to validate connections."); + return false; + } + initLnbConfig(); initFilterConfig(); initTimeFilterConfig(); initDvrConfig(); initDescramblerConfig(); + + return true; } AssertionResult filterDataOutputTestBase(FilterTests tests) { @@ -53,7 +63,7 @@ class TunerFrontendHidlTest : public testing::TestWithParam { virtual void SetUp() override { mService = ITuner::getService(GetParam()); ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); } @@ -75,7 +85,7 @@ class TunerLnbHidlTest : public testing::TestWithParam { virtual void SetUp() override { mService = ITuner::getService(GetParam()); ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mLnbTests.setService(mService); } @@ -97,7 +107,7 @@ class TunerDemuxHidlTest : public testing::TestWithParam { virtual void SetUp() override { mService = ITuner::getService(GetParam()); ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -123,7 +133,7 @@ class TunerFilterHidlTest : public testing::TestWithParam { virtual void SetUp() override { mService = ITuner::getService(GetParam()); ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -152,7 +162,7 @@ class TunerBroadcastHidlTest : public testing::TestWithParam { virtual void SetUp() override { mService = ITuner::getService(GetParam()); ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -173,7 +183,7 @@ class TunerBroadcastHidlTest : public testing::TestWithParam { LnbTests mLnbTests; DvrTests mDvrTests; - AssertionResult filterDataOutputTest(vector goldenOutputFiles); + AssertionResult filterDataOutputTest(); void broadcastSingleFilterTest(FilterConfig filterConf, FrontendConfig frontendConf); void broadcastSingleFilterTestWithLnb(FilterConfig filterConf, FrontendConfig frontendConf, @@ -191,7 +201,7 @@ class TunerPlaybackHidlTest : public testing::TestWithParam { virtual void SetUp() override { mService = ITuner::getService(GetParam()); ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -210,7 +220,7 @@ class TunerPlaybackHidlTest : public testing::TestWithParam { FilterTests mFilterTests; DvrTests mDvrTests; - AssertionResult filterDataOutputTest(vector goldenOutputFiles); + AssertionResult filterDataOutputTest(); void playbackSingleFilterTest(FilterConfig filterConf, DvrConfig dvrConf); }; @@ -223,7 +233,7 @@ class TunerRecordHidlTest : public testing::TestWithParam { virtual void SetUp() override { mService = ITuner::getService(GetParam()); ASSERT_NE(mService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -265,7 +275,7 @@ class TunerDescramblerHidlTest : public testing::TestWithParam { mCasService = IMediaCasService::getService(); ASSERT_NE(mService, nullptr); ASSERT_NE(mCasService, nullptr); - initConfiguration(); + ASSERT_TRUE(initConfiguration()); mFrontendTests.setService(mService); mDemuxTests.setService(mService); @@ -281,7 +291,7 @@ class TunerDescramblerHidlTest : public testing::TestWithParam { void scrambledBroadcastTest(set mediaFilterConfs, FrontendConfig frontendConf, DescramblerConfig descConfig); - AssertionResult filterDataOutputTest(vector /*goldenOutputFiles*/); + AssertionResult filterDataOutputTest(); sp mService; sp mCasService; diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h index 834e296872..384455bc74 100644 --- a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h +++ b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TestConfigurations.h @@ -21,6 +21,9 @@ #include #include +#include "../../../config/TunerTestingConfigReader.h" + +// TODO: remove unnecessary imports after config reader refactoring is done. using android::hardware::tv::tuner::V1_0::DataFormat; using android::hardware::tv::tuner::V1_0::DemuxAlpFilterType; using android::hardware::tv::tuner::V1_0::DemuxFilterEvent; @@ -54,7 +57,9 @@ using android::hardware::tv::tuner::V1_0::PlaybackSettings; using android::hardware::tv::tuner::V1_0::RecordSettings; using namespace std; +using namespace android::media::tuner::testing::configuration::V1_0; +// TODO: remove all the constants and structs after config reader refactoring is done. const uint32_t FMQ_SIZE_512K = 0x80000; const uint32_t FMQ_SIZE_1M = 0x100000; const uint32_t FMQ_SIZE_4M = 0x400000; @@ -98,12 +103,6 @@ typedef enum { LINKAGE_DIR, } Linkage; -typedef enum { - DVBT, - DVBS, - FRONTEND_MAX, -} Frontend; - typedef enum { LNB0, LNB_EXTERNAL, @@ -115,11 +114,6 @@ typedef enum { DISEQC_MAX, } Diseqc; -typedef enum { - SCAN_DVBT, - SCAN_MAX, -} FrontendScan; - typedef enum { DVR_RECORD0, DVR_PLAYBACK0, @@ -145,15 +139,6 @@ struct TimeFilterConfig { uint64_t timeStamp; }; -struct FrontendConfig { - bool enable; - bool isSoftwareFe; - FrontendType type; - FrontendSettings settings; - vector tuneStatusTypes; - vector expectTuneStatuses; -}; - struct LnbConfig { bool usingLnb; string name; @@ -162,14 +147,6 @@ struct LnbConfig { LnbPosition position; }; -struct ChannelConfig { - int32_t frontendId; - int32_t channelId; - std::string channelName; - DemuxTpid videoPid; - DemuxTpid audioPid; -}; - struct DvrConfig { DvrType type; uint32_t bufferSize; @@ -183,67 +160,78 @@ struct DescramblerConfig { vector hidlPvtData; }; -static FrontendConfig frontendArray[FILTER_MAX]; -static FrontendConfig frontendScanArray[SCAN_MAX]; +// TODO: remove all the manual config array after the dynamic config refactoring is done. static LnbConfig lnbArray[LNB_MAX]; static vector diseqcMsgArray[DISEQC_MAX]; -static ChannelConfig channelArray[FRONTEND_MAX]; static FilterConfig filterArray[FILTER_MAX]; static TimeFilterConfig timeFilterArray[TIMER_MAX]; static DemuxFilterType filterLinkageTypes[LINKAGE_DIR][FILTER_MAIN_TYPE_BIT_COUNT]; static DvrConfig dvrArray[DVR_MAX]; static DescramblerConfig descramblerArray[DESC_MAX]; -static vector goldenOutputFiles; -static int defaultFrontend = DVBT; -static int defaultScanFrontend = SCAN_DVBT; + +// Hardware configs +static map frontendMap; + +// Hardware and test cases connections +static LiveBroadcastHardwareConnections live; +static ScanHardwareConnections scan; +static DvrRecordHardwareConnections record; +static DescramblingHardwareConnections descrambling; +static LnbLiveHardwareConnections lnbLive; +static LnbRecordHardwareConnections lnbRecord; /** Configuration array for the frontend tune test */ inline void initFrontendConfig() { + // The test will use the internal default fe is default fe is connected to any data flow without + // overriding in the xml config. + string defaultFeId = "FE_DEFAULT"; FrontendDvbtSettings dvbtSettings{ .frequency = 578000, .transmissionMode = FrontendDvbtTransmissionMode::AUTO, .bandwidth = FrontendDvbtBandwidth::BANDWIDTH_8MHZ, - .constellation = FrontendDvbtConstellation::AUTO, - .hierarchy = FrontendDvbtHierarchy::AUTO, - .hpCoderate = FrontendDvbtCoderate::AUTO, - .lpCoderate = FrontendDvbtCoderate::AUTO, - .guardInterval = FrontendDvbtGuardInterval::AUTO, .isHighPriority = true, - .standard = FrontendDvbtStandard::T, }; - frontendArray[DVBT].type = FrontendType::DVBT, frontendArray[DVBT].settings.dvbt(dvbtSettings); + frontendMap[defaultFeId].type = FrontendType::DVBT; + frontendMap[defaultFeId].settings.dvbt(dvbtSettings); + vector types; types.push_back(FrontendStatusType::DEMOD_LOCK); FrontendStatus status; status.isDemodLocked(true); vector statuses; statuses.push_back(status); - frontendArray[DVBT].tuneStatusTypes = types; - frontendArray[DVBT].expectTuneStatuses = statuses; - frontendArray[DVBT].isSoftwareFe = true; - frontendArray[DVBT].enable = true; - frontendArray[DVBS].type = FrontendType::DVBS; - frontendArray[DVBS].enable = true; - frontendArray[DVBS].isSoftwareFe = true; + frontendMap[defaultFeId].tuneStatusTypes = types; + frontendMap[defaultFeId].expectTuneStatuses = statuses; + frontendMap[defaultFeId].isSoftwareFe = true; + + // Read customized config + TunerTestingConfigReader::readFrontendConfig1_0(frontendMap); }; -/** Configuration array for the frontend scan test */ -inline void initFrontendScanConfig() { - frontendScanArray[SCAN_DVBT].type = FrontendType::DVBT; - frontendScanArray[SCAN_DVBT].settings.dvbt({ - .frequency = 578000, - .transmissionMode = FrontendDvbtTransmissionMode::MODE_8K, - .bandwidth = FrontendDvbtBandwidth::BANDWIDTH_8MHZ, - .constellation = FrontendDvbtConstellation::AUTO, - .hierarchy = FrontendDvbtHierarchy::AUTO, - .hpCoderate = FrontendDvbtCoderate::AUTO, - .lpCoderate = FrontendDvbtCoderate::AUTO, - .guardInterval = FrontendDvbtGuardInterval::AUTO, - .isHighPriority = true, - .standard = FrontendDvbtStandard::T, - }); +/** Read the vendor configurations of which hardware to use for each test cases/data flows */ +inline void connectHardwaresToTestCases() { + TunerTestingConfigReader::connectLiveBroadcast(live); + TunerTestingConfigReader::connectScan(scan); + TunerTestingConfigReader::connectDvrRecord(record); + TunerTestingConfigReader::connectDescrambling(descrambling); + TunerTestingConfigReader::connectLnbLive(lnbLive); + TunerTestingConfigReader::connectLnbRecord(lnbRecord); }; +inline bool validateConnections() { + bool feIsValid = frontendMap.find(live.frontendId) != frontendMap.end() && + frontendMap.find(scan.frontendId) != frontendMap.end(); + feIsValid &= record.support ? frontendMap.find(record.frontendId) != frontendMap.end() : true; + feIsValid &= descrambling.support + ? frontendMap.find(descrambling.frontendId) != frontendMap.end() + : true; + feIsValid &= lnbLive.support ? frontendMap.find(lnbLive.frontendId) != frontendMap.end() : true; + feIsValid &= + lnbRecord.support ? frontendMap.find(lnbRecord.frontendId) != frontendMap.end() : true; + return feIsValid; +} + +// TODO: remove all the manual configs after the dynamic config refactoring is done. /** Configuration array for the Lnb test */ inline void initLnbConfig() { lnbArray[LNB0].usingLnb = true; diff --git a/tv/tuner/1.1/default/Tuner.cpp b/tv/tuner/1.1/default/Tuner.cpp index 38b2a26da0..1e940ba098 100644 --- a/tv/tuner/1.1/default/Tuner.cpp +++ b/tv/tuner/1.1/default/Tuner.cpp @@ -237,6 +237,8 @@ Return Tuner::getDemuxCaps(getDemuxCaps_cb _hidl_cb) { // IP filter can be an MMTP filter's data source. caps.linkCaps = {0x00, 0x00, 0x02, 0x00, 0x00}; + // Support time filter testing + caps.bTimeFilter = true; _hidl_cb(Result::SUCCESS, caps); return Void(); } diff --git a/tv/tuner/config/Android.bp b/tv/tuner/config/Android.bp new file mode 100644 index 0000000000..ddbf3a74a8 --- /dev/null +++ b/tv/tuner/config/Android.bp @@ -0,0 +1,31 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "hardware_interfaces_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["hardware_interfaces_license"], +} + +xsd_config { + name: "tuner_testing_dynamic_configuration_V1_0", + srcs: ["tuner_testing_dynamic_configuration.xsd"], + package_name: "android.media.tuner.testing.configuration.V1_0", + nullability: true, +} + +xsd_config { + name: "tuner_testing_dynamic_configuration_V1_0_enums", + srcs: ["tuner_testing_dynamic_configuration.xsd"], + package_name: "android.media.tuner.testing.configuration.V1_0", + nullability: true, + enums_only: true, +} + +xsd_config { + name: "tuner_testing_dynamic_configuration_V1_0_parser", + srcs: ["tuner_testing_dynamic_configuration.xsd"], + package_name: "android.media.tuner.testing.configuration.V1_0", + nullability: true, + parser_only: true, +} diff --git a/tv/tuner/config/TunerTestingConfigReader.h b/tv/tuner/config/TunerTestingConfigReader.h new file mode 100644 index 0000000000..5c7f5648d3 --- /dev/null +++ b/tv/tuner/config/TunerTestingConfigReader.h @@ -0,0 +1,293 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace android::media::tuner::testing::configuration::V1_0; + +using android::hardware::tv::tuner::V1_0::DataFormat; +using android::hardware::tv::tuner::V1_0::DemuxAlpFilterType; +using android::hardware::tv::tuner::V1_0::DemuxFilterEvent; +using android::hardware::tv::tuner::V1_0::DemuxFilterMainType; +using android::hardware::tv::tuner::V1_0::DemuxFilterSettings; +using android::hardware::tv::tuner::V1_0::DemuxFilterType; +using android::hardware::tv::tuner::V1_0::DemuxIpFilterType; +using android::hardware::tv::tuner::V1_0::DemuxMmtpFilterType; +using android::hardware::tv::tuner::V1_0::DemuxRecordScIndexType; +using android::hardware::tv::tuner::V1_0::DemuxTlvFilterType; +using android::hardware::tv::tuner::V1_0::DemuxTpid; +using android::hardware::tv::tuner::V1_0::DemuxTsFilterType; +using android::hardware::tv::tuner::V1_0::DvrSettings; +using android::hardware::tv::tuner::V1_0::DvrType; +using android::hardware::tv::tuner::V1_0::FrontendDvbsSettings; +using android::hardware::tv::tuner::V1_0::FrontendDvbtBandwidth; +using android::hardware::tv::tuner::V1_0::FrontendDvbtCoderate; +using android::hardware::tv::tuner::V1_0::FrontendDvbtConstellation; +using android::hardware::tv::tuner::V1_0::FrontendDvbtGuardInterval; +using android::hardware::tv::tuner::V1_0::FrontendDvbtHierarchy; +using android::hardware::tv::tuner::V1_0::FrontendDvbtSettings; +using android::hardware::tv::tuner::V1_0::FrontendDvbtStandard; +using android::hardware::tv::tuner::V1_0::FrontendDvbtTransmissionMode; +using android::hardware::tv::tuner::V1_0::FrontendSettings; +using android::hardware::tv::tuner::V1_0::FrontendStatus; +using android::hardware::tv::tuner::V1_0::FrontendStatusType; +using android::hardware::tv::tuner::V1_0::FrontendType; +using android::hardware::tv::tuner::V1_0::LnbPosition; +using android::hardware::tv::tuner::V1_0::LnbTone; +using android::hardware::tv::tuner::V1_0::LnbVoltage; +using android::hardware::tv::tuner::V1_0::PlaybackSettings; +using android::hardware::tv::tuner::V1_0::RecordSettings; + +const string configFilePath = "/vendor/etc/tuner_vts_config.xml"; + +struct FrontendConfig { + bool isSoftwareFe; + FrontendType type; + FrontendSettings settings; + vector tuneStatusTypes; + vector expectTuneStatuses; +}; + +struct LiveBroadcastHardwareConnections { + string frontendId; + /* string audioFilterId; + string videoFilterId; + list string of extra filters; */ +}; + +struct ScanHardwareConnections { + string frontendId; +}; + +struct DvrRecordHardwareConnections { + bool support; + string frontendId; + /* string recordFilterId; + string dvrId; */ +}; + +struct DescramblingHardwareConnections { + bool support; + string frontendId; + /* string descramblerId; + string audioFilterId; + string videoFilterId; + list string of extra filters; */ +}; + +struct LnbLiveHardwareConnections { + bool support; + string frontendId; + /* string audioFilterId; + string videoFilterId; + list string of extra filters; + string lnbId; */ +}; + +struct LnbRecordHardwareConnections { + bool support; + string frontendId; + /* string recordFilterId; + list string of extra filters; + string lnbId; */ +}; + +struct TunerTestingConfigReader { + public: + static bool checkConfigFileExists() { + auto res = read(configFilePath.c_str()); + if (res == nullopt) { + ALOGW("[ConfigReader] Couldn't read /vendor/etc/tuner_vts_config.xml." + "Please check tuner_testing_dynamic_configuration.xsd" + "and sample_tuner_vts_config.xml for more details on how to config Tune VTS."); + } + return (res != nullopt); + } + + static void readFrontendConfig1_0(map& frontendMap) { + auto hardwareConfig = getHardwareConfig(); + if (hardwareConfig.hasFrontends()) { + // TODO: complete the tune status config + vector types; + types.push_back(FrontendStatusType::DEMOD_LOCK); + FrontendStatus status; + status.isDemodLocked(true); + vector statuses; + statuses.push_back(status); + + auto frontends = *hardwareConfig.getFirstFrontends(); + for (auto feConfig : frontends.getFrontend()) { + string id = feConfig.getId(); + if (id.compare(string("FE_DEFAULT")) == 0) { + // overrid default + frontendMap.erase(string("FE_DEFAULT")); + } + FrontendType type; + switch (feConfig.getType()) { + case FrontendTypeEnum::UNDEFINED: + type = FrontendType::UNDEFINED; + break; + // TODO: finish all other frontend settings + case FrontendTypeEnum::ANALOG: + type = FrontendType::ANALOG; + break; + case FrontendTypeEnum::ATSC: + type = FrontendType::ATSC; + break; + case FrontendTypeEnum::ATSC3: + type = FrontendType::ATSC3; + break; + case FrontendTypeEnum::DVBC: + type = FrontendType::DVBC; + break; + case FrontendTypeEnum::DVBS: + type = FrontendType::DVBS; + frontendMap[id].settings.dvbs(readDvbsFrontendSettings(feConfig)); + break; + case FrontendTypeEnum::DVBT: { + type = FrontendType::DVBT; + frontendMap[id].settings.dvbt(readDvbtFrontendSettings(feConfig)); + break; + } + case FrontendTypeEnum::ISDBS: + type = FrontendType::ISDBS; + break; + case FrontendTypeEnum::ISDBS3: + type = FrontendType::ISDBS3; + break; + case FrontendTypeEnum::ISDBT: + type = FrontendType::ISDBT; + break; + case FrontendTypeEnum::DTMB: + // dtmb will be handled in readFrontendConfig1_1; + continue; + case FrontendTypeEnum::UNKNOWN: + ALOGW("[ConfigReader] invalid frontend type"); + return; + } + frontendMap[id].type = type; + frontendMap[id].isSoftwareFe = feConfig.getIsSoftwareFrontend(); + // TODO: complete the tune status config + frontendMap[id].tuneStatusTypes = types; + frontendMap[id].expectTuneStatuses = statuses; + } + } + } + + static void connectLiveBroadcast(LiveBroadcastHardwareConnections& live) { + auto liveConfig = getDataFlowConfiguration().getFirstClearLiveBroadcast(); + live.frontendId = liveConfig->getFrontendConnection(); + } + + static void connectScan(ScanHardwareConnections& scan) { + auto scanConfig = getDataFlowConfiguration().getFirstScan(); + scan.frontendId = scanConfig->getFrontendConnection(); + } + + static void connectDvrRecord(DvrRecordHardwareConnections& record) { + auto dataFlow = getDataFlowConfiguration(); + if (!dataFlow.hasDvrRecord()) { + record.support = false; + return; + } + auto recordConfig = dataFlow.getFirstDvrRecord(); + record.frontendId = recordConfig->getFrontendConnection(); + } + + static void connectDescrambling(DescramblingHardwareConnections& descrambling) { + auto dataFlow = getDataFlowConfiguration(); + if (!dataFlow.hasDescrambling()) { + descrambling.support = false; + return; + } + auto descConfig = dataFlow.getFirstDescrambling(); + descrambling.frontendId = descConfig->getFrontendConnection(); + } + + static void connectLnbLive(LnbLiveHardwareConnections& lnbLive) { + auto dataFlow = getDataFlowConfiguration(); + if (!dataFlow.hasLnbLive()) { + lnbLive.support = false; + return; + } + auto lnbLiveConfig = dataFlow.getFirstLnbLive(); + lnbLive.frontendId = lnbLiveConfig->getFrontendConnection(); + } + + static void connectLnbRecord(LnbRecordHardwareConnections& lnbRecord) { + auto dataFlow = getDataFlowConfiguration(); + if (!dataFlow.hasLnbRecord()) { + lnbRecord.support = false; + return; + } + auto lnbRecordConfig = dataFlow.getFirstLnbRecord(); + lnbRecord.frontendId = lnbRecordConfig->getFrontendConnection(); + } + + private: + static FrontendDvbtSettings readDvbtFrontendSettings(Frontend feConfig) { + ALOGW("[ConfigReader] type is dvbt"); + FrontendDvbtSettings dvbtSettings{ + .frequency = (uint32_t)feConfig.getFrequency(), + }; + if (!feConfig.hasDvbtFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more dvbt settings"); + return dvbtSettings; + } + dvbtSettings.transmissionMode = static_cast( + feConfig.getFirstDvbtFrontendSettings_optional()->getTransmissionMode()); + dvbtSettings.bandwidth = static_cast( + feConfig.getFirstDvbtFrontendSettings_optional()->getBandwidth()); + dvbtSettings.isHighPriority = + feConfig.getFirstDvbtFrontendSettings_optional()->getIsHighPriority(); + return dvbtSettings; + } + + static FrontendDvbsSettings readDvbsFrontendSettings(Frontend feConfig) { + ALOGW("[ConfigReader] type is dvbs"); + FrontendDvbsSettings dvbsSettings{ + .frequency = (uint32_t)feConfig.getFrequency(), + }; + if (!feConfig.hasDvbsFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more dvbs settings"); + return dvbsSettings; + } + dvbsSettings.symbolRate = static_cast( + feConfig.getFirstDvbsFrontendSettings_optional()->getSymbolRate()); + dvbsSettings.inputStreamId = static_cast( + feConfig.getFirstDvbsFrontendSettings_optional()->getInputStreamId()); + return dvbsSettings; + } + + static TunerConfiguration getTunerConfig() { return *read(configFilePath.c_str()); } + + static HardwareConfiguration getHardwareConfig() { + return *getTunerConfig().getFirstHardwareConfiguration(); + } + + static DataFlowConfiguration getDataFlowConfiguration() { + return *getTunerConfig().getFirstDataFlowConfiguration(); + } +}; diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt new file mode 100644 index 0000000000..b0f410d25e --- /dev/null +++ b/tv/tuner/config/api/current.txt @@ -0,0 +1,143 @@ +// Signature format: 2.0 +package android.media.tuner.testing.configuration.V1_0 { + + public class DataFlowConfiguration { + ctor public DataFlowConfiguration(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.ClearLiveBroadcast getClearLiveBroadcast(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Descrambling getDescrambling(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrRecord getDvrRecord(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbLive getLnbLive(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbRecord getLnbRecord(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Scan getScan(); + method public void setClearLiveBroadcast(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.ClearLiveBroadcast); + method public void setDescrambling(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Descrambling); + method public void setDvrRecord(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrRecord); + method public void setLnbLive(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbLive); + method public void setLnbRecord(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.LnbRecord); + method public void setScan(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.Scan); + } + + public static class DataFlowConfiguration.ClearLiveBroadcast { + ctor public DataFlowConfiguration.ClearLiveBroadcast(); + method @Nullable public String getFrontendConnection(); + method public void setFrontendConnection(@Nullable String); + } + + public static class DataFlowConfiguration.Descrambling { + ctor public DataFlowConfiguration.Descrambling(); + method @Nullable public String getFrontendConnection(); + method public void setFrontendConnection(@Nullable String); + } + + public static class DataFlowConfiguration.DvrRecord { + ctor public DataFlowConfiguration.DvrRecord(); + method @Nullable public String getFrontendConnection(); + method public void setFrontendConnection(@Nullable String); + } + + public static class DataFlowConfiguration.LnbLive { + ctor public DataFlowConfiguration.LnbLive(); + method @Nullable public String getFrontendConnection(); + method public void setFrontendConnection(@Nullable String); + } + + public static class DataFlowConfiguration.LnbRecord { + ctor public DataFlowConfiguration.LnbRecord(); + method @Nullable public String getFrontendConnection(); + method public void setFrontendConnection(@Nullable String); + } + + public static class DataFlowConfiguration.Scan { + ctor public DataFlowConfiguration.Scan(); + method @Nullable public String getFrontendConnection(); + method public void setFrontendConnection(@Nullable String); + } + + public class DvbsFrontendSettings { + ctor public DvbsFrontendSettings(); + method @Nullable public java.math.BigInteger getInputStreamId(); + method @Nullable public java.math.BigInteger getSymbolRate(); + method public void setInputStreamId(@Nullable java.math.BigInteger); + method public void setSymbolRate(@Nullable java.math.BigInteger); + } + + public class DvbtFrontendSettings { + ctor public DvbtFrontendSettings(); + method @Nullable public java.math.BigInteger getBandwidth(); + method @Nullable public java.math.BigInteger getIsHighPriority(); + method @Nullable public java.math.BigInteger getTransmissionMode(); + method public void setBandwidth(@Nullable java.math.BigInteger); + method public void setIsHighPriority(@Nullable java.math.BigInteger); + method public void setTransmissionMode(@Nullable java.math.BigInteger); + } + + public class Frontend { + ctor public Frontend(); + method @Nullable public java.math.BigInteger getConnectToCicamId(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DvbsFrontendSettings getDvbsFrontendSettings_optional(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DvbtFrontendSettings getDvbtFrontendSettings_optional(); + method @Nullable public java.math.BigInteger getEndFrequency(); + method @Nullable public java.math.BigInteger getFrequency(); + method @Nullable public String getId(); + method @Nullable public boolean getIsSoftwareFrontend(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum getType(); + method public void setConnectToCicamId(@Nullable java.math.BigInteger); + method public void setDvbsFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.DvbsFrontendSettings); + method public void setDvbtFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.DvbtFrontendSettings); + method public void setEndFrequency(@Nullable java.math.BigInteger); + method public void setFrequency(@Nullable java.math.BigInteger); + method public void setId(@Nullable String); + method public void setIsSoftwareFrontend(@Nullable boolean); + method public void setType(@Nullable android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum); + } + + public enum FrontendTypeEnum { + method @NonNull public String getRawName(); + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ANALOG; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ATSC; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ATSC3; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum DTMB; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum DVBC; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum DVBS; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum DVBT; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ISDBS; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ISDBS3; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ISDBT; + enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum UNDEFINED; + } + + public class HardwareConfiguration { + ctor public HardwareConfiguration(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Frontends getFrontends(); + method public void setFrontends(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Frontends); + } + + public static class HardwareConfiguration.Frontends { + ctor public HardwareConfiguration.Frontends(); + method @Nullable public java.util.List getFrontend(); + } + + public class TunerConfiguration { + ctor public TunerConfiguration(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration getDataFlowConfiguration(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration getHardwareConfiguration(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.Version getVersion(); + method public void setDataFlowConfiguration(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration); + method public void setHardwareConfiguration(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration); + method public void setVersion(@Nullable android.media.tuner.testing.configuration.V1_0.Version); + } + + public enum Version { + method @NonNull public String getRawName(); + enum_constant public static final android.media.tuner.testing.configuration.V1_0.Version _1_0; + } + + public class XmlParser { + ctor public XmlParser(); + method @Nullable public static android.media.tuner.testing.configuration.V1_0.TunerConfiguration read(@NonNull java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method @Nullable public static String readText(@NonNull org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method public static void skip(@NonNull org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + } + +} + diff --git a/tv/tuner/config/api/last_current.txt b/tv/tuner/config/api/last_current.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tv/tuner/config/api/last_removed.txt b/tv/tuner/config/api/last_removed.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tv/tuner/config/api/removed.txt b/tv/tuner/config/api/removed.txt new file mode 100644 index 0000000000..d802177e24 --- /dev/null +++ b/tv/tuner/config/api/removed.txt @@ -0,0 +1 @@ +// Signature format: 2.0 diff --git a/tv/tuner/config/sample_tuner_vts_config.xml b/tv/tuner/config/sample_tuner_vts_config.xml new file mode 100644 index 0000000000..c4080d9ac7 --- /dev/null +++ b/tv/tuner/config/sample_tuner_vts_config.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd new file mode 100644 index 0000000000..cd8b061309 --- /dev/null +++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Each frontend element contain the following attributes: + "id": unique id of the frontend that could be used to connect to the test the + "dataFlowConfiguration" + "type": the frontend type. The enums are defined in the xsd. + "isSoftwareFrontend": if the test environment is using hardware or software + frontend. If using software, a ts input file path needs to be configured. + "softwareFeInputPath": used as the source of the software frontend. + "connectToCicamId": if the device supports frontend connecting to cicam, the + target cicam id needs to be configured here. Supported in Tuner 1.1 or + higher. + "frequency": the frequency used to configure tune and scan. + "endFrequency": the end frequency of scan. Supported in Tuner 1.1 or higher. + + Each frontend element also contains at most one type-related "frontendSettings". + - The settings type should match the frontend "type" attribute. + - For example, when frontend type="DVBT", dvbtFrontendSettings can be + configured. + - This is optional and skipping the settings would pass a setting with frequency + config only to the hal. + + + + + + + + + + + + + + + + + + + + + + + + + + This section contains configurations of all the frontends that would be + used in the tests. + - This section is optional and can be skipped to use the default + fe settings. + - The default settings can be found in the + sample_tuner_vts_configurations.xml. + - The users can also override the default frontend settings using + id="FE_DEFAULT". + - The users can configure 1 or more frontend elements in the + frontends sections. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +