diff --git a/tv/tuner/1.0/default/Tuner.cpp b/tv/tuner/1.0/default/Tuner.cpp index 48ce384e7b..0430646d98 100644 --- a/tv/tuner/1.0/default/Tuner.cpp +++ b/tv/tuner/1.0/default/Tuner.cpp @@ -141,6 +141,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 47d3b2f75a..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,6 +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.cpp b/tv/tuner/1.0/vts/functional/FrontendTests.cpp index 45951d2b20..b35d11220d 100644 --- a/tv/tuner/1.0/vts/functional/FrontendTests.cpp +++ b/tv/tuner/1.0/vts/functional/FrontendTests.cpp @@ -370,13 +370,11 @@ AssertionResult FrontendTests::tuneFrontend(FrontendConfig config, bool testWith mIsSoftwareFe = config.isSoftwareFe; bool result = true; if (mIsSoftwareFe && testWithDemux) { - DvrConfig dvrConfig; - getSoftwareFrontendPlaybackConfig(dvrConfig); - result &= mDvrTests.openDvrInDemux(dvrConfig.type, dvrConfig.bufferSize) == success(); - result &= mDvrTests.configDvrPlayback(dvrConfig.settings) == success(); + result &= mDvrTests.openDvrInDemux(mDvrConfig.type, mDvrConfig.bufferSize) == success(); + result &= mDvrTests.configDvrPlayback(mDvrConfig.settings) == success(); result &= mDvrTests.getDvrPlaybackMQDescriptor() == success(); - mDvrTests.startPlaybackInputThread(dvrConfig.playbackInputFile, - dvrConfig.settings.playback()); + mDvrTests.startPlaybackInputThread(mDvrConfig.playbackInputFile, + mDvrConfig.settings.playback()); if (!result) { ALOGW("[vts] Software frontend dvr configure failed."); return failure(); diff --git a/tv/tuner/1.0/vts/functional/FrontendTests.h b/tv/tuner/1.0/vts/functional/FrontendTests.h index c536325126..33ff603b85 100644 --- a/tv/tuner/1.0/vts/functional/FrontendTests.h +++ b/tv/tuner/1.0/vts/functional/FrontendTests.h @@ -104,6 +104,7 @@ class FrontendTests { void setService(sp tuner) { mService = tuner; mDvrTests.setService(tuner); + getDefaultSoftwareFrontendPlaybackConfig(mDvrConfig); } AssertionResult getFrontendIds(); @@ -125,12 +126,14 @@ class FrontendTests { void setDvrTests(DvrTests dvrTests) { mDvrTests = dvrTests; } void setDemux(sp demux) { mDvrTests.setDemux(demux); } + void setSoftwareFrontendDvrConfig(DvrConfig conf) { mDvrConfig = conf; } protected: static AssertionResult failure() { return ::testing::AssertionFailure(); } static AssertionResult success() { return ::testing::AssertionSuccess(); } - void getSoftwareFrontendPlaybackConfig(DvrConfig& dvrConfig) { + // TODO: replace with customized dvr input + void getDefaultSoftwareFrontendPlaybackConfig(DvrConfig& dvrConfig) { PlaybackSettings playbackSettings{ .statusMask = 0xf, .lowThreshold = 0x1000, @@ -151,4 +154,5 @@ class FrontendTests { DvrTests mDvrTests; bool mIsSoftwareFe = false; + DvrConfig mDvrConfig; }; diff --git a/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp b/tv/tuner/1.0/vts/functional/VtsHalTvTunerV1_0TargetTest.cpp index 22ba271c52..41a494dc6f 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(TunerPlaybackHidlTest, PlaybackDataFlowWithTsSectionFilterTest) { @@ -503,27 +505,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()); @@ -537,10 +552,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 92a8130ffc..ec5571fb03 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; @@ -97,12 +102,6 @@ typedef enum { LINKAGE_DIR, } Linkage; -typedef enum { - DVBT, - DVBS, - FRONTEND_MAX, -} Frontend; - typedef enum { LNB0, LNB_EXTERNAL, @@ -114,11 +113,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[DVBS].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/assets/Android.bp b/tv/tuner/assets/Android.bp new file mode 100644 index 0000000000..79244edbb0 --- /dev/null +++ b/tv/tuner/assets/Android.bp @@ -0,0 +1,26 @@ +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"], +} + +genrule { + name: "tuner_frontend_input_es", + srcs: ["tuner_frontend_input.es"], + out: [ + "test.es", + ], + cmd: "cp -f $(in) $(genDir)/test.es", +} + +genrule { + name: "tuner_frontend_input_ts", + srcs: ["tuner_frontend_input.ts"], + out: [ + "segment000000.ts", + ], + cmd: "cp -f $(in) $(genDir)/segment000000.ts", +} diff --git a/tv/tuner/assets/tuner_frontend_input.es b/tv/tuner/assets/tuner_frontend_input.es new file mode 100644 index 0000000000..b53c957350 Binary files /dev/null and b/tv/tuner/assets/tuner_frontend_input.es differ diff --git a/tv/tuner/assets/tuner_frontend_input.ts b/tv/tuner/assets/tuner_frontend_input.ts new file mode 100644 index 0000000000..8992c7b2b5 Binary files /dev/null and b/tv/tuner/assets/tuner_frontend_input.ts differ 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/OWNERS b/tv/tuner/config/OWNERS new file mode 100644 index 0000000000..1b3d095f9c --- /dev/null +++ b/tv/tuner/config/OWNERS @@ -0,0 +1,4 @@ +nchalko@google.com +amyjojo@google.com +shubang@google.com +quxiangfang@google.com 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. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +