Merge changes from topic "dynamicConfig"

* changes:
  Add descrambler dynamic configuration into Tuner 1.0 VTS
  Add lnb/timeFilter dynamic configuration into Tuner 1.0 VTS
  Add filter dynamic configuration into Tuner 1.0 VTS
  Add dvr dynamic configuration into Tuner 1.0 VTS
This commit is contained in:
Treehugger Robot
2021-04-16 05:10:51 +00:00
committed by Gerrit Code Review
9 changed files with 1645 additions and 422 deletions

View File

@@ -48,10 +48,11 @@ AssertionResult LnbTests::openLnbById(uint32_t lnbId) {
return AssertionResult(status == Result::SUCCESS);
}
AssertionResult LnbTests::openLnbByName(string lnbName) {
AssertionResult LnbTests::openLnbByName(string lnbName, uint32_t& id) {
Result status;
mService->openLnbByName(lnbName, [&](Result result, uint32_t /*lnbId*/, const sp<ILnb>& lnb) {
mService->openLnbByName(lnbName, [&](Result result, uint32_t lnbId, const sp<ILnb>& lnb) {
mLnb = lnb;
id = lnbId;
status = result;
});

View File

@@ -64,7 +64,7 @@ class LnbTests {
AssertionResult getLnbIds(vector<uint32_t>& ids);
AssertionResult openLnbById(uint32_t lnbId);
AssertionResult openLnbByName(string lnbName);
AssertionResult openLnbByName(string lnbName, uint32_t& lnbId);
AssertionResult setLnbCallback();
AssertionResult setVoltage(LnbVoltage voltage);
AssertionResult setTone(LnbTone tone);

View File

@@ -56,7 +56,7 @@ void TunerFilterHidlTest::configSingleFilterInDemuxTest(FilterConfig filterConf,
}
void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) {
if (!filterConf.supportTimeFilter) {
if (!timeFilter.support) {
return;
}
uint32_t demuxId;
@@ -64,11 +64,8 @@ void TunerFilterHidlTest::testTimeFilter(TimeFilterConfig filterConf) {
DemuxCapabilities caps;
ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
// TODO: add time filter hardware support checker
ASSERT_TRUE(mDemuxTests.getDemuxCaps(caps));
if (!caps.bTimeFilter) {
return;
}
ASSERT_TRUE(caps.bTimeFilter);
mFilterTests.setDemux(demux);
ASSERT_TRUE(mFilterTests.openTimeFilterInDemux());
ASSERT_TRUE(mFilterTests.setTimeStamp(filterConf.timeStamp));
@@ -86,17 +83,14 @@ void TunerBroadcastHidlTest::broadcastSingleFilterTest(FilterConfig filterConf,
uint32_t filterId;
mFrontendTests.getFrontendIdByType(frontendConf.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
// or with manual ts installing and use DVBT frontend.
return;
}
ASSERT_TRUE(mFrontendTests.openFrontendById(feId));
ASSERT_TRUE(mFrontendTests.setFrontendCallback());
if (mLnbId) {
ASSERT_TRUE(mFrontendTests.setLnb(*mLnbId));
}
if (frontendConf.isSoftwareFe) {
mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[live.dvrSoftwareFeId]);
}
ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId));
mFrontendTests.setDemux(demux);
@@ -119,14 +113,16 @@ void TunerBroadcastHidlTest::broadcastSingleFilterTest(FilterConfig filterConf,
void TunerBroadcastHidlTest::broadcastSingleFilterTestWithLnb(FilterConfig filterConf,
FrontendConfig frontendConf,
LnbConfig lnbConf) {
vector<uint32_t> ids;
ASSERT_TRUE(mLnbTests.getLnbIds(ids));
if (ids.size() == 0) {
return;
if (lnbConf.name.compare(emptyHardwareId) == 0) {
vector<uint32_t> ids;
ASSERT_TRUE(mLnbTests.getLnbIds(ids));
ASSERT_TRUE(ids.size() > 0);
ASSERT_TRUE(mLnbTests.openLnbById(ids[0]));
mLnbId = &ids[0];
} else {
mLnbId = (uint32_t*)malloc(sizeof(uint32_t));
ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId));
}
ASSERT_TRUE(ids.size() > 0);
ASSERT_TRUE(mLnbTests.openLnbById(ids[0]));
mLnbId = &ids[0];
ASSERT_TRUE(mLnbTests.setLnbCallback());
ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage));
ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone));
@@ -178,6 +174,9 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf,
if (mLnbId) {
ASSERT_TRUE(mFrontendTests.setLnb(*mLnbId));
}
if (frontendConf.isSoftwareFe) {
mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[record.dvrSoftwareFeId]);
}
ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId));
mFilterTests.setDemux(demux);
@@ -212,18 +211,23 @@ void TunerRecordHidlTest::recordSingleFilterTest(FilterConfig filterConf,
void TunerRecordHidlTest::recordSingleFilterTestWithLnb(FilterConfig filterConf,
FrontendConfig frontendConf,
DvrConfig dvrConf, LnbConfig lnbConf) {
vector<uint32_t> ids;
ASSERT_TRUE(mLnbTests.getLnbIds(ids));
if (ids.size() == 0) {
return;
if (lnbConf.name.compare(emptyHardwareId) == 0) {
vector<uint32_t> ids;
ASSERT_TRUE(mLnbTests.getLnbIds(ids));
ASSERT_TRUE(ids.size() > 0);
ASSERT_TRUE(mLnbTests.openLnbById(ids[0]));
mLnbId = &ids[0];
} else {
mLnbId = (uint32_t*)malloc(sizeof(uint32_t));
ASSERT_TRUE(mLnbTests.openLnbByName(lnbConf.name, *mLnbId));
}
ASSERT_TRUE(ids.size() > 0);
ASSERT_TRUE(mLnbTests.openLnbById(ids[0]));
mLnbId = &ids[0];
ASSERT_TRUE(mLnbTests.setLnbCallback());
ASSERT_TRUE(mLnbTests.setVoltage(lnbConf.voltage));
ASSERT_TRUE(mLnbTests.setTone(lnbConf.tone));
ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbConf.position));
for (auto msgName : lnbRecord.diseqcMsgs) {
ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName]));
}
recordSingleFilterTest(filterConf, frontendConf, dvrConf);
ASSERT_TRUE(mLnbTests.closeLnb());
mLnbId = nullptr;
@@ -279,14 +283,11 @@ void TunerDescramblerHidlTest::scrambledBroadcastTest(set<struct FilterConfig> m
set<uint32_t>::iterator id;
mFrontendTests.getFrontendIdByType(frontendConf.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
// or with manual ts installing and use DVBT frontend.
return;
}
ASSERT_TRUE(mFrontendTests.openFrontendById(feId));
ASSERT_TRUE(mFrontendTests.setFrontendCallback());
if (frontendConf.isSoftwareFe) {
mFrontendTests.setSoftwareFrontendDvrConfig(dvrMap[descrambling.dvrSoftwareFeId]);
}
ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId));
mFilterTests.setDemux(demux);
@@ -301,7 +302,7 @@ void TunerDescramblerHidlTest::scrambledBroadcastTest(set<struct FilterConfig> m
TunerKeyToken token;
ASSERT_TRUE(mDescramblerTests.getKeyToken(descConfig.casSystemId, descConfig.provisionStr,
descConfig.hidlPvtData, token));
ASSERT_TRUE(mDescramblerTests.setKeyToken(token));
mDescramblerTests.setKeyToken(token);
vector<DemuxPid> pids;
DemuxPid pid;
for (config = mediaFilterConfs.begin(); config != mediaFilterConfs.end(); config++) {
@@ -346,37 +347,24 @@ TEST_P(TunerFrontendHidlTest, BlindScanFrontend) {
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<uint32_t> 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));
ASSERT_TRUE(mLnbTests.setTone(lnbArray[LNB_EXTERNAL].tone));
ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbArray[LNB_EXTERNAL].position));
ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgArray[DISEQC_POWER_ON]));
ASSERT_TRUE(mLnbTests.closeLnb());
}
TEST_P(TunerLnbHidlTest, SendDiseqcMessageToLnb) {
description("Open and configure an Lnb with specific settings then send a diseqc msg to it.");
vector<uint32_t> ids;
ASSERT_TRUE(mLnbTests.getLnbIds(ids));
if (ids.size() == 0) {
return;
if (lnbMap[lnbLive.lnbId].name.compare(emptyHardwareId) == 0) {
vector<uint32_t> ids;
ASSERT_TRUE(mLnbTests.getLnbIds(ids));
ASSERT_TRUE(ids.size() > 0);
ASSERT_TRUE(mLnbTests.openLnbById(ids[0]));
} else {
uint32_t id;
ASSERT_TRUE(mLnbTests.openLnbByName(lnbMap[lnbLive.lnbId].name, id));
}
ASSERT_TRUE(ids.size() > 0);
ASSERT_TRUE(mLnbTests.openLnbById(ids[0]));
ASSERT_TRUE(mLnbTests.setLnbCallback());
ASSERT_TRUE(mLnbTests.setVoltage(lnbArray[LNB0].voltage));
ASSERT_TRUE(mLnbTests.setTone(lnbArray[LNB0].tone));
ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbArray[LNB0].position));
ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgArray[DISEQC_POWER_ON]));
ASSERT_TRUE(mLnbTests.setVoltage(lnbMap[lnbLive.lnbId].voltage));
ASSERT_TRUE(mLnbTests.setTone(lnbMap[lnbLive.lnbId].tone));
ASSERT_TRUE(mLnbTests.setSatellitePosition(lnbMap[lnbLive.lnbId].position));
for (auto msgName : lnbLive.diseqcMsgs) {
ASSERT_TRUE(mLnbTests.sendDiseqcMessage(diseqcMsgMap[msgName]));
}
ASSERT_TRUE(mLnbTests.closeLnb());
}
@@ -397,6 +385,9 @@ TEST_P(TunerDemuxHidlTest, openDemux) {
TEST_P(TunerDemuxHidlTest, getAvSyncTime) {
description("Get the A/V sync time from a PCR filter.");
if (live.pcrFilterId.compare(emptyHardwareId) == 0) {
return;
}
uint32_t feId;
uint32_t demuxId;
sp<IDemux> demux;
@@ -412,15 +403,15 @@ TEST_P(TunerDemuxHidlTest, getAvSyncTime) {
ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId));
mFilterTests.setDemux(demux);
ASSERT_TRUE(mFilterTests.openFilterInDemux(filterArray[TS_VIDEO1].type,
filterArray[TS_VIDEO1].bufferSize));
ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.videoFilterId].type,
filterMap[live.videoFilterId].bufferSize));
ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId(mediaFilterId));
ASSERT_TRUE(mFilterTests.configFilter(filterArray[TS_VIDEO1].settings, mediaFilterId));
ASSERT_TRUE(mFilterTests.configFilter(filterMap[live.videoFilterId].settings, mediaFilterId));
mediaFilter = mFilterTests.getFilterById(mediaFilterId);
ASSERT_TRUE(mFilterTests.openFilterInDemux(filterArray[TS_PCR0].type,
filterArray[TS_PCR0].bufferSize));
ASSERT_TRUE(mFilterTests.openFilterInDemux(filterMap[live.pcrFilterId].type,
filterMap[live.pcrFilterId].bufferSize));
ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId(pcrFilterId));
ASSERT_TRUE(mFilterTests.configFilter(filterArray[TS_PCR0].settings, pcrFilterId));
ASSERT_TRUE(mFilterTests.configFilter(filterMap[live.pcrFilterId].settings, pcrFilterId));
ASSERT_TRUE(mDemuxTests.getAvSyncId(mediaFilter, avSyncHwId));
ASSERT_TRUE(pcrFilterId == avSyncHwId);
ASSERT_TRUE(mDemuxTests.getAvSyncTime(pcrFilterId));
@@ -433,7 +424,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], frontendMap[live.frontendId]);
configSingleFilterInDemuxTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]);
}
TEST_P(TunerFilterHidlTest, SetFilterLinkage) {
@@ -450,11 +441,9 @@ TEST_P(TunerFilterHidlTest, SetFilterLinkage) {
if (caps.linkCaps[i] & (bitMask << j)) {
uint32_t sourceFilterId;
uint32_t sinkFilterId;
ASSERT_TRUE(mFilterTests.openFilterInDemux(filterLinkageTypes[SOURCE][i],
FMQ_SIZE_16M));
ASSERT_TRUE(mFilterTests.openFilterInDemux(getLinkageFilterType(i), FMQ_SIZE_16M));
ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId(sourceFilterId));
ASSERT_TRUE(
mFilterTests.openFilterInDemux(filterLinkageTypes[SINK][j], FMQ_SIZE_16M));
ASSERT_TRUE(mFilterTests.openFilterInDemux(getLinkageFilterType(j), FMQ_SIZE_16M));
ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId(sinkFilterId));
ASSERT_TRUE(mFilterTests.setFilterDataSource(sourceFilterId, sinkFilterId));
ASSERT_TRUE(mFilterTests.setFilterDataSourceToDemux(sinkFilterId));
@@ -469,37 +458,47 @@ TEST_P(TunerFilterHidlTest, SetFilterLinkage) {
TEST_P(TunerFilterHidlTest, testTimeFilter) {
description("Open a timer filter in Demux and set time stamp.");
// TODO use paramterized tests
testTimeFilter(timeFilterArray[TIMER0]);
testTimeFilter(timeFilterMap[timeFilter.timeFilterId]);
}
TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowVideoFilterTest) {
description("Test Video Filter functionality in Broadcast use case.");
broadcastSingleFilterTest(filterArray[TS_VIDEO1], frontendMap[live.frontendId]);
broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]);
}
TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowAudioFilterTest) {
description("Test Audio Filter functionality in Broadcast use case.");
broadcastSingleFilterTest(filterArray[TS_AUDIO0], frontendMap[live.frontendId]);
broadcastSingleFilterTest(filterMap[live.audioFilterId], frontendMap[live.frontendId]);
}
TEST_P(TunerBroadcastHidlTest, BroadcastDataFlowSectionFilterTest) {
description("Test Section Filter functionality in Broadcast use case.");
broadcastSingleFilterTest(filterArray[TS_SECTION0], frontendMap[live.frontendId]);
if (live.sectionFilterId.compare(emptyHardwareId) == 0) {
return;
}
broadcastSingleFilterTest(filterMap[live.sectionFilterId], frontendMap[live.frontendId]);
}
TEST_P(TunerBroadcastHidlTest, IonBufferTest) {
description("Test the av filter data bufferring.");
broadcastSingleFilterTest(filterArray[TS_VIDEO0], frontendMap[live.frontendId]);
broadcastSingleFilterTest(filterMap[live.videoFilterId], frontendMap[live.frontendId]);
}
TEST_P(TunerBroadcastHidlTest, LnbBroadcastDataFlowVideoFilterTest) {
description("Test Video Filter functionality in Broadcast with Lnb use case.");
broadcastSingleFilterTest(filterArray[TS_VIDEO0], frontendMap[live.frontendId]);
if (!lnbLive.support) {
return;
}
broadcastSingleFilterTestWithLnb(filterMap[lnbLive.videoFilterId],
frontendMap[lnbLive.frontendId], lnbMap[lnbLive.lnbId]);
}
TEST_P(TunerPlaybackHidlTest, PlaybackDataFlowWithTsSectionFilterTest) {
description("Feed ts data from playback and configure Ts section filter to get output");
playbackSingleFilterTest(filterArray[TS_SECTION0], dvrArray[DVR_PLAYBACK0]);
if (!playback.support || playback.sectionFilterId.compare(emptyHardwareId) == 0) {
return;
}
playbackSingleFilterTest(filterMap[playback.sectionFilterId], dvrMap[playback.dvrId]);
}
TEST_P(TunerRecordHidlTest, AttachFiltersToRecordTest) {
@@ -508,8 +507,8 @@ TEST_P(TunerRecordHidlTest, AttachFiltersToRecordTest) {
if (!record.support) {
return;
}
attachSingleFilterToRecordDvrTest(filterArray[TS_RECORD0], frontendMap[record.frontendId],
dvrArray[DVR_RECORD0]);
attachSingleFilterToRecordDvrTest(filterMap[record.recordFilterId],
frontendMap[record.frontendId], dvrMap[record.dvrRecordId]);
}
TEST_P(TunerRecordHidlTest, RecordDataFlowWithTsRecordFilterTest) {
@@ -517,17 +516,18 @@ TEST_P(TunerRecordHidlTest, RecordDataFlowWithTsRecordFilterTest) {
if (!record.support) {
return;
}
recordSingleFilterTest(filterArray[TS_RECORD0], frontendMap[record.frontendId],
dvrArray[DVR_RECORD0]);
recordSingleFilterTest(filterMap[record.recordFilterId], frontendMap[record.frontendId],
dvrMap[record.dvrRecordId]);
}
TEST_P(TunerRecordHidlTest, LnbRecordDataFlowWithTsRecordFilterTest) {
description("Feed ts data from Fe with Lnb to recording and test with ts record filter");
if (record.support) {
if (lnbRecord.support) {
return;
}
recordSingleFilterTestWithLnb(filterArray[TS_RECORD0], frontendMap[lnbRecord.frontendId],
dvrArray[DVR_RECORD0], lnbArray[LNB0]);
recordSingleFilterTestWithLnb(filterMap[lnbRecord.recordFilterId],
frontendMap[lnbRecord.frontendId], dvrMap[lnbRecord.dvrRecordId],
lnbMap[lnbRecord.lnbId]);
}
TEST_P(TunerDescramblerHidlTest, CreateDescrambler) {
@@ -556,10 +556,10 @@ TEST_P(TunerDescramblerHidlTest, ScrambledBroadcastDataFlowMediaFiltersTest) {
return;
}
set<FilterConfig> filterConfs;
filterConfs.insert(filterArray[TS_AUDIO0]);
filterConfs.insert(filterArray[TS_VIDEO1]);
filterConfs.insert(static_cast<FilterConfig>(filterMap[descrambling.audioFilterId]));
filterConfs.insert(static_cast<FilterConfig>(filterMap[descrambling.videoFilterId]));
scrambledBroadcastTest(filterConfs, frontendMap[descrambling.frontendId],
descramblerArray[DESC_0]);
descramblerMap[descrambling.descramblerId]);
}
INSTANTIATE_TEST_SUITE_P(

View File

@@ -20,6 +20,9 @@
#include "LnbTests.h"
using android::hardware::tv::tuner::V1_0::DataFormat;
using android::hardware::tv::tuner::V1_0::DemuxAlpFilterType;
using android::hardware::tv::tuner::V1_0::DemuxMmtpFilterType;
using android::hardware::tv::tuner::V1_0::DemuxTlvFilterType;
using android::hardware::tv::tuner::V1_0::IDescrambler;
static AssertionResult success() {
@@ -33,18 +36,16 @@ bool initConfiguration() {
return false;
}
initFrontendConfig();
initFilterConfig();
initDvrConfig();
initLnbConfig();
initTimeFilterConfig();
initDescramblerConfig();
connectHardwaresToTestCases();
if (!validateConnections()) {
ALOGW("[vts] failed to validate connections.");
return false;
}
initLnbConfig();
initFilterConfig();
initTimeFilterConfig();
initDvrConfig();
initDescramblerConfig();
return true;
}
@@ -148,6 +149,29 @@ class TunerFilterHidlTest : public testing::TestWithParam<std::string> {
void configSingleFilterInDemuxTest(FilterConfig filterConf, FrontendConfig frontendConf);
void testTimeFilter(TimeFilterConfig filterConf);
DemuxFilterType getLinkageFilterType(int bit) {
DemuxFilterType type;
type.mainType = static_cast<DemuxFilterMainType>(1 << bit);
switch (type.mainType) {
case DemuxFilterMainType::TS:
type.subType.tsFilterType(DemuxTsFilterType::UNDEFINED);
break;
case DemuxFilterMainType::MMTP:
type.subType.mmtpFilterType(DemuxMmtpFilterType::UNDEFINED);
break;
case DemuxFilterMainType::IP:
type.subType.ipFilterType(DemuxIpFilterType::UNDEFINED);
break;
case DemuxFilterMainType::TLV:
type.subType.tlvFilterType(DemuxTlvFilterType::UNDEFINED);
break;
case DemuxFilterMainType::ALP:
type.subType.alpFilterType(DemuxAlpFilterType::UNDEFINED);
break;
}
return type;
}
sp<ITuner> mService;
FrontendTests mFrontendTests;
DemuxTests mDemuxTests;

View File

@@ -23,167 +23,47 @@
#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;
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::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;
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;
const uint32_t FMQ_SIZE_16M = 0x1000000;
#define CLEAR_KEY_SYSTEM_ID 0xF6D8
#define FILTER_MAIN_TYPE_BIT_COUNT 32
#define PROVISION_STR \
"{ " \
" \"id\": 21140844, " \
" \"name\": \"Test Title\", " \
" \"lowercase_organization_name\": \"Android\", " \
" \"asset_key\": { " \
" \"encryption_key\": \"nezAr3CHFrmBR9R8Tedotw==\" " \
" }, " \
" \"cas_type\": 1, " \
" \"track_types\": [ ] " \
"} "
typedef enum {
TS_VIDEO0,
TS_VIDEO1,
TS_AUDIO0,
TS_PES0,
TS_PCR0,
TS_SECTION0,
TS_TS0,
TS_RECORD0,
FILTER_MAX,
} Filter;
typedef enum {
TIMER0,
TIMER_MAX,
} TimeFilter;
typedef enum {
SOURCE,
SINK,
LINKAGE_DIR,
} Linkage;
typedef enum {
LNB0,
LNB_EXTERNAL,
LNB_MAX,
} Lnb;
typedef enum {
DISEQC_POWER_ON,
DISEQC_MAX,
} Diseqc;
typedef enum {
DVR_RECORD0,
DVR_PLAYBACK0,
DVR_SOFTWARE_FE,
DVR_MAX,
} Dvr;
typedef enum {
DESC_0,
DESC_MAX,
} Descrambler;
struct FilterConfig {
uint32_t bufferSize;
DemuxFilterType type;
DemuxFilterSettings settings;
bool getMqDesc;
bool operator<(const FilterConfig& /*c*/) const { return false; }
};
struct TimeFilterConfig {
bool supportTimeFilter;
uint64_t timeStamp;
};
struct LnbConfig {
bool usingLnb;
string name;
LnbVoltage voltage;
LnbTone tone;
LnbPosition position;
};
struct DvrConfig {
DvrType type;
uint32_t bufferSize;
DvrSettings settings;
string playbackInputFile;
};
struct DescramblerConfig {
uint32_t casSystemId;
string provisionStr;
vector<uint8_t> hidlPvtData;
};
// TODO: remove all the manual config array after the dynamic config refactoring is done.
static LnbConfig lnbArray[LNB_MAX];
static vector<uint8_t> diseqcMsgArray[DISEQC_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];
#define FILTER_MAIN_TYPE_BIT_COUNT 5
// Hardware configs
static map<string, FrontendConfig> frontendMap;
static map<string, FilterConfig> filterMap;
static map<string, DvrConfig> dvrMap;
static map<string, LnbConfig> lnbMap;
static map<string, TimeFilterConfig> timeFilterMap;
static map<string, vector<uint8_t>> diseqcMsgMap;
static map<string, DescramblerConfig> descramblerMap;
// Hardware and test cases connections
static LiveBroadcastHardwareConnections live;
static ScanHardwareConnections scan;
static DvrPlaybackHardwareConnections playback;
static DvrRecordHardwareConnections record;
static DescramblingHardwareConnections descrambling;
static LnbLiveHardwareConnections lnbLive;
static LnbRecordHardwareConnections lnbRecord;
static TimeFilterHardwareConnections timeFilter;
/** Configuration array for the frontend tune test */
/** Config all the frontends that would be used in the tests */
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.
// The test will use the internal default fe when default fe is connected to any data flow
// without overriding in the xml config.
string defaultFeId = "FE_DEFAULT";
FrontendDvbtSettings dvbtSettings{
.frequency = 578000,
@@ -208,14 +88,63 @@ inline void initFrontendConfig() {
TunerTestingConfigReader::readFrontendConfig1_0(frontendMap);
};
inline void initFilterConfig() {
// The test will use the internal default filter when default filter is connected to any
// data flow without overriding in the xml config.
string defaultAudioFilterId = "FILTER_AUDIO_DEFAULT";
string defaultVideoFilterId = "FILTER_VIDEO_DEFAULT";
filterMap[defaultVideoFilterId].type.mainType = DemuxFilterMainType::TS;
filterMap[defaultVideoFilterId].type.subType.tsFilterType(DemuxTsFilterType::VIDEO);
filterMap[defaultVideoFilterId].bufferSize = FMQ_SIZE_16M;
filterMap[defaultVideoFilterId].settings.ts().tpid = 256;
filterMap[defaultVideoFilterId].settings.ts().filterSettings.av({.isPassthrough = false});
filterMap[defaultAudioFilterId].type.mainType = DemuxFilterMainType::TS;
filterMap[defaultAudioFilterId].type.subType.tsFilterType(DemuxTsFilterType::AUDIO);
filterMap[defaultAudioFilterId].bufferSize = FMQ_SIZE_16M;
filterMap[defaultAudioFilterId].settings.ts().tpid = 256;
filterMap[defaultAudioFilterId].settings.ts().filterSettings.av({.isPassthrough = false});
// Read customized config
TunerTestingConfigReader::readFilterConfig1_0(filterMap);
};
/** Config all the dvrs that would be used in the tests */
inline void initDvrConfig() {
// Read customized config
TunerTestingConfigReader::readDvrConfig1_0(dvrMap);
};
/** Config all the lnbs that would be used in the tests */
inline void initLnbConfig() {
// Read customized config
TunerTestingConfigReader::readLnbConfig1_0(lnbMap);
TunerTestingConfigReader::readDiseqcMessages(diseqcMsgMap);
};
/** Config all the time filters that would be used in the tests */
inline void initTimeFilterConfig() {
// Read customized config
TunerTestingConfigReader::readTimeFilterConfig1_0(timeFilterMap);
};
/** Config all the descramblers that would be used in the tests */
inline void initDescramblerConfig() {
// Read customized config
TunerTestingConfigReader::readDescramblerConfig1_0(descramblerMap);
};
/** 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::connectDvrPlayback(playback);
TunerTestingConfigReader::connectDvrRecord(record);
TunerTestingConfigReader::connectDescrambling(descrambling);
TunerTestingConfigReader::connectLnbLive(lnbLive);
TunerTestingConfigReader::connectLnbRecord(lnbRecord);
TunerTestingConfigReader::connectTimeFilter(timeFilter);
};
inline bool validateConnections() {
@@ -228,153 +157,88 @@ inline bool validateConnections() {
feIsValid &= lnbLive.support ? frontendMap.find(lnbLive.frontendId) != frontendMap.end() : true;
feIsValid &=
lnbRecord.support ? frontendMap.find(lnbRecord.frontendId) != frontendMap.end() : true;
return feIsValid;
if (!feIsValid) {
ALOGW("[vts config] dynamic config fe connection is invalid.");
return false;
}
bool dvrIsValid = frontendMap[live.frontendId].isSoftwareFe
? dvrMap.find(live.dvrSoftwareFeId) != dvrMap.end()
: true;
dvrIsValid &= playback.support ? dvrMap.find(playback.dvrId) != dvrMap.end() : true;
if (record.support) {
if (frontendMap[record.frontendId].isSoftwareFe) {
dvrIsValid &= dvrMap.find(record.dvrSoftwareFeId) != dvrMap.end();
}
dvrIsValid &= dvrMap.find(record.dvrRecordId) != dvrMap.end();
}
if (descrambling.support && frontendMap[descrambling.frontendId].isSoftwareFe) {
dvrIsValid &= dvrMap.find(descrambling.dvrSoftwareFeId) != dvrMap.end();
}
if (!dvrIsValid) {
ALOGW("[vts config] dynamic config dvr connection is invalid.");
return false;
}
bool filterIsValid = filterMap.find(live.audioFilterId) != filterMap.end() &&
filterMap.find(live.videoFilterId) != filterMap.end();
filterIsValid &= playback.support
? (filterMap.find(playback.audioFilterId) != filterMap.end() &&
filterMap.find(playback.videoFilterId) != filterMap.end())
: true;
filterIsValid &=
record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true;
filterIsValid &= descrambling.support
? (filterMap.find(descrambling.audioFilterId) != filterMap.end() &&
filterMap.find(descrambling.videoFilterId) != filterMap.end())
: true;
filterIsValid &= lnbLive.support ? (filterMap.find(lnbLive.audioFilterId) != filterMap.end() &&
filterMap.find(lnbLive.videoFilterId) != filterMap.end())
: true;
filterIsValid &=
lnbRecord.support ? filterMap.find(lnbRecord.recordFilterId) != filterMap.end() : true;
if (!filterIsValid) {
ALOGW("[vts config] dynamic config filter connection is invalid.");
return false;
}
bool lnbIsValid = lnbLive.support ? lnbMap.find(lnbLive.lnbId) != lnbMap.end() : true;
lnbIsValid &= lnbRecord.support ? lnbMap.find(lnbRecord.lnbId) != lnbMap.end() : true;
if (!lnbIsValid) {
ALOGW("[vts config] dynamic config lnb connection is invalid.");
return false;
}
bool descramblerIsValid =
descrambling.support
? descramblerMap.find(descrambling.descramblerId) != descramblerMap.end()
: true;
if (!descramblerIsValid) {
ALOGW("[vts config] dynamic config descrambler connection is invalid.");
return false;
}
bool diseqcMsgIsValid = true;
if (lnbLive.support) {
for (auto msgName : lnbLive.diseqcMsgs) {
diseqcMsgIsValid &= diseqcMsgMap.find(msgName) != diseqcMsgMap.end();
}
}
if (lnbRecord.support) {
for (auto msgName : lnbRecord.diseqcMsgs) {
diseqcMsgIsValid &= diseqcMsgMap.find(msgName) != diseqcMsgMap.end();
}
}
if (!diseqcMsgIsValid) {
ALOGW("[vts config] dynamic config diseqcMsg sender is invalid.");
return false;
}
return true;
}
// 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;
lnbArray[LNB0].voltage = LnbVoltage::VOLTAGE_12V;
lnbArray[LNB0].tone = LnbTone::NONE;
lnbArray[LNB0].position = LnbPosition::UNDEFINED;
lnbArray[LNB_EXTERNAL].usingLnb = true;
lnbArray[LNB_EXTERNAL].name = "default_lnb_external";
lnbArray[LNB_EXTERNAL].voltage = LnbVoltage::VOLTAGE_5V;
lnbArray[LNB_EXTERNAL].tone = LnbTone::NONE;
lnbArray[LNB_EXTERNAL].position = LnbPosition::UNDEFINED;
};
/** Diseqc messages array for the Lnb test */
inline void initDiseqcMsg() {
diseqcMsgArray[DISEQC_POWER_ON] = {0xE, 0x0, 0x0, 0x0, 0x0, 0x3};
};
/** Configuration array for the filter test */
inline void initFilterConfig() {
// TS VIDEO filter setting for default implementation testing
filterArray[TS_VIDEO0].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_VIDEO0].type.subType.tsFilterType(DemuxTsFilterType::VIDEO);
filterArray[TS_VIDEO0].bufferSize = FMQ_SIZE_16M;
filterArray[TS_VIDEO0].settings.ts().tpid = 256;
filterArray[TS_VIDEO0].settings.ts().filterSettings.av({.isPassthrough = false});
filterArray[TS_VIDEO1].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_VIDEO1].type.subType.tsFilterType(DemuxTsFilterType::VIDEO);
filterArray[TS_VIDEO1].bufferSize = FMQ_SIZE_16M;
filterArray[TS_VIDEO1].settings.ts().tpid = 256;
filterArray[TS_VIDEO1].settings.ts().filterSettings.av({.isPassthrough = false});
// TS AUDIO filter setting
filterArray[TS_AUDIO0].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_AUDIO0].type.subType.tsFilterType(DemuxTsFilterType::AUDIO);
filterArray[TS_AUDIO0].bufferSize = FMQ_SIZE_16M;
filterArray[TS_AUDIO0].settings.ts().tpid = 256;
filterArray[TS_AUDIO0].settings.ts().filterSettings.av({.isPassthrough = false});
// TS PES filter setting
filterArray[TS_PES0].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_PES0].type.subType.tsFilterType(DemuxTsFilterType::PES);
filterArray[TS_PES0].bufferSize = FMQ_SIZE_16M;
filterArray[TS_PES0].settings.ts().tpid = 256;
filterArray[TS_PES0].settings.ts().filterSettings.pesData({
.isRaw = false,
.streamId = 0xbd,
});
filterArray[TS_PES0].getMqDesc = true;
// TS PCR filter setting
filterArray[TS_PCR0].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_PCR0].type.subType.tsFilterType(DemuxTsFilterType::PCR);
filterArray[TS_PCR0].bufferSize = FMQ_SIZE_16M;
filterArray[TS_PCR0].settings.ts().tpid = 256;
filterArray[TS_PCR0].settings.ts().filterSettings.noinit();
// TS filter setting
filterArray[TS_TS0].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_TS0].type.subType.tsFilterType(DemuxTsFilterType::TS);
filterArray[TS_TS0].bufferSize = FMQ_SIZE_16M;
filterArray[TS_TS0].settings.ts().tpid = 256;
filterArray[TS_TS0].settings.ts().filterSettings.noinit();
// TS SECTION filter setting
filterArray[TS_SECTION0].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_SECTION0].type.subType.tsFilterType(DemuxTsFilterType::SECTION);
filterArray[TS_SECTION0].bufferSize = FMQ_SIZE_16M;
filterArray[TS_SECTION0].settings.ts().tpid = 256;
filterArray[TS_SECTION0].settings.ts().filterSettings.section({
.isRaw = false,
});
filterArray[TS_SECTION0].getMqDesc = true;
// TS RECORD filter setting
filterArray[TS_RECORD0].type.mainType = DemuxFilterMainType::TS;
filterArray[TS_RECORD0].type.subType.tsFilterType(DemuxTsFilterType::RECORD);
filterArray[TS_RECORD0].settings.ts().tpid = 81;
filterArray[TS_RECORD0].settings.ts().filterSettings.record({
.scIndexType = DemuxRecordScIndexType::NONE,
});
// TS Linkage filter setting
filterLinkageTypes[SOURCE][0].mainType = DemuxFilterMainType::TS;
filterLinkageTypes[SOURCE][0].subType.tsFilterType(DemuxTsFilterType::TS);
filterLinkageTypes[SINK][0] = filterLinkageTypes[SOURCE][0];
// MMTP Linkage filter setting
filterLinkageTypes[SOURCE][1].mainType = DemuxFilterMainType::MMTP;
filterLinkageTypes[SOURCE][1].subType.mmtpFilterType(DemuxMmtpFilterType::AUDIO);
filterLinkageTypes[SINK][1] = filterLinkageTypes[SOURCE][1];
// IP Linkage filter setting
filterLinkageTypes[SOURCE][2].mainType = DemuxFilterMainType::IP;
filterLinkageTypes[SOURCE][2].subType.ipFilterType(DemuxIpFilterType::IP);
filterLinkageTypes[SINK][2] = filterLinkageTypes[SOURCE][2];
// TLV Linkage filter setting
filterLinkageTypes[SOURCE][3].mainType = DemuxFilterMainType::TLV;
filterLinkageTypes[SOURCE][3].subType.tlvFilterType(DemuxTlvFilterType::TLV);
filterLinkageTypes[SINK][3] = filterLinkageTypes[SOURCE][3];
// ALP Linkage PTP filter setting
filterLinkageTypes[SOURCE][4].mainType = DemuxFilterMainType::ALP;
filterLinkageTypes[SOURCE][4].subType.alpFilterType(DemuxAlpFilterType::PTP);
filterLinkageTypes[SINK][4] = filterLinkageTypes[SOURCE][4];
};
/** Configuration array for the timer filter test */
inline void initTimeFilterConfig() {
timeFilterArray[TIMER0].supportTimeFilter = true;
timeFilterArray[TIMER0].timeStamp = 1;
}
/** Configuration array for the dvr test */
inline void initDvrConfig() {
RecordSettings recordSettings{
.statusMask = 0xf,
.lowThreshold = 0x1000,
.highThreshold = 0x07fff,
.dataFormat = DataFormat::TS,
.packetSize = 188,
};
dvrArray[DVR_RECORD0].type = DvrType::RECORD;
dvrArray[DVR_RECORD0].bufferSize = FMQ_SIZE_4M;
dvrArray[DVR_RECORD0].settings.record(recordSettings);
PlaybackSettings playbackSettings{
.statusMask = 0xf,
.lowThreshold = 0x1000,
.highThreshold = 0x07fff,
.dataFormat = DataFormat::TS,
.packetSize = 188,
};
dvrArray[DVR_PLAYBACK0].type = DvrType::PLAYBACK;
dvrArray[DVR_PLAYBACK0].playbackInputFile = "/data/local/tmp/segment000000.ts";
dvrArray[DVR_PLAYBACK0].bufferSize = FMQ_SIZE_4M;
dvrArray[DVR_PLAYBACK0].settings.playback(playbackSettings);
PlaybackSettings softwareFePlaybackSettings{
.statusMask = 0xf,
.lowThreshold = 0x1000,
.highThreshold = 0x07fff,
.dataFormat = DataFormat::TS,
.packetSize = 188,
};
dvrArray[DVR_SOFTWARE_FE].type = DvrType::PLAYBACK;
dvrArray[DVR_SOFTWARE_FE].playbackInputFile = "/data/local/tmp/segment000000.ts";
dvrArray[DVR_SOFTWARE_FE].bufferSize = FMQ_SIZE_4M;
dvrArray[DVR_SOFTWARE_FE].settings.playback(softwareFePlaybackSettings);
};
/** Configuration array for the descrambler test */
inline void initDescramblerConfig() {
descramblerArray[DESC_0].casSystemId = CLEAR_KEY_SYSTEM_ID;
descramblerArray[DESC_0].provisionStr = PROVISION_STR;
descramblerArray[DESC_0].hidlPvtData.resize(256);
};

View File

@@ -29,8 +29,11 @@ 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::DemuxFilterAvSettings;
using android::hardware::tv::tuner::V1_0::DemuxFilterEvent;
using android::hardware::tv::tuner::V1_0::DemuxFilterMainType;
using android::hardware::tv::tuner::V1_0::DemuxFilterRecordSettings;
using android::hardware::tv::tuner::V1_0::DemuxFilterSectionSettings;
using android::hardware::tv::tuner::V1_0::DemuxFilterSettings;
using android::hardware::tv::tuner::V1_0::DemuxFilterType;
using android::hardware::tv::tuner::V1_0::DemuxIpFilterType;
@@ -61,6 +64,19 @@ 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";
const string emptyHardwareId = "";
#define PROVISION_STR \
"{ " \
" \"id\": 21140844, " \
" \"name\": \"Test Title\", " \
" \"lowercase_organization_name\": \"Android\", " \
" \"asset_key\": { " \
" \"encryption_key\": \"nezAr3CHFrmBR9R8Tedotw==\" " \
" }, " \
" \"cas_type\": 1, " \
" \"track_types\": [ ] " \
"} "
struct FrontendConfig {
bool isSoftwareFe;
@@ -70,48 +86,104 @@ struct FrontendConfig {
vector<FrontendStatus> expectTuneStatuses;
};
struct FilterConfig {
uint32_t bufferSize;
DemuxFilterType type;
DemuxFilterSettings settings;
bool getMqDesc;
bool operator<(const FilterConfig& /*c*/) const { return false; }
};
struct DvrConfig {
DvrType type;
uint32_t bufferSize;
DvrSettings settings;
string playbackInputFile;
};
struct LnbConfig {
string name;
LnbVoltage voltage;
LnbTone tone;
LnbPosition position;
};
struct TimeFilterConfig {
uint64_t timeStamp;
};
struct DescramblerConfig {
uint32_t casSystemId;
string provisionStr;
vector<uint8_t> hidlPvtData;
};
struct LiveBroadcastHardwareConnections {
string frontendId;
/* string audioFilterId;
string dvrSoftwareFeId;
string audioFilterId;
string videoFilterId;
list string of extra filters; */
string sectionFilterId;
string pcrFilterId;
/* list string of extra filters; */
};
struct ScanHardwareConnections {
string frontendId;
};
struct DvrPlaybackHardwareConnections {
bool support;
string frontendId;
string dvrId;
string audioFilterId;
string videoFilterId;
string sectionFilterId;
/* list string of extra filters; */
};
struct DvrRecordHardwareConnections {
bool support;
string frontendId;
/* string recordFilterId;
string dvrId; */
string dvrRecordId;
string dvrSoftwareFeId;
string recordFilterId;
};
struct DescramblingHardwareConnections {
bool support;
string frontendId;
/* string descramblerId;
string dvrSoftwareFeId;
string audioFilterId;
string videoFilterId;
list string of extra filters; */
string descramblerId;
/* list string of extra filters; */
};
struct LnbLiveHardwareConnections {
bool support;
string frontendId;
/* string audioFilterId;
string audioFilterId;
string videoFilterId;
list string of extra filters;
string lnbId; */
string lnbId;
vector<string> diseqcMsgs;
/* list string of extra filters; */
};
struct LnbRecordHardwareConnections {
bool support;
string frontendId;
/* string recordFilterId;
list string of extra filters;
string lnbId; */
string dvrRecordId;
string recordFilterId;
string lnbId;
vector<string> diseqcMsgs;
/* list string of extra filters; */
};
struct TimeFilterHardwareConnections {
bool support;
string timeFilterId;
};
struct TunerTestingConfigReader {
@@ -129,7 +201,7 @@ struct TunerTestingConfigReader {
static void readFrontendConfig1_0(map<string, FrontendConfig>& frontendMap) {
auto hardwareConfig = getHardwareConfig();
if (hardwareConfig.hasFrontends()) {
// TODO: complete the tune status config
// TODO: b/182519645 complete the tune status config
vector<FrontendStatusType> types;
types.push_back(FrontendStatusType::DEMOD_LOCK);
FrontendStatus status;
@@ -149,7 +221,7 @@ struct TunerTestingConfigReader {
case FrontendTypeEnum::UNDEFINED:
type = FrontendType::UNDEFINED;
break;
// TODO: finish all other frontend settings
// TODO: b/182519645 finish all other frontend settings
case FrontendTypeEnum::ANALOG:
type = FrontendType::ANALOG;
break;
@@ -189,16 +261,158 @@ struct TunerTestingConfigReader {
}
frontendMap[id].type = type;
frontendMap[id].isSoftwareFe = feConfig.getIsSoftwareFrontend();
// TODO: complete the tune status config
// TODO: b/182519645 complete the tune status config
frontendMap[id].tuneStatusTypes = types;
frontendMap[id].expectTuneStatuses = statuses;
}
}
}
static void readFilterConfig1_0(map<string, FilterConfig>& filterMap) {
auto hardwareConfig = getHardwareConfig();
if (hardwareConfig.hasFilters()) {
auto filters = *hardwareConfig.getFirstFilters();
for (auto filterConfig : filters.getFilter()) {
string id = filterConfig.getId();
if (id.compare(string("FILTER_AUDIO_DEFAULT")) == 0) {
// overrid default
filterMap.erase(string("FILTER_AUDIO_DEFAULT"));
}
if (id.compare(string("FILTER_VIDEO_DEFAULT")) == 0) {
// overrid default
filterMap.erase(string("FILTER_VIDEO_DEFAULT"));
}
DemuxFilterType type;
DemuxFilterSettings settings;
if (!readFilterTypeAndSettings(filterConfig, type, settings)) {
ALOGW("[ConfigReader] invalid filter type");
return;
}
filterMap[id].type = type;
filterMap[id].bufferSize = filterConfig.getBufferSize();
filterMap[id].getMqDesc = filterConfig.getUseFMQ();
filterMap[id].settings = settings;
}
}
}
static void readDvrConfig1_0(map<string, DvrConfig>& dvrMap) {
auto hardwareConfig = getHardwareConfig();
if (hardwareConfig.hasDvrs()) {
auto dvrs = *hardwareConfig.getFirstDvrs();
for (auto dvrConfig : dvrs.getDvr()) {
string id = dvrConfig.getId();
DvrType type;
switch (dvrConfig.getType()) {
case DvrTypeEnum::PLAYBACK:
type = DvrType::PLAYBACK;
dvrMap[id].settings.playback(readPlaybackSettings(dvrConfig));
break;
case DvrTypeEnum::RECORD:
type = DvrType::RECORD;
dvrMap[id].settings.record(readRecordSettings(dvrConfig));
break;
case DvrTypeEnum::UNKNOWN:
ALOGW("[ConfigReader] invalid DVR type");
return;
}
dvrMap[id].type = type;
dvrMap[id].bufferSize = static_cast<uint32_t>(dvrConfig.getBufferSize());
if (dvrConfig.hasInputFilePath()) {
dvrMap[id].playbackInputFile = dvrConfig.getInputFilePath();
}
}
}
}
static void readLnbConfig1_0(map<string, LnbConfig>& lnbMap) {
auto hardwareConfig = getHardwareConfig();
if (hardwareConfig.hasLnbs()) {
auto lnbs = *hardwareConfig.getFirstLnbs();
for (auto lnbConfig : lnbs.getLnb()) {
string id = lnbConfig.getId();
if (lnbConfig.hasName()) {
lnbMap[id].name = lnbConfig.getName();
} else {
lnbMap[id].name = emptyHardwareId;
}
lnbMap[id].voltage = static_cast<LnbVoltage>(lnbConfig.getVoltage());
lnbMap[id].tone = static_cast<LnbTone>(lnbConfig.getTone());
lnbMap[id].position = static_cast<LnbPosition>(lnbConfig.getPosition());
}
}
}
static void readDescramblerConfig1_0(map<string, DescramblerConfig>& descramblerMap) {
auto hardwareConfig = getHardwareConfig();
if (hardwareConfig.hasDescramblers()) {
auto descramblers = *hardwareConfig.getFirstDescramblers();
for (auto descramblerConfig : descramblers.getDescrambler()) {
string id = descramblerConfig.getId();
descramblerMap[id].casSystemId =
static_cast<uint32_t>(descramblerConfig.getCasSystemId());
if (descramblerConfig.hasProvisionStr()) {
descramblerMap[id].provisionStr = descramblerConfig.getProvisionStr();
} else {
descramblerMap[id].provisionStr = PROVISION_STR;
}
if (descramblerConfig.hasSesstionPrivatData()) {
auto privateData = descramblerConfig.getSesstionPrivatData();
int size = privateData.size();
descramblerMap[id].hidlPvtData.resize(size);
memcpy(descramblerMap[id].hidlPvtData.data(), privateData.data(), size);
} else {
descramblerMap[id].hidlPvtData.resize(256);
}
}
}
}
static void readDiseqcMessages(map<string, vector<uint8_t>>& diseqcMsgMap) {
auto hardwareConfig = getHardwareConfig();
if (hardwareConfig.hasDiseqcMessages()) {
auto msgs = *hardwareConfig.getFirstDiseqcMessages();
for (auto msgConfig : msgs.getDiseqcMessage()) {
string name = msgConfig.getMsgName();
for (uint8_t atom : msgConfig.getMsgBody()) {
diseqcMsgMap[name].push_back(atom);
}
}
}
}
static void readTimeFilterConfig1_0(map<string, TimeFilterConfig>& timeFilterMap) {
auto hardwareConfig = getHardwareConfig();
if (hardwareConfig.hasTimeFilters()) {
auto timeFilters = *hardwareConfig.getFirstTimeFilters();
for (auto timeFilterConfig : timeFilters.getTimeFilter()) {
string id = timeFilterConfig.getId();
timeFilterMap[id].timeStamp =
static_cast<uint64_t>(timeFilterConfig.getTimeStamp());
}
}
}
static void connectLiveBroadcast(LiveBroadcastHardwareConnections& live) {
auto liveConfig = getDataFlowConfiguration().getFirstClearLiveBroadcast();
live.frontendId = liveConfig->getFrontendConnection();
auto liveConfig = *getDataFlowConfiguration().getFirstClearLiveBroadcast();
live.frontendId = liveConfig.getFrontendConnection();
live.audioFilterId = liveConfig.getAudioFilterConnection();
live.videoFilterId = liveConfig.getVideoFilterConnection();
if (liveConfig.hasPcrFilterConnection()) {
live.pcrFilterId = liveConfig.getPcrFilterConnection();
} else {
live.pcrFilterId = emptyHardwareId;
}
if (liveConfig.hasSectionFilterConnection()) {
live.sectionFilterId = liveConfig.getSectionFilterConnection();
} else {
live.sectionFilterId = emptyHardwareId;
}
if (liveConfig.hasDvrSoftwareFeConnection()) {
live.dvrSoftwareFeId = liveConfig.getDvrSoftwareFeConnection();
}
}
static void connectScan(ScanHardwareConnections& scan) {
@@ -206,49 +420,109 @@ struct TunerTestingConfigReader {
scan.frontendId = scanConfig->getFrontendConnection();
}
static void connectDvrRecord(DvrRecordHardwareConnections& record) {
static void connectDvrPlayback(DvrPlaybackHardwareConnections& playback) {
auto dataFlow = getDataFlowConfiguration();
if (!dataFlow.hasDvrRecord()) {
record.support = false;
if (dataFlow.hasDvrPlayback()) {
playback.support = true;
} else {
return;
}
auto recordConfig = dataFlow.getFirstDvrRecord();
record.frontendId = recordConfig->getFrontendConnection();
auto playbackConfig = *dataFlow.getFirstDvrPlayback();
playback.dvrId = playbackConfig.getDvrConnection();
playback.audioFilterId = playbackConfig.getAudioFilterConnection();
playback.videoFilterId = playbackConfig.getVideoFilterConnection();
if (playbackConfig.hasSectionFilterConnection()) {
playback.sectionFilterId = playbackConfig.getSectionFilterConnection();
} else {
playback.sectionFilterId = emptyHardwareId;
}
}
static void connectDvrRecord(DvrRecordHardwareConnections& record) {
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasDvrRecord()) {
record.support = true;
} else {
return;
}
auto recordConfig = *dataFlow.getFirstDvrRecord();
record.frontendId = recordConfig.getFrontendConnection();
record.recordFilterId = recordConfig.getRecordFilterConnection();
record.dvrRecordId = recordConfig.getDvrRecordConnection();
if (recordConfig.hasDvrSoftwareFeConnection()) {
record.dvrSoftwareFeId = recordConfig.getDvrSoftwareFeConnection();
}
}
static void connectDescrambling(DescramblingHardwareConnections& descrambling) {
auto dataFlow = getDataFlowConfiguration();
if (!dataFlow.hasDescrambling()) {
descrambling.support = false;
if (dataFlow.hasDescrambling()) {
descrambling.support = true;
} else {
return;
}
auto descConfig = dataFlow.getFirstDescrambling();
descrambling.frontendId = descConfig->getFrontendConnection();
auto descConfig = *dataFlow.getFirstDescrambling();
descrambling.frontendId = descConfig.getFrontendConnection();
descrambling.descramblerId = descConfig.getDescramblerConnection();
descrambling.audioFilterId = descConfig.getAudioFilterConnection();
descrambling.videoFilterId = descConfig.getVideoFilterConnection();
if (descConfig.hasDvrSoftwareFeConnection()) {
descrambling.dvrSoftwareFeId = descConfig.getDvrSoftwareFeConnection();
}
}
static void connectLnbLive(LnbLiveHardwareConnections& lnbLive) {
auto dataFlow = getDataFlowConfiguration();
if (!dataFlow.hasLnbLive()) {
lnbLive.support = false;
if (dataFlow.hasLnbLive()) {
lnbLive.support = true;
} else {
return;
}
auto lnbLiveConfig = dataFlow.getFirstLnbLive();
lnbLive.frontendId = lnbLiveConfig->getFrontendConnection();
auto lnbLiveConfig = *dataFlow.getFirstLnbLive();
lnbLive.frontendId = lnbLiveConfig.getFrontendConnection();
lnbLive.audioFilterId = lnbLiveConfig.getAudioFilterConnection();
lnbLive.videoFilterId = lnbLiveConfig.getVideoFilterConnection();
lnbLive.lnbId = lnbLiveConfig.getLnbConnection();
if (lnbLiveConfig.hasDiseqcMsgSender()) {
for (auto msgName : lnbLiveConfig.getDiseqcMsgSender()) {
lnbLive.diseqcMsgs.push_back(msgName);
}
}
}
static void connectLnbRecord(LnbRecordHardwareConnections& lnbRecord) {
auto dataFlow = getDataFlowConfiguration();
if (!dataFlow.hasLnbRecord()) {
lnbRecord.support = false;
if (dataFlow.hasLnbRecord()) {
lnbRecord.support = true;
} else {
return;
}
auto lnbRecordConfig = dataFlow.getFirstLnbRecord();
lnbRecord.frontendId = lnbRecordConfig->getFrontendConnection();
auto lnbRecordConfig = *dataFlow.getFirstLnbRecord();
lnbRecord.frontendId = lnbRecordConfig.getFrontendConnection();
lnbRecord.recordFilterId = lnbRecordConfig.getRecordFilterConnection();
lnbRecord.dvrRecordId = lnbRecordConfig.getDvrRecordConnection();
lnbRecord.lnbId = lnbRecordConfig.getLnbConnection();
if (lnbRecordConfig.hasDiseqcMsgSender()) {
for (auto msgName : lnbRecordConfig.getDiseqcMsgSender()) {
lnbRecord.diseqcMsgs.push_back(msgName);
}
}
}
static void connectTimeFilter(TimeFilterHardwareConnections& timeFilter) {
auto dataFlow = getDataFlowConfiguration();
if (dataFlow.hasTimeFilter()) {
timeFilter.support = true;
} else {
return;
}
auto timeFilterConfig = *dataFlow.getFirstTimeFilter();
timeFilter.timeFilterId = timeFilterConfig.getTimeFilterConnection();
}
private:
static FrontendDvbtSettings readDvbtFrontendSettings(Frontend feConfig) {
ALOGW("[ConfigReader] type is dvbt");
ALOGW("[ConfigReader] fe type is dvbt");
FrontendDvbtSettings dvbtSettings{
.frequency = (uint32_t)feConfig.getFrequency(),
};
@@ -266,7 +540,7 @@ struct TunerTestingConfigReader {
}
static FrontendDvbsSettings readDvbsFrontendSettings(Frontend feConfig) {
ALOGW("[ConfigReader] type is dvbs");
ALOGW("[ConfigReader] fe type is dvbs");
FrontendDvbsSettings dvbsSettings{
.frequency = (uint32_t)feConfig.getFrequency(),
};
@@ -281,6 +555,171 @@ struct TunerTestingConfigReader {
return dvbsSettings;
}
static bool readFilterTypeAndSettings(Filter filterConfig, DemuxFilterType& type,
DemuxFilterSettings& settings) {
auto mainType = filterConfig.getMainType();
auto subType = filterConfig.getSubType();
uint32_t pid = static_cast<uint32_t>(filterConfig.getPid());
switch (mainType) {
case FilterMainTypeEnum::TS: {
ALOGW("[ConfigReader] filter main type is ts");
type.mainType = DemuxFilterMainType::TS;
switch (subType) {
case FilterSubTypeEnum::UNDEFINED:
break;
case FilterSubTypeEnum::SECTION:
type.subType.tsFilterType(DemuxTsFilterType::SECTION);
settings.ts().filterSettings.section(
readSectionFilterSettings(filterConfig));
break;
case FilterSubTypeEnum::PES:
// TODO: b/182519645 support all the filter settings
/*settings.ts().filterSettings.pesData(
getPesFilterSettings(filterConfig));*/
type.subType.tsFilterType(DemuxTsFilterType::PES);
break;
case FilterSubTypeEnum::TS:
type.subType.tsFilterType(DemuxTsFilterType::TS);
settings.ts().filterSettings.noinit();
break;
case FilterSubTypeEnum::PCR:
type.subType.tsFilterType(DemuxTsFilterType::PCR);
settings.ts().filterSettings.noinit();
break;
case FilterSubTypeEnum::TEMI:
type.subType.tsFilterType(DemuxTsFilterType::TEMI);
settings.ts().filterSettings.noinit();
break;
case FilterSubTypeEnum::AUDIO:
type.subType.tsFilterType(DemuxTsFilterType::AUDIO);
settings.ts().filterSettings.av(readAvFilterSettings(filterConfig));
break;
case FilterSubTypeEnum::VIDEO:
type.subType.tsFilterType(DemuxTsFilterType::VIDEO);
settings.ts().filterSettings.av(readAvFilterSettings(filterConfig));
break;
case FilterSubTypeEnum::RECORD:
type.subType.tsFilterType(DemuxTsFilterType::RECORD);
settings.ts().filterSettings.record(readRecordFilterSettings(filterConfig));
break;
default:
ALOGW("[ConfigReader] ts subtype is not supported");
return false;
}
settings.ts().tpid = pid;
break;
}
case FilterMainTypeEnum::MMTP: {
ALOGW("[ConfigReader] filter main type is mmtp");
type.mainType = DemuxFilterMainType::MMTP;
switch (subType) {
case FilterSubTypeEnum::UNDEFINED:
break;
case FilterSubTypeEnum::SECTION:
type.subType.mmtpFilterType(DemuxMmtpFilterType::SECTION);
settings.mmtp().filterSettings.section(
readSectionFilterSettings(filterConfig));
break;
case FilterSubTypeEnum::PES:
type.subType.mmtpFilterType(DemuxMmtpFilterType::PES);
// TODO: b/182519645 support all the filter settings
/*settings.mmtp().filterSettings.pesData(
getPesFilterSettings(filterConfig));*/
break;
case FilterSubTypeEnum::MMTP:
type.subType.mmtpFilterType(DemuxMmtpFilterType::MMTP);
settings.mmtp().filterSettings.noinit();
break;
case FilterSubTypeEnum::AUDIO:
type.subType.mmtpFilterType(DemuxMmtpFilterType::AUDIO);
settings.mmtp().filterSettings.av(readAvFilterSettings(filterConfig));
break;
case FilterSubTypeEnum::VIDEO:
settings.mmtp().filterSettings.av(readAvFilterSettings(filterConfig));
break;
case FilterSubTypeEnum::RECORD:
type.subType.mmtpFilterType(DemuxMmtpFilterType::RECORD);
settings.mmtp().filterSettings.record(
readRecordFilterSettings(filterConfig));
break;
case FilterSubTypeEnum::DOWNLOAD:
type.subType.mmtpFilterType(DemuxMmtpFilterType::DOWNLOAD);
// TODO: b/182519645 support all the filter settings
/*settings.mmtp().filterSettings.download(
getDownloadFilterSettings(filterConfig));*/
break;
default:
ALOGW("[ConfigReader] mmtp subtype is not supported");
return false;
}
settings.mmtp().mmtpPid = pid;
break;
}
default:
// TODO: b/182519645 support all the filter configs
ALOGW("[ConfigReader] filter main type is not supported in dynamic config");
return false;
}
return true;
}
static DemuxFilterSectionSettings readSectionFilterSettings(Filter filterConfig) {
DemuxFilterSectionSettings settings;
if (!filterConfig.hasSectionFilterSettings_optional()) {
return settings;
}
auto section = filterConfig.getFirstSectionFilterSettings_optional();
settings.isCheckCrc = section->getIsCheckCrc();
settings.isRepeat = section->getIsRepeat();
settings.isRaw = section->getIsRaw();
return settings;
}
static DemuxFilterAvSettings readAvFilterSettings(Filter filterConfig) {
DemuxFilterAvSettings settings;
if (!filterConfig.hasAvFilterSettings_optional()) {
return settings;
}
auto av = filterConfig.getFirstAvFilterSettings_optional();
settings.isPassthrough = av->getIsPassthrough();
return settings;
}
static DemuxFilterRecordSettings readRecordFilterSettings(Filter filterConfig) {
DemuxFilterRecordSettings settings;
if (!filterConfig.hasRecordFilterSettings_optional()) {
return settings;
}
auto record = filterConfig.getFirstRecordFilterSettings_optional();
settings.tsIndexMask = static_cast<uint32_t>(record->getTsIndexMask());
settings.scIndexType = static_cast<DemuxRecordScIndexType>(record->getScIndexType());
return settings;
}
static PlaybackSettings readPlaybackSettings(Dvr dvrConfig) {
ALOGW("[ConfigReader] dvr type is playback");
PlaybackSettings playbackSettings{
.statusMask = static_cast<uint8_t>(dvrConfig.getStatusMask()),
.lowThreshold = static_cast<uint32_t>(dvrConfig.getLowThreshold()),
.highThreshold = static_cast<uint32_t>(dvrConfig.getHighThreshold()),
.dataFormat = static_cast<DataFormat>(dvrConfig.getDataFormat()),
.packetSize = static_cast<uint8_t>(dvrConfig.getPacketSize()),
};
return playbackSettings;
}
static RecordSettings readRecordSettings(Dvr dvrConfig) {
ALOGW("[ConfigReader] dvr type is record");
RecordSettings recordSettings{
.statusMask = static_cast<uint8_t>(dvrConfig.getStatusMask()),
.lowThreshold = static_cast<uint32_t>(dvrConfig.getLowThreshold()),
.highThreshold = static_cast<uint32_t>(dvrConfig.getHighThreshold()),
.dataFormat = static_cast<DataFormat>(dvrConfig.getDataFormat()),
.packetSize = static_cast<uint8_t>(dvrConfig.getPacketSize()),
};
return recordSettings;
}
static TunerConfiguration getTunerConfig() { return *read(configFilePath.c_str()); }
static HardwareConfiguration getHardwareConfig() {

View File

@@ -1,50 +1,112 @@
// Signature format: 2.0
package android.media.tuner.testing.configuration.V1_0 {
public class AvFilterSettings {
ctor public AvFilterSettings();
method @Nullable public boolean getIsPassthrough();
method public void setIsPassthrough(@Nullable boolean);
}
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.DvrPlayback getDvrPlayback();
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 @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.TimeFilter getTimeFilter();
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 setDvrPlayback(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrPlayback);
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);
method public void setTimeFilter(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.TimeFilter);
}
public static class DataFlowConfiguration.ClearLiveBroadcast {
ctor public DataFlowConfiguration.ClearLiveBroadcast();
method @Nullable public String getAudioFilterConnection();
method @Nullable public String getDvrSoftwareFeConnection();
method @Nullable public String getFrontendConnection();
method @Nullable public String getPcrFilterConnection();
method @Nullable public String getSectionFilterConnection();
method @Nullable public String getVideoFilterConnection();
method public void setAudioFilterConnection(@Nullable String);
method public void setDvrSoftwareFeConnection(@Nullable String);
method public void setFrontendConnection(@Nullable String);
method public void setPcrFilterConnection(@Nullable String);
method public void setSectionFilterConnection(@Nullable String);
method public void setVideoFilterConnection(@Nullable String);
}
public static class DataFlowConfiguration.Descrambling {
ctor public DataFlowConfiguration.Descrambling();
method @Nullable public String getAudioFilterConnection();
method @Nullable public String getDescramblerConnection();
method @Nullable public String getDvrSoftwareFeConnection();
method @Nullable public String getFrontendConnection();
method @Nullable public String getVideoFilterConnection();
method public void setAudioFilterConnection(@Nullable String);
method public void setDescramblerConnection(@Nullable String);
method public void setDvrSoftwareFeConnection(@Nullable String);
method public void setFrontendConnection(@Nullable String);
method public void setVideoFilterConnection(@Nullable String);
}
public static class DataFlowConfiguration.DvrPlayback {
ctor public DataFlowConfiguration.DvrPlayback();
method @Nullable public String getAudioFilterConnection();
method @Nullable public String getDvrConnection();
method @Nullable public String getSectionFilterConnection();
method @Nullable public String getVideoFilterConnection();
method public void setAudioFilterConnection(@Nullable String);
method public void setDvrConnection(@Nullable String);
method public void setSectionFilterConnection(@Nullable String);
method public void setVideoFilterConnection(@Nullable String);
}
public static class DataFlowConfiguration.DvrRecord {
ctor public DataFlowConfiguration.DvrRecord();
method @Nullable public String getDvrRecordConnection();
method @Nullable public String getDvrSoftwareFeConnection();
method @Nullable public String getFrontendConnection();
method @Nullable public String getRecordFilterConnection();
method public void setDvrRecordConnection(@Nullable String);
method public void setDvrSoftwareFeConnection(@Nullable String);
method public void setFrontendConnection(@Nullable String);
method public void setRecordFilterConnection(@Nullable String);
}
public static class DataFlowConfiguration.LnbLive {
ctor public DataFlowConfiguration.LnbLive();
method @Nullable public String getAudioFilterConnection();
method @Nullable public java.util.List<java.lang.String> getDiseqcMsgSender();
method @Nullable public String getFrontendConnection();
method @Nullable public String getLnbConnection();
method @Nullable public String getVideoFilterConnection();
method public void setAudioFilterConnection(@Nullable String);
method public void setDiseqcMsgSender(@Nullable java.util.List<java.lang.String>);
method public void setFrontendConnection(@Nullable String);
method public void setLnbConnection(@Nullable String);
method public void setVideoFilterConnection(@Nullable String);
}
public static class DataFlowConfiguration.LnbRecord {
ctor public DataFlowConfiguration.LnbRecord();
method @Nullable public java.util.List<java.lang.String> getDiseqcMsgSender();
method @Nullable public String getDvrRecordConnection();
method @Nullable public String getFrontendConnection();
method @Nullable public String getLnbConnection();
method @Nullable public String getRecordFilterConnection();
method public void setDiseqcMsgSender(@Nullable java.util.List<java.lang.String>);
method public void setDvrRecordConnection(@Nullable String);
method public void setFrontendConnection(@Nullable String);
method public void setLnbConnection(@Nullable String);
method public void setRecordFilterConnection(@Nullable String);
}
public static class DataFlowConfiguration.Scan {
@@ -53,6 +115,32 @@ package android.media.tuner.testing.configuration.V1_0 {
method public void setFrontendConnection(@Nullable String);
}
public static class DataFlowConfiguration.TimeFilter {
ctor public DataFlowConfiguration.TimeFilter();
method @Nullable public String getTimeFilterConnection();
method public void setTimeFilterConnection(@Nullable String);
}
public class Descrambler {
ctor public Descrambler();
method @Nullable public java.math.BigInteger getCasSystemId();
method @Nullable public String getId();
method @Nullable public String getProvisionStr();
method @Nullable public java.util.List<java.lang.Short> getSesstionPrivatData();
method public void setCasSystemId(@Nullable java.math.BigInteger);
method public void setId(@Nullable String);
method public void setProvisionStr(@Nullable String);
method public void setSesstionPrivatData(@Nullable java.util.List<java.lang.Short>);
}
public class DiseqcMessage {
ctor public DiseqcMessage();
method @Nullable public java.util.List<java.lang.Short> getMsgBody();
method @Nullable public String getMsgName();
method public void setMsgBody(@Nullable java.util.List<java.lang.Short>);
method public void setMsgName(@Nullable String);
}
public class DvbsFrontendSettings {
ctor public DvbsFrontendSettings();
method @Nullable public java.math.BigInteger getInputStreamId();
@@ -71,6 +159,93 @@ package android.media.tuner.testing.configuration.V1_0 {
method public void setTransmissionMode(@Nullable java.math.BigInteger);
}
public class Dvr {
ctor public Dvr();
method @Nullable public java.math.BigInteger getBufferSize();
method @Nullable public android.media.tuner.testing.configuration.V1_0.DvrDataFormatEnum getDataFormat();
method @Nullable public java.math.BigInteger getHighThreshold();
method @Nullable public String getId();
method @Nullable public String getInputFilePath();
method @Nullable public java.math.BigInteger getLowThreshold();
method @Nullable public java.math.BigInteger getPacketSize();
method @Nullable public java.math.BigInteger getStatusMask();
method @Nullable public android.media.tuner.testing.configuration.V1_0.DvrTypeEnum getType();
method public void setBufferSize(@Nullable java.math.BigInteger);
method public void setDataFormat(@Nullable android.media.tuner.testing.configuration.V1_0.DvrDataFormatEnum);
method public void setHighThreshold(@Nullable java.math.BigInteger);
method public void setId(@Nullable String);
method public void setInputFilePath(@Nullable String);
method public void setLowThreshold(@Nullable java.math.BigInteger);
method public void setPacketSize(@Nullable java.math.BigInteger);
method public void setStatusMask(@Nullable java.math.BigInteger);
method public void setType(@Nullable android.media.tuner.testing.configuration.V1_0.DvrTypeEnum);
}
public enum DvrDataFormatEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrDataFormatEnum ES;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrDataFormatEnum PES;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrDataFormatEnum SHV_TLV;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrDataFormatEnum TS;
}
public enum DvrStatusEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrStatusEnum DATA_READY;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrStatusEnum HIGH_WATER;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrStatusEnum LOW_WATER;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrStatusEnum OVERFLOW;
}
public enum DvrTypeEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrTypeEnum PLAYBACK;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.DvrTypeEnum RECORD;
}
public class Filter {
ctor public Filter();
method @Nullable public android.media.tuner.testing.configuration.V1_0.AvFilterSettings getAvFilterSettings_optional();
method @Nullable public java.math.BigInteger getBufferSize();
method @Nullable public String getId();
method @Nullable public android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum getMainType();
method @Nullable public java.math.BigInteger getPid();
method @Nullable public android.media.tuner.testing.configuration.V1_0.RecordFilterSettings getRecordFilterSettings_optional();
method @Nullable public android.media.tuner.testing.configuration.V1_0.SectionFilterSettings getSectionFilterSettings_optional();
method @Nullable public android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum getSubType();
method @Nullable public boolean getUseFMQ();
method public void setAvFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.AvFilterSettings);
method public void setBufferSize(@Nullable java.math.BigInteger);
method public void setId(@Nullable String);
method public void setMainType(@Nullable android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum);
method public void setPid(@Nullable java.math.BigInteger);
method public void setRecordFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.RecordFilterSettings);
method public void setSectionFilterSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.SectionFilterSettings);
method public void setSubType(@Nullable android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum);
method public void setUseFMQ(@Nullable boolean);
}
public enum FilterMainTypeEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum MMTP;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterMainTypeEnum TS;
}
public enum FilterSubTypeEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum AUDIO;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum DOWNLOAD;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum MMTP;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum PCR;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum PES;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum RECORD;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum SECTION;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum TEMI;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum TS;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum UNDEFINED;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.FilterSubTypeEnum VIDEO;
}
public class Frontend {
ctor public Frontend();
method @Nullable public java.math.BigInteger getConnectToCicamId();
@@ -108,8 +283,40 @@ package android.media.tuner.testing.configuration.V1_0 {
public class HardwareConfiguration {
ctor public HardwareConfiguration();
method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Descramblers getDescramblers();
method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.DiseqcMessages getDiseqcMessages();
method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Dvrs getDvrs();
method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Filters getFilters();
method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Frontends getFrontends();
method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Lnbs getLnbs();
method @Nullable public android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.TimeFilters getTimeFilters();
method public void setDescramblers(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Descramblers);
method public void setDiseqcMessages(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.DiseqcMessages);
method public void setDvrs(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Dvrs);
method public void setFilters(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Filters);
method public void setFrontends(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Frontends);
method public void setLnbs(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.Lnbs);
method public void setTimeFilters(@Nullable android.media.tuner.testing.configuration.V1_0.HardwareConfiguration.TimeFilters);
}
public static class HardwareConfiguration.Descramblers {
ctor public HardwareConfiguration.Descramblers();
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.Descrambler> getDescrambler();
}
public static class HardwareConfiguration.DiseqcMessages {
ctor public HardwareConfiguration.DiseqcMessages();
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.DiseqcMessage> getDiseqcMessage();
}
public static class HardwareConfiguration.Dvrs {
ctor public HardwareConfiguration.Dvrs();
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.Dvr> getDvr();
}
public static class HardwareConfiguration.Filters {
ctor public HardwareConfiguration.Filters();
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.Filter> getFilter();
}
public static class HardwareConfiguration.Frontends {
@@ -117,6 +324,89 @@ package android.media.tuner.testing.configuration.V1_0 {
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.Frontend> getFrontend();
}
public static class HardwareConfiguration.Lnbs {
ctor public HardwareConfiguration.Lnbs();
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.Lnb> getLnb();
}
public static class HardwareConfiguration.TimeFilters {
ctor public HardwareConfiguration.TimeFilters();
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.TimeFilter> getTimeFilter();
}
public class Lnb {
ctor public Lnb();
method @Nullable public String getId();
method @Nullable public String getName();
method @Nullable public android.media.tuner.testing.configuration.V1_0.LnbPositionEnum getPosition();
method @Nullable public android.media.tuner.testing.configuration.V1_0.LnbToneEnum getTone();
method @Nullable public android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum getVoltage();
method public void setId(@Nullable String);
method public void setName(@Nullable String);
method public void setPosition(@Nullable android.media.tuner.testing.configuration.V1_0.LnbPositionEnum);
method public void setTone(@Nullable android.media.tuner.testing.configuration.V1_0.LnbToneEnum);
method public void setVoltage(@Nullable android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum);
}
public enum LnbPositionEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbPositionEnum POSITION_A;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbPositionEnum POSITION_B;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbPositionEnum UNDEFINED;
}
public enum LnbToneEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbToneEnum CONTINUOUS;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbToneEnum NONE;
}
public enum LnbVoltageEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum NONE;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_11V;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_12V;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_13V;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_14V;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_15V;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_18V;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_19V;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_5V;
}
public class RecordFilterSettings {
ctor public RecordFilterSettings();
method @Nullable public android.media.tuner.testing.configuration.V1_0.ScIndexTypeEnum getScIndexType();
method @Nullable public java.math.BigInteger getTsIndexMask();
method public void setScIndexType(@Nullable android.media.tuner.testing.configuration.V1_0.ScIndexTypeEnum);
method public void setTsIndexMask(@Nullable java.math.BigInteger);
}
public enum ScIndexTypeEnum {
method @NonNull public String getRawName();
enum_constant public static final android.media.tuner.testing.configuration.V1_0.ScIndexTypeEnum NONE;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.ScIndexTypeEnum SC;
enum_constant public static final android.media.tuner.testing.configuration.V1_0.ScIndexTypeEnum SC_HEVC;
}
public class SectionFilterSettings {
ctor public SectionFilterSettings();
method @Nullable public boolean getIsCheckCrc();
method @Nullable public boolean getIsRaw();
method @Nullable public boolean getIsRepeat();
method public void setIsCheckCrc(@Nullable boolean);
method public void setIsRaw(@Nullable boolean);
method public void setIsRepeat(@Nullable boolean);
}
public class TimeFilter {
ctor public TimeFilter();
method @Nullable public String getId();
method @Nullable public java.math.BigInteger getTimeStamp();
method public void setId(@Nullable String);
method public void setTimeStamp(@Nullable java.math.BigInteger);
}
public class TunerConfiguration {
ctor public TunerConfiguration();
method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration getDataFlowConfiguration();

View File

@@ -60,16 +60,165 @@
connectToCicamId="0" frequency="578000" endFrequency="800000">
</frontend>
</frontends>
<!-- Filter section:
This section contains configurations of all the filters that would be used in the tests.
- This section is optional and can be skipped to use the default filter settings.
- The default settings can be found in the sample_tuner_vts_configurations.xml.
- The users can also override the default filter settings using
- id="FILTER_AUDIO_DEFAULT" or "FILTER_VIDEO_DEFAULT".
- The users can configure 1 or more filter elements in the filters sections.
Each filter element contain the following attributes:
"id": unique id of the filter that could be used to connect to the test the
"dataFlowConfiguration"
"mainType": the main filter type. The enums are defined in the xsd.
"subType": the sub filter type. The enums are defined in the xsd.
"bufferSize": the buffer size of the filter in hex.
"pid": the pid that would be used to configure the filter.
"useFMQ": if the filter uses FMQ.
Each filter element also contains at most one type-related "filterSettings".
- The settings type should match the filter "subType" attribute.
- For example, when filter subType is audio or video, the avFilterSettings can be
configured.
- This is optional and skipping the settings would pass a setting with tpid config
only to the hal.
-->
<filters>
<filter id="FILTER_AUDIO_DEFAULT" mainType="TS" subType="AUDIO"
bufferSize="16777216" pid="257" useFMQ="false">
<avFilterSettings isPassthrough="false"/>
</filter>
<filter id="FILTER_VIDEO_DEFAULT" mainType="TS" subType="VIDEO"
bufferSize="16777216" pid="256" useFMQ="false">
<avFilterSettings isPassthrough="false"/>
</filter>
<filter id="FILTER_TS_RECORD_0" mainType="TS" subType="RECORD"
bufferSize="16777216" pid="257" useFMQ="false">
<recordFilterSettings tsIndexMask="1" scIndexType="NONE"/>
</filter>
<filter id="FILTER_TS_SECTION_0" mainType="TS" subType="SECTION"
bufferSize="16777216" pid="257" useFMQ="true">
<sectionFilterSettings isCheckCrc="false" isRepeat="false" isRaw="false"/>
</filter>
<filter id="FILTER_TS_PCR_0" mainType="TS" subType="PCR"
bufferSize="16777216" pid="256" useFMQ="false">
</filter>
</filters>
<!-- Dvr section:
This section contains configurations of all the dvrs that would be used in the tests.
- This section is optional and can be skipped if DVR is not supported.
- The users can configure 1 or more dvr elements in the dvrs sections.
Each dvr element contain the following attributes:
"id": unique id of the dvr that could be used to connect to the test the
"dataFlowConfiguration"
"type": the dvr type.
"bufferSize": the dvr buffer size.
"statusMask": register callbacks of specific status.
"lowThreshold": the dvr status low threshold.
"highThreshold": the dvr status high threshold.
"dataFormat": the dvr data format.
"packetSize": the dvr packet size.
"inputFilePath": the dvr playback input file path. Only required in playback dvr.
-->
<dvrs>
<dvr id="DVR_PLAYBACK_0" type="PLAYBACK" bufferSize="4194304"
statusMask="15" lowThreshold="4096" highThreshold="32767"
dataFormat="TS" packetSize="188" inputFilePath="/data/local/tmp/segment000000.ts"/>
<dvr id="DVR_RECORD_0" type="RECORD" bufferSize="4194304"
statusMask="15" lowThreshold="4096" highThreshold="32767"
dataFormat="TS" packetSize="188"/>
<dvr id="DVR_PLAYBACK_1" type="PLAYBACK" bufferSize="4194304"
statusMask="15" lowThreshold="4096" highThreshold="32767"
dataFormat="ES" packetSize="188" inputFilePath="/data/local/tmp/test.es"/>
</dvrs>
<!-- Lnb section:
This section contains configurations of all the lnbs that would be used in the tests.
- This section is optional and can be skipped if LNB is not supported.
- The users can configure 1 or more lnb elements in the lnbs sections.
Each lnb element contain the following attributes:
"id": unique id of the lnb that could be used to connect to the test the
"dataFlowConfiguration"
"name": the external lnb device name.
"voltage": the voltage used to config the lnb.
"tone": the voltage used to config the lnb.
"position": the voltage used to config the lnb.
-->
<diseqcMessages>
<diseqcMessage msgName="DISEQC_POWER_ON" msgBody="14 0 0 0 0 3"/>
</diseqcMessages>
<lnbs>
<lnb id="LNB_0" voltage="VOLTAGE_12V" tone="NONE" position="UNDEFINED"/>
<lnb id="LNB_1" name="default_lnb_external" voltage="VOLTAGE_5V"
tone="NONE" position="UNDEFINED"/>
</lnbs>
<!-- TimeFilter section:
This section contains configurations of all the time filters that would be used in
the tests.
- This section is optional and can be skipped if Time Filter is not supported.
- The users can configure 1 or more timeFilter elements in the timeFilters sections.
Each timeFilter element contain the following attributes:
"id": unique id of the time filter that could be used to connect to the test the
"dataFlowConfiguration"
"timeStamp": the time stamp used to config the time filter.
-->
<timeFilters>
<timeFilter id="TIME_FILTER_0" timeStamp="1"/>
</timeFilters>
<!-- Descrambler section:
This section contains configurations of all the descramblers that would be used in
the tests.
- This section is optional and can be skipped if Descrambler is not supported.
- The users can configure 1 or more descrambler elements in the descramblers sections.
Each Descrambler element contain the following attributes:
"id": unique id of the descrambler that could be used to connect to the test the
"dataFlowConfiguration"
"casSystemId": the cas system id to connect to the descrambler.
"provisionStr": the provision string to use with the cas plugin.
"sesstionPrivatData": the session private data used to open the cas session.
-->
<descramblers>
<descrambler id="DESCRAMBLER_0" casSystemId="63192"/>
</descramblers>
</hardwareConfiguration>
<!-- Data flow configuration section connects each data flow under test to the ids of the
hardwares that would be used during the tests. -->
<dataFlowConfiguration>
<clearLiveBroadcast frontendConnection="FE_DEFAULT"/>
<clearLiveBroadcast frontendConnection="FE_DEFAULT"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
pcrFilterConnection="FILTER_TS_PCR_0"
sectionFilterConnection="FILTER_TS_SECTION_0"
dvrSoftwareFeConnection="DVR_PLAYBACK_0"/>
<scan frontendConnection="FE_DEFAULT"/>
<descrambling frontendConnection="FE_DEFAULT"/>
<dvrRecord frontendConnection="FE_DEFAULT"/>
<lnbLive frontendConnection="FE_DVBS_0"/>
<lnbRecord frontendConnection="FE_DVBS_0"/>
<descrambling frontendConnection="FE_DEFAULT"
descramblerConnection="DESCRAMBLER_0"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
dvrSoftwareFeConnection="DVR_PLAYBACK_0"/>
<dvrPlayback dvrConnection="DVR_PLAYBACK_0"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
sectionFilterConnection="FILTER_TS_SECTION_0"/>
<dvrRecord frontendConnection="FE_DEFAULT"
recordFilterConnection="FILTER_TS_RECORD_0"
dvrRecordConnection="DVR_RECORD_0"
dvrSoftwareFeConnection="DVR_PLAYBACK_0"/>
<lnbLive frontendConnection="FE_DVBS_0"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
lnbConnection="LNB_1"
diseqcMsgSender="DISEQC_POWER_ON"/>
<lnbRecord frontendConnection="FE_DVBS_0"
recordFilterConnection="FILTER_TS_RECORD_0"
dvrRecordConnection="DVR_RECORD_0"
lnbConnection="LNB_0"
diseqcMsgSender="DISEQC_POWER_ON"/>
<timeFilter timeFilterConnection="TIME_FILTER_0"/>
</dataFlowConfiguration>
</TunerConfiguration>

View File

@@ -85,7 +85,7 @@
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="1">
<!-- TODO: finish all the frontend settings structures. -->
<!-- TODO: b/182519645 finish all the frontend settings structures. -->
<!--xs:element name="analog" type="analogSettings"/>
<xs:element name="atsc" type="atscSettings"/>
<xs:element name="atsc3" type="atsc3Settings"/>
@@ -99,14 +99,307 @@
</xs:choice>
<xs:attribute name="id" type="frontendId" use="required"/>
<xs:attribute name="type" type="frontendTypeEnum" use="required"/>
<xs:attribute name="isSoftwareFrontend" type="xs:boolean" use="required"/>
<!-- A dvr connection is required in the data flow config section when
"isSoftwareFrontend" is true. -->
<xs:attribute name="isSoftwareFrontend" type="xs:boolean" use="required"/>
<xs:attribute name="frequency" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="connectToCicamId" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="endFrequency" type="xs:nonNegativeInteger" use="optional"/>
</xs:complexType>
<!-- FILTER SESSION -->
<xs:simpleType name="filterId">
<!-- Filter id must be either FILTER_AUDIO_DEFAULT or FILTER_VIDEO_DEFAULT
or FILTER_MAINTYPE_SUBTYPE_NUM
<filter id="FILTER_TS_AUDIO_0"/>
-->
<xs:restriction base="xs:string">
<xs:pattern value="FILTER_AUDIO_DEFAULT|FILTER_VIDEO_DEFAULT|FILTER_[A-Z]+_[A-Z]+_[0-9]+"/>
</xs:restriction>
</xs:simpleType>
<!-- A list of filter ids that could be used in the data flow configurations to connect
filters under testing. -->
<xs:simpleType name="filterConnections">
<xs:list itemType="filterId" />
</xs:simpleType>
<!-- DemuxFilterRecordSettings::tsIndexMask -->
<xs:simpleType name="tsIndexMask">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="8191"/>
</xs:restriction>
</xs:simpleType>
<!-- DemuxFilterRecordSettings::scIndexType -->
<xs:simpleType name="scIndexTypeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="NONE" />
<xs:enumeration value="SC" />
<xs:enumeration value="SC_HEVC"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="filterMainTypeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="TS" />
<xs:enumeration value="MMTP" />
<!-- TODO: b/182519645 Support IP/TLV/ALP filter config
<xs:enumeration value="IP"/>
<xs:enumeration value="TLV"/>
<xs:enumeration value="ALP"/-->
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="filterSubTypeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="UNDEFINED" />
<xs:enumeration value="SECTION" />
<xs:enumeration value="PES" />
<xs:enumeration value="TS"/>
<xs:enumeration value="AUDIO"/>
<xs:enumeration value="VIDEO"/>
<xs:enumeration value="PCR"/>
<xs:enumeration value="RECORD"/>
<xs:enumeration value="TEMI"/>
<xs:enumeration value="MMTP"/>
<xs:enumeration value="DOWNLOAD"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="avFilterSettings">
<xs:attribute name="isPassthrough" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="sectionFilterSettings">
<xs:attribute name="isCheckCrc" type="xs:boolean" use="required"/>
<xs:attribute name="isRepeat" type="xs:boolean" use="required"/>
<xs:attribute name="isRaw" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="recordFilterSettings">
<xs:attribute name="tsIndexMask" type="tsIndexMask" use="required"/>
<xs:attribute name="scIndexType" type="scIndexTypeEnum" use="required"/>
</xs:complexType>
<xs:complexType name="filter">
<xs:annotation>
<xs:documentation>
Each filter element contain the following attributes:
"id": unique id of the filter that could be used to connect to the test the
"dataFlowConfiguration"
"mainType": the main filter type. The enums are defined in the xsd.
"subType": the sub filter type. The enums are defined in the xsd.
"bufferSize": the buffer size of the filter in hex.
"pid": the pid that would be used to configure the filter.
"useFMQ": if the filter uses FMQ.
Each filter element also contains at most one type-related "filterSettings".
- The settings type should match the filter "subType" attribute.
- For example, when filter subType is audio or video, the avFilterSettings
can be configured.
- This is optional and skipping the settings would pass a setting with tpid
config only to the hal.
</xs:documentation>
</xs:annotation>
<xs:choice minOccurs="0" maxOccurs="1">
<!-- TODO: b/182519645 finish all the filter settings structures. -->
<xs:element name="sectionFilterSettings" type="sectionFilterSettings"/>
<xs:element name="avFilterSettings" type="avFilterSettings"/>
<xs:element name="recordFilterSettings" type="recordFilterSettings"/>
<!--xs:element name="pes" type="pesFilterSettings"/>
<xs:element name="download" type="downloadFilterSettings"/-->
</xs:choice>
<xs:attribute name="id" type="filterId" use="required"/>
<xs:attribute name="mainType" type="filterMainTypeEnum" use="required"/>
<xs:attribute name="subType" type="filterSubTypeEnum" use="required"/>
<xs:attribute name="bufferSize" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="pid" type="xs:nonNegativeInteger" use="optional"/>
<xs:attribute name="useFMQ" type="xs:boolean" use="required"/>
</xs:complexType>
<!-- DVR SESSION -->
<xs:simpleType name="dvrId">
<!-- Dvr id must be DVR_TYPE_NUM. <dvr id="DVR_PLAYBACK_0"/> -->
<xs:restriction base="xs:string">
<xs:pattern value="DVR_RECORD_[0-9]+|DVR_PLAYBACK_[0-9]+"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="dvrStatusMask">
<!-- Dvr status mask must masking the <dvrStatusEnum> -->
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="15"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="dvrStatusEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="DATA_READY" />
<xs:enumeration value="LOW_WATER" />
<xs:enumeration value="HIGH_WATER" />
<xs:enumeration value="OVERFLOW" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="dvrTypeEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="PLAYBACK" />
<xs:enumeration value="RECORD" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="dvrDataFormatEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="TS" />
<xs:enumeration value="PES" />
<xs:enumeration value="ES" />
<xs:enumeration value="SHV_TLV" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="dvr">
<xs:annotation>
<xs:documentation>
Each dvr element contain the following attributes:
"id": unique id of the dvr that could be used to connect to the test the
"dataFlowConfiguration"
"type": the dvr type.
"bufferSize": the dvr buffer size.
"statusMask": register callbacks of specific status.
"lowThreshold": the dvr status low threshold.
"highThreshold": the dvr status high threshold.
"dataFormat": the dvr data format.
"packetSize": the dvr packet size.
"inputFilePath": the dvr playback input file path. Only required in playback
dvr.
</xs:documentation>
</xs:annotation>
<xs:attribute name="id" type="dvrId" use="required"/>
<xs:attribute name="type" type="dvrTypeEnum" use="required"/>
<xs:attribute name="bufferSize" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="statusMask" type="dvrStatusMask" use="required"/>
<xs:attribute name="lowThreshold" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="highThreshold" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="dataFormat" type="dvrDataFormatEnum" use="required"/>
<xs:attribute name="packetSize" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="inputFilePath" type="xs:anyURI" use="optional"/>
</xs:complexType>
<!-- LNB SESSION -->
<xs:simpleType name="lnbId">
<!-- Lnb id must be LNB_NUM: <lnb id="LNB_10"/> -->
<xs:restriction base="xs:string">
<xs:pattern value="LNB_[0-9]+"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="lnbVoltageEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="NONE" />
<xs:enumeration value="VOLTAGE_5V" />
<xs:enumeration value="VOLTAGE_11V" />
<xs:enumeration value="VOLTAGE_12V"/>
<xs:enumeration value="VOLTAGE_13V"/>
<xs:enumeration value="VOLTAGE_14V"/>
<xs:enumeration value="VOLTAGE_15V"/>
<xs:enumeration value="VOLTAGE_18V"/>
<xs:enumeration value="VOLTAGE_19V"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="lnbToneEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="NONE" />
<xs:enumeration value="CONTINUOUS" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="lnbPositionEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="UNDEFINED" />
<xs:enumeration value="POSITION_A" />
<xs:enumeration value="POSITION_B" />
</xs:restriction>
</xs:simpleType>
<!-- Diseqc Messages that would be used to send to the lnb under test. -->
<xs:simpleType name="diseqcMsgName">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z_]+"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="diseqcMsgBody">
<xs:list itemType="xs:unsignedByte"/>
</xs:simpleType>
<xs:complexType name="diseqcMessage">
<xs:attribute name="msgName" type="diseqcMsgName"/>
<xs:attribute name="msgBody" type="diseqcMsgBody"/>
</xs:complexType>
<xs:simpleType name="diseqcMsgSender">
<xs:list itemType="diseqcMsgName"/>
</xs:simpleType>
<xs:complexType name="lnb">
<xs:annotation>
<xs:documentation>
Each lnb element contain the following attributes:
"id": unique id of the lnb that could be used to connect to the test the
"dataFlowConfiguration"
"name": the external lnb device name.
"voltage": the voltage used to config the lnb.
"tone": the voltage used to config the lnb.
"position": the voltage used to config the lnb.
</xs:documentation>
</xs:annotation>
<xs:attribute name="id" type="lnbId" use="required"/>
<!-- Only required on external lnb with no device id. -->
<xs:attribute name="name" type="xs:string" use="optional"/>
<xs:attribute name="voltage" type="lnbVoltageEnum" use="required"/>
<xs:attribute name="tone" type="lnbToneEnum" use="required"/>
<xs:attribute name="position" type="lnbPositionEnum" use="required"/>
</xs:complexType>
<!-- TIME FILTER SESSION -->
<xs:simpleType name="timeFilterId">
<!-- Time Filter id must be TIME_FILTER_NUM: <timeFilter id="TIME_FILTER_1"/> -->
<xs:restriction base="xs:string">
<xs:pattern value="TIME_FILTER_[0-9]+"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="timeFilter">
<xs:annotation>
<xs:documentation>
Each timeFilter element contain the following attributes:
"id": unique id of the time filter that could be used to connect to the test the
"dataFlowConfiguration"
"timeStamp": the time stamp used to config the time filter.
</xs:documentation>
</xs:annotation>
<xs:attribute name="id" type="timeFilterId" use="required"/>
<xs:attribute name="timeStamp" type="xs:nonNegativeInteger" use="required"/>
</xs:complexType>
<!-- DESCRAMBLER SESSION -->
<xs:simpleType name="descramblerId">
<!-- Descrambler id must be DESCRAMBLER_NUM: <descrambler id="DESCRAMBLER_2"/> -->
<xs:restriction base="xs:string">
<xs:pattern value="DESCRAMBLER_[0-9]+"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sessionPrivateData">
<xs:list itemType="xs:unsignedByte"/>
</xs:simpleType>
<xs:complexType name="descrambler">
<xs:annotation>
<xs:documentation>
Each descrambler element contain the following attributes:
"id": unique id of the descrambler that could be used to connect to the test the
"dataFlowConfiguration"
"casSystemId": the cas system id to connect to the descrambler.
"provisionStr": the provision string to use with the cas plugin.
"sesstionPrivatData": the session private data used to open the cas session.
</xs:documentation>
</xs:annotation>
<xs:attribute name="id" type="descramblerId" use="required"/>
<xs:attribute name="casSystemId" type="xs:nonNegativeInteger" use="required"/>
<xs:attribute name="provisionStr" type="xs:string" use="required"/>
<xs:attribute name="sesstionPrivatData" type="sessionPrivateData" use="optional"/>
</xs:complexType>
<!-- HARDWARE CONFIGURATION SESSION -->
<xs:complexType name="hardwareConfiguration">
<xs:sequence>
@@ -131,6 +424,110 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="filters" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:annotation>
<xs:documentation xml:lang="en">
This section contains configurations of all the filters that would be
used in the tests.
- This section is optional and can be skipped to use the default
filter settings.
- The default settings can be found in the
sample_tuner_vts_configurations.xml.
- The users can also override the default filter settings using
- id="FILTER_AUDIO_DEFAULT" or "FILTER_VIDEO_DEFAULT".
- The users can configure 1 or more filter elements in the filters
sections.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="filter" type="filter" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="dvrs" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:annotation>
<xs:documentation xml:lang="en">
This section contains configurations of all the dvrs that would be used
in the tests.
- This section is optional and can be skipped if the device does
not support dvr.
- The users can configure 1 or more dvr elements in the dvrs
sections.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="dvr" type="dvr" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="diseqcMessages" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:annotation>
<xs:documentation xml:lang="en">
This section contains configurations of all the diseqc messages that
would be used in the lnb tests.
- This section is optional and can be skipped if lnb is not suppoted
- The users can configure 1 or more message elements in the
diseqcMessages sections.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="diseqcMessage" type="diseqcMessage" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="lnbs" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:annotation>
<xs:documentation xml:lang="en">
This section contains configurations of all the lnbs that would be used
in the tests.
- This section is optional and can be skipped if lnb is not suppoted
- The users can configure 1 or more lnb elements in the lnbs
sections.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="lnb" type="lnb" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="timeFilters" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:annotation>
<xs:documentation xml:lang="en">
This section contains configurations of all the time filters that would
be used in the tests.
- This section is optional and can be skipped if time filter is
not supported.
- The users can configure 1 or more time filter elements in the
time filters sections.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="timeFilter" type="timeFilter" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="descramblers" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:annotation>
<xs:documentation xml:lang="en">
This section contains configurations of all the descramblers that would
be used in the tests.
- This section is optional and can be skipped if descrambling is not
supported.
- The users can configure 1 or more descrambler elements in the
descramblers sections.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="descrambler" type="descrambler" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
@@ -139,8 +536,14 @@
<xs:sequence>
<xs:element name="clearLiveBroadcast" minOccurs="1" maxOccurs="1">
<xs:complexType>
<!-- TODO: add optional dvr config for software input -->
<xs:attribute name="frontendConnection" type="frontendId" use="required"/>
<xs:attribute name="audioFilterConnection" type="filterId" use="required"/>
<xs:attribute name="videoFilterConnection" type="filterId" use="required"/>
<xs:attribute name="pcrFilterConnection" type="filterId" use="optional"/>
<xs:attribute name="sectionFilterConnection" type="filterId" use="optional"/>
<!-- TODO: b/182519645 allow the users to insert extra filters -->
<!-- DVR is only required when the frontend is using the software input -->
<xs:attribute name="dvrSoftwareFeConnection" type="dvrId" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="scan" minOccurs="1" maxOccurs="1">
@@ -151,21 +554,54 @@
<xs:element name="descrambling" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="frontendConnection" type="frontendId" use="required"/>
<xs:attribute name="descramblerConnection" type="descramblerId" use="required"/>
<xs:attribute name="audioFilterConnection" type="filterId" use="required"/>
<xs:attribute name="videoFilterConnection" type="filterId" use="required"/>
<!-- TODO: b/182519645 allow the users to insert extra filters -->
<!-- DVR is only required when the frontend is using the software input -->
<xs:attribute name="dvrSoftwareFeConnection" type="dvrId" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="dvrPlayback" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="dvrConnection" type="dvrId" use="required"/>
<xs:attribute name="audioFilterConnection" type="filterId" use="required"/>
<xs:attribute name="videoFilterConnection" type="filterId" use="required"/>
<xs:attribute name="sectionFilterConnection" type="filterId" use="optional"/>
<!-- TODO: b/182519645 allow the users to insert extra filters -->
</xs:complexType>
</xs:element>
<xs:element name="dvrRecord" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="frontendConnection" type="frontendId" use="required"/>
<xs:attribute name="dvrRecordConnection" type="dvrId" use="required"/>
<!-- DVR is only required when the frontend is using the software input -->
<xs:attribute name="dvrSoftwareFeConnection" type="dvrId" use="optional"/>
<xs:attribute name="recordFilterConnection" type="filterId" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="lnbLive" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="frontendConnection" type="frontendId" use="required"/>
<xs:attribute name="audioFilterConnection" type="filterId" use="required"/>
<xs:attribute name="videoFilterConnection" type="filterId" use="required"/>
<xs:attribute name="lnbConnection" type="lnbId" use="required"/>
<xs:attribute name="diseqcMsgSender" type="diseqcMsgSender" use="optional"/>
<!-- TODO: b/182519645 allow the users to insert extra filters -->
</xs:complexType>
</xs:element>
<xs:element name="lnbRecord" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="frontendConnection" type="frontendId" use="required"/>
<xs:attribute name="recordFilterConnection" type="filterId" use="required"/>
<xs:attribute name="dvrRecordConnection" type="dvrId" use="required"/>
<xs:attribute name="lnbConnection" type="lnbId" use="required"/>
<xs:attribute name="diseqcMsgSender" type="diseqcMsgSender" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="timeFilter" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="timeFilterConnection" type="timeFilterId" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
@@ -184,5 +620,25 @@
<xs:selector xpath="hardwareConfiguration/frontends/frontend"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:key name="filterIdUniqueness">
<xs:selector xpath="hardwareConfiguration/filters/filter"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:key name="dvrIdUniqueness">
<xs:selector xpath="hardwareConfiguration/dvrs/dvr"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:key name="lnbIdUniqueness">
<xs:selector xpath="hardwareConfiguration/lnbs/lnb"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:key name="timeFilterIdUniqueness">
<xs:selector xpath="hardwareConfiguration/timeFilters/timeFilter"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:key name="descramblerIdUniqueness">
<xs:selector xpath="hardwareConfiguration/descramblers/descrambler"/>
<xs:field xpath="@id"/>
</xs:key>
</xs:element>
</xs:schema>