Merge changes Ie7733750,I4f733091,Iaa216876

* changes:
  Improve Tuner VTS Configuration
  Improve Tuner VTS Configuration: Enable Lnb, LnbRecord, and LnbLive configuration
  Improve Tuner VTS Configuration: Enable Descrambling
This commit is contained in:
Frankie Lizcano 2022-07-02 00:06:38 +00:00 committed by Android (Google) Code Review
commit 7fa68f5141
5 changed files with 172 additions and 6 deletions

View file

@ -37,6 +37,9 @@ bool initConfiguration() {
initFilterConfig();
initDvrConfig();
initTimeFilterConfig();
initDescramblerConfig();
initLnbConfig();
initDiseqcMsgsConfig();
connectHardwaresToTestCases();
if (!validateConnections()) {
ALOGW("[vts] failed to validate connections.");

View file

@ -167,12 +167,31 @@ inline void initTimeFilterConfig() {
TunerTestingConfigAidlReader1_0::readTimeFilterConfig1_0(timeFilterMap);
};
inline void initDescramblerConfig() {
// Read customized config
TunerTestingConfigAidlReader1_0::readDescramblerConfig1_0(descramblerMap);
}
inline void initLnbConfig() {
// Read customized config
TunerTestingConfigAidlReader1_0::readLnbConfig1_0(lnbMap);
};
inline void initDiseqcMsgsConfig() {
// Read customized config
TunerTestingConfigAidlReader1_0::readDiseqcMessages(diseqcMsgMap);
};
/** Read the vendor configurations of which hardware to use for each test cases/data flows */
inline void connectHardwaresToTestCases() {
TunerTestingConfigAidlReader1_0::connectLiveBroadcast(live);
TunerTestingConfigAidlReader1_0::connectScan(scan);
TunerTestingConfigAidlReader1_0::connectDvrRecord(record);
TunerTestingConfigAidlReader1_0::connectTimeFilter(timeFilter);
TunerTestingConfigAidlReader1_0::connectDescrambling(descrambling);
TunerTestingConfigAidlReader1_0::connectLnbLive(lnbLive);
TunerTestingConfigAidlReader1_0::connectLnbRecord(lnbRecord);
TunerTestingConfigAidlReader1_0::connectDvrPlayback(playback);
};
inline bool validateConnections() {
@ -189,6 +208,14 @@ inline bool validateConnections() {
feIsValid &= record.support && record.hasFrontendConnection
? frontendMap.find(record.frontendId) != frontendMap.end()
: true;
feIsValid &= descrambling.support && descrambling.hasFrontendConnection
? frontendMap.find(descrambling.frontendId) != frontendMap.end()
: true;
feIsValid &= lnbLive.support ? frontendMap.find(lnbLive.frontendId) != frontendMap.end() : true;
feIsValid &=
lnbRecord.support ? frontendMap.find(lnbRecord.frontendId) != frontendMap.end() : true;
if (!feIsValid) {
ALOGW("[vts config] dynamic config fe connection is invalid.");
@ -210,6 +237,20 @@ inline bool validateConnections() {
dvrIsValid &= dvrMap.find(record.dvrRecordId) != dvrMap.end();
}
if (descrambling.support) {
if (descrambling.hasFrontendConnection) {
if (frontendMap[descrambling.frontendId].isSoftwareFe) {
dvrIsValid &= dvrMap.find(descrambling.dvrSoftwareFeId) != dvrMap.end();
}
} else {
dvrIsValid &= dvrMap.find(descrambling.dvrSourceId) != dvrMap.end();
}
}
dvrIsValid &= lnbRecord.support ? dvrMap.find(lnbRecord.dvrRecordId) != dvrMap.end() : true;
dvrIsValid &= playback.support ? dvrMap.find(playback.dvrId) != dvrMap.end() : true;
if (!dvrIsValid) {
ALOGW("[vts config] dynamic config dvr connection is invalid.");
return false;
@ -222,6 +263,44 @@ inline bool validateConnections() {
filterIsValid &=
record.support ? filterMap.find(record.recordFilterId) != filterMap.end() : true;
filterIsValid &= descrambling.support
? filterMap.find(descrambling.videoFilterId) != filterMap.end() &&
filterMap.find(descrambling.audioFilterId) != filterMap.end()
: true;
for (auto& filterId : descrambling.extraFilters) {
filterIsValid &= filterMap.find(filterId) != filterMap.end();
}
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;
for (auto& filterId : lnbRecord.extraFilters) {
filterIsValid &= filterMap.find(filterId) != filterMap.end();
}
for (auto& filterId : lnbLive.extraFilters) {
filterIsValid &= filterMap.find(filterId) != filterMap.end();
}
filterIsValid &= playback.support
? filterMap.find(playback.audioFilterId) != filterMap.end() &&
filterMap.find(playback.videoFilterId) != filterMap.end()
: true;
filterIsValid &= playback.sectionFilterId.compare(emptyHardwareId) == 0
? true
: filterMap.find(playback.sectionFilterId) != filterMap.end();
for (auto& filterId : playback.extraFilters) {
filterIsValid &=
playback.hasExtraFilters ? filterMap.find(filterId) != filterMap.end() : true;
}
if (!filterIsValid) {
ALOGW("[vts config] dynamic config filter connection is invalid.");
return false;
@ -233,6 +312,39 @@ inline bool validateConnections() {
if (!timeFilterIsValid) {
ALOGW("[vts config] dynamic config time filter connection is invalid.");
}
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 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 diseqcMsgsIsValid = true;
for (auto& msg : lnbRecord.diseqcMsgs) {
diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end();
}
for (auto& msg : lnbLive.diseqcMsgs) {
diseqcMsgsIsValid &= diseqcMsgMap.find(msg) != diseqcMsgMap.end();
}
if (!diseqcMsgsIsValid) {
ALOGW("[vts config] dynamic config diseqcMsg is invalid.");
return false;
}

View file

@ -146,12 +146,13 @@ struct ScanHardwareConnections {
struct DvrPlaybackHardwareConnections {
bool support;
bool hasExtraFilters = false;
string frontendId;
string dvrId;
string audioFilterId;
string videoFilterId;
string sectionFilterId;
/* list string of extra filters; */
vector<string> extraFilters;
};
struct DvrRecordHardwareConnections {
@ -173,7 +174,7 @@ struct DescramblingHardwareConnections {
string videoFilterId;
string descramblerId;
string dvrSourceId;
/* list string of extra filters; */
vector<string> extraFilters;
};
struct LnbLiveHardwareConnections {
@ -183,7 +184,7 @@ struct LnbLiveHardwareConnections {
string videoFilterId;
string lnbId;
vector<string> diseqcMsgs;
/* list string of extra filters; */
vector<string> extraFilters;
};
struct LnbRecordHardwareConnections {
@ -193,7 +194,7 @@ struct LnbRecordHardwareConnections {
string recordFilterId;
string lnbId;
vector<string> diseqcMsgs;
/* list string of extra filters; */
vector<string> extraFilters;
};
struct TimeFilterHardwareConnections {
@ -534,6 +535,13 @@ struct TunerTestingConfigAidlReader1_0 {
} else {
playback.sectionFilterId = emptyHardwareId;
}
if (playbackConfig.hasOptionalFilters() && !playback.hasExtraFilters) {
auto optionalFilters = playbackConfig.getFirstOptionalFilters()->getOptionalFilter();
for (size_t i = 0; i < optionalFilters.size(); ++i) {
playback.extraFilters.push_back(optionalFilters[i].getFilterId());
}
playback.hasExtraFilters = true;
}
}
static void connectDvrRecord(DvrRecordHardwareConnections& record) {
@ -583,6 +591,10 @@ struct TunerTestingConfigAidlReader1_0 {
descrambling.hasFrontendConnection = false;
descrambling.dvrSourceId = descConfig.getDvrSourceConnection();
}
if (descConfig.hasOptionalFilters()) {
auto optionalFilters = descConfig.getOptionalFilters();
descrambling.extraFilters = optionalFilters;
}
}
static void connectLnbLive(LnbLiveHardwareConnections& lnbLive) {
@ -603,6 +615,10 @@ struct TunerTestingConfigAidlReader1_0 {
lnbLive.diseqcMsgs.push_back(msgName);
}
}
if (lnbLiveConfig.hasOptionalFilters()) {
auto optionalFilters = lnbLiveConfig.getOptionalFilters();
lnbLive.extraFilters = optionalFilters;
}
}
static void connectLnbRecord(LnbRecordHardwareConnections& lnbRecord) {
@ -623,6 +639,10 @@ struct TunerTestingConfigAidlReader1_0 {
lnbRecord.diseqcMsgs.push_back(msgName);
}
}
if (lnbRecordConfig.hasOptionalFilters()) {
auto optionalFilters = lnbRecordConfig.getOptionalFilters();
lnbRecord.extraFilters = optionalFilters;
}
}
static void connectTimeFilter(TimeFilterHardwareConnections& timeFilter) {

View file

@ -67,6 +67,7 @@ package android.media.tuner.testing.configuration.V1_0 {
method @Nullable public String getDvrSourceConnection();
method @Nullable public String getFrontendConnection();
method @Nullable public boolean getHasFrontendConnection();
method @Nullable public java.util.List<java.lang.String> getOptionalFilters();
method @Nullable public String getVideoFilterConnection();
method public void setAudioFilterConnection(@Nullable String);
method public void setDescramblerConnection(@Nullable String);
@ -74,6 +75,7 @@ package android.media.tuner.testing.configuration.V1_0 {
method public void setDvrSourceConnection(@Nullable String);
method public void setFrontendConnection(@Nullable String);
method public void setHasFrontendConnection(@Nullable boolean);
method public void setOptionalFilters(@Nullable java.util.List<java.lang.String>);
method public void setVideoFilterConnection(@Nullable String);
}
@ -81,14 +83,21 @@ package android.media.tuner.testing.configuration.V1_0 {
ctor public DataFlowConfiguration.DvrPlayback();
method @Nullable public String getAudioFilterConnection();
method @Nullable public String getDvrConnection();
method @Nullable public android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrPlayback.OptionalFilters getOptionalFilters();
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 setOptionalFilters(@Nullable android.media.tuner.testing.configuration.V1_0.DataFlowConfiguration.DvrPlayback.OptionalFilters);
method public void setSectionFilterConnection(@Nullable String);
method public void setVideoFilterConnection(@Nullable String);
}
public static class DataFlowConfiguration.DvrPlayback.OptionalFilters {
ctor public DataFlowConfiguration.DvrPlayback.OptionalFilters();
method @Nullable public java.util.List<android.media.tuner.testing.configuration.V1_0.OptionalFilter> getOptionalFilter();
}
public static class DataFlowConfiguration.DvrRecord {
ctor public DataFlowConfiguration.DvrRecord();
method @Nullable public String getDvrRecordConnection();
@ -111,11 +120,13 @@ package android.media.tuner.testing.configuration.V1_0 {
method @Nullable public java.util.List<java.lang.String> getDiseqcMsgSender();
method @Nullable public String getFrontendConnection();
method @Nullable public String getLnbConnection();
method @Nullable public java.util.List<java.lang.String> getOptionalFilters();
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 setOptionalFilters(@Nullable java.util.List<java.lang.String>);
method public void setVideoFilterConnection(@Nullable String);
}
@ -125,11 +136,13 @@ package android.media.tuner.testing.configuration.V1_0 {
method @Nullable public String getDvrRecordConnection();
method @Nullable public String getFrontendConnection();
method @Nullable public String getLnbConnection();
method @Nullable public java.util.List<java.lang.String> getOptionalFilters();
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 setOptionalFilters(@Nullable java.util.List<java.lang.String>);
method public void setRecordFilterConnection(@Nullable String);
}
@ -522,6 +535,12 @@ package android.media.tuner.testing.configuration.V1_0 {
enum_constant public static final android.media.tuner.testing.configuration.V1_0.LnbVoltageEnum VOLTAGE_5V;
}
public class OptionalFilter {
ctor public OptionalFilter();
method @Nullable public String getFilterId();
method public void setFilterId(@Nullable String);
}
public class RecordFilterSettings {
ctor public RecordFilterSettings();
method @Nullable public android.media.tuner.testing.configuration.V1_0.ScIndexTypeEnum getScIndexType();

View file

@ -666,6 +666,7 @@
<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 -->
<xs:element name="optionalFilters" type="filterConnections" minOccurs="0" maxOccurs="1"/>
<!-- This DVR is only required when the frontend is using the software input -->
<xs:attribute name="dvrSoftwareFeConnection" type="dvrId" use="optional"/>
<!-- This Dvr is only required when there's no frontend(sw or hw) connection -->
@ -678,7 +679,14 @@
<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:element name="optionalFilters" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="optionalFilter" type="optionalFilter" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--TODO: b/182519645 allow the users to insert extra filters/-->
</xs:complexType>
</xs:element>
<xs:element name="dvrRecord" minOccurs="0" maxOccurs="1">
@ -702,7 +710,7 @@
<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:element name="optionalFilters" type="filterConnections" minOccurs="0" maxOccurs="1"/>
</xs:complexType>
</xs:element>
<xs:element name="lnbRecord" minOccurs="0" maxOccurs="1">
@ -712,6 +720,7 @@
<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:element name="optionalFilters" type="filterConnections" minOccurs="0" maxOccurs="1"/>
</xs:complexType>
</xs:element>
<xs:element name="timeFilter" minOccurs="0" maxOccurs="1">
@ -756,4 +765,7 @@
<xs:field xpath="@id"/>
</xs:key>
</xs:element>
<xs:complexType name="optionalFilter">
<xs:attribute name="filterId" type="filterId" use="required"/>
</xs:complexType>
</xs:schema>