Allow users to switch between FE source and DVR source when testing
record/descrambling/broadcast
Test: atest VtsHalTvTunerV1_0TargetTest
Test: atest VtsHalTvTunerV1_1TargetTest
Bug: 182519645
CTS-Coverage-Bug: 184077478
Change-Id: I6c57657ac3539d6a6fb3f63d2ecc9af7f6b9e2dc
diff --git a/tv/tuner/config/TunerTestingConfigReaderV1_0.h b/tv/tuner/config/TunerTestingConfigReaderV1_0.h
index cff4af1..f7f72b0 100644
--- a/tv/tuner/config/TunerTestingConfigReaderV1_0.h
+++ b/tv/tuner/config/TunerTestingConfigReaderV1_0.h
@@ -123,6 +123,7 @@
};
struct LiveBroadcastHardwareConnections {
+ bool hasFrontendConnection;
string frontendId;
string dvrSoftwareFeId;
string audioFilterId;
@@ -134,6 +135,7 @@
};
struct ScanHardwareConnections {
+ bool hasFrontendConnection;
string frontendId;
};
@@ -149,19 +151,23 @@
struct DvrRecordHardwareConnections {
bool support;
+ bool hasFrontendConnection;
string frontendId;
string dvrRecordId;
string dvrSoftwareFeId;
string recordFilterId;
+ string dvrSourceId;
};
struct DescramblingHardwareConnections {
bool support;
+ bool hasFrontendConnection;
string frontendId;
string dvrSoftwareFeId;
string audioFilterId;
string videoFilterId;
string descramblerId;
+ string dvrSourceId;
/* list string of extra filters; */
};
@@ -402,7 +408,14 @@
}
static void connectLiveBroadcast(LiveBroadcastHardwareConnections& live) {
- auto liveConfig = *getDataFlowConfiguration().getFirstClearLiveBroadcast();
+ auto dataFlow = getDataFlowConfiguration();
+ if (dataFlow.hasClearLiveBroadcast()) {
+ live.hasFrontendConnection = true;
+ } else {
+ live.hasFrontendConnection = false;
+ return;
+ }
+ auto liveConfig = *dataFlow.getFirstClearLiveBroadcast();
live.frontendId = liveConfig.getFrontendConnection();
live.audioFilterId = liveConfig.getAudioFilterConnection();
@@ -428,8 +441,15 @@
}
static void connectScan(ScanHardwareConnections& scan) {
- auto scanConfig = getDataFlowConfiguration().getFirstScan();
- scan.frontendId = scanConfig->getFrontendConnection();
+ auto dataFlow = getDataFlowConfiguration();
+ if (dataFlow.hasScan()) {
+ scan.hasFrontendConnection = true;
+ } else {
+ scan.hasFrontendConnection = false;
+ return;
+ }
+ auto scanConfig = *dataFlow.getFirstScan();
+ scan.frontendId = scanConfig.getFrontendConnection();
}
static void connectDvrPlayback(DvrPlaybackHardwareConnections& playback) {
@@ -437,6 +457,7 @@
if (dataFlow.hasDvrPlayback()) {
playback.support = true;
} else {
+ playback.support = false;
return;
}
auto playbackConfig = *dataFlow.getFirstDvrPlayback();
@@ -455,6 +476,7 @@
if (dataFlow.hasDvrRecord()) {
record.support = true;
} else {
+ record.support = false;
return;
}
auto recordConfig = *dataFlow.getFirstDvrRecord();
@@ -464,6 +486,13 @@
if (recordConfig.hasDvrSoftwareFeConnection()) {
record.dvrSoftwareFeId = recordConfig.getDvrSoftwareFeConnection();
}
+ if (recordConfig.getHasFrontendConnection()) {
+ record.hasFrontendConnection = true;
+ record.dvrSourceId = emptyHardwareId;
+ } else {
+ record.hasFrontendConnection = false;
+ record.dvrSourceId = recordConfig.getDvrSourceConnection();
+ }
}
static void connectDescrambling(DescramblingHardwareConnections& descrambling) {
@@ -471,6 +500,7 @@
if (dataFlow.hasDescrambling()) {
descrambling.support = true;
} else {
+ descrambling.support = false;
return;
}
auto descConfig = *dataFlow.getFirstDescrambling();
@@ -481,6 +511,13 @@
if (descConfig.hasDvrSoftwareFeConnection()) {
descrambling.dvrSoftwareFeId = descConfig.getDvrSoftwareFeConnection();
}
+ if (descConfig.getHasFrontendConnection()) {
+ descrambling.hasFrontendConnection = true;
+ descrambling.dvrSourceId = emptyHardwareId;
+ } else {
+ descrambling.hasFrontendConnection = false;
+ descrambling.dvrSourceId = descConfig.getDvrSourceConnection();
+ }
}
static void connectLnbLive(LnbLiveHardwareConnections& lnbLive) {
@@ -488,6 +525,7 @@
if (dataFlow.hasLnbLive()) {
lnbLive.support = true;
} else {
+ lnbLive.support = false;
return;
}
auto lnbLiveConfig = *dataFlow.getFirstLnbLive();
@@ -507,6 +545,7 @@
if (dataFlow.hasLnbRecord()) {
lnbRecord.support = true;
} else {
+ lnbRecord.support = false;
return;
}
auto lnbRecordConfig = *dataFlow.getFirstLnbRecord();
@@ -526,6 +565,7 @@
if (dataFlow.hasTimeFilter()) {
timeFilter.support = true;
} else {
+ timeFilter.support = false;
return;
}
auto timeFilterConfig = *dataFlow.getFirstTimeFilter();
diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt
index a9602e7..ef73315 100644
--- a/tv/tuner/config/api/current.txt
+++ b/tv/tuner/config/api/current.txt
@@ -54,12 +54,16 @@
method @Nullable public String getAudioFilterConnection();
method @Nullable public String getDescramblerConnection();
method @Nullable public String getDvrSoftwareFeConnection();
+ method @Nullable public String getDvrSourceConnection();
method @Nullable public String getFrontendConnection();
+ method @Nullable public boolean getHasFrontendConnection();
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 setDvrSourceConnection(@Nullable String);
method public void setFrontendConnection(@Nullable String);
+ method public void setHasFrontendConnection(@Nullable boolean);
method public void setVideoFilterConnection(@Nullable String);
}
@@ -79,11 +83,15 @@
ctor public DataFlowConfiguration.DvrRecord();
method @Nullable public String getDvrRecordConnection();
method @Nullable public String getDvrSoftwareFeConnection();
+ method @Nullable public String getDvrSourceConnection();
method @Nullable public String getFrontendConnection();
+ method @Nullable public boolean getHasFrontendConnection();
method @Nullable public String getRecordFilterConnection();
method public void setDvrRecordConnection(@Nullable String);
method public void setDvrSoftwareFeConnection(@Nullable String);
+ method public void setDvrSourceConnection(@Nullable String);
method public void setFrontendConnection(@Nullable String);
+ method public void setHasFrontendConnection(@Nullable boolean);
method public void setRecordFilterConnection(@Nullable String);
}
diff --git a/tv/tuner/config/sample_tuner_vts_config_1_0.xml b/tv/tuner/config/sample_tuner_vts_config_1_0.xml
index 570171e..2624076 100644
--- a/tv/tuner/config/sample_tuner_vts_config_1_0.xml
+++ b/tv/tuner/config/sample_tuner_vts_config_1_0.xml
@@ -196,7 +196,8 @@
sectionFilterConnection="FILTER_TS_SECTION_0"
dvrSoftwareFeConnection="DVR_PLAYBACK_0"/>
<scan frontendConnection="FE_DEFAULT"/>
- <descrambling frontendConnection="FE_DEFAULT"
+ <descrambling hasFrontendConnection="true"
+ frontendConnection="FE_DEFAULT"
descramblerConnection="DESCRAMBLER_0"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
@@ -205,7 +206,8 @@
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
sectionFilterConnection="FILTER_TS_SECTION_0"/>
- <dvrRecord frontendConnection="FE_DEFAULT"
+ <dvrRecord hasFrontendConnection="true"
+ frontendConnection="FE_DEFAULT"
recordFilterConnection="FILTER_TS_RECORD_0"
dvrRecordConnection="DVR_RECORD_0"
dvrSoftwareFeConnection="DVR_PLAYBACK_0"/>
diff --git a/tv/tuner/config/sample_tuner_vts_config_1_1.xml b/tv/tuner/config/sample_tuner_vts_config_1_1.xml
index 191e51c..8c99207 100644
--- a/tv/tuner/config/sample_tuner_vts_config_1_1.xml
+++ b/tv/tuner/config/sample_tuner_vts_config_1_1.xml
@@ -145,14 +145,15 @@
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
ipFilterConnection="FILTER_IP_IP_0"
- dvrSoftwareFeConnection="DVR_PLAYBACK_0"/>
+ dvrSoftwareFeConnection="DVR_PLAYBACK_1"/>
<scan frontendConnection="FE_DEFAULT"/>
- <dvrPlayback dvrConnection="DVR_PLAYBACK_0"
+ <dvrPlayback dvrConnection="DVR_PLAYBACK_1"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"/>
- <dvrRecord frontendConnection="FE_DEFAULT"
+ <dvrRecord hasFrontendConnection="true"
+ frontendConnection="FE_DEFAULT"
recordFilterConnection="FILTER_TS_RECORD_0"
dvrRecordConnection="DVR_RECORD_0"
- dvrSoftwareFeConnection="DVR_PLAYBACK_0"/>
+ dvrSoftwareFeConnection="DVR_PLAYBACK_1"/>
</dataFlowConfiguration>
</TunerConfiguration>
diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd
index 3303657..5216837 100644
--- a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd
+++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd
@@ -587,7 +587,9 @@
<!-- DATA FLOW CONFIGURATION SESSION -->
<xs:complexType name="dataFlowConfiguration">
<xs:sequence>
- <xs:element name="clearLiveBroadcast" minOccurs="1" maxOccurs="1">
+ <!-- clearLiveBroadcast is only optional when there is no physical frontend. In this
+ case, the dvrPlayback config is required. -->
+ <xs:element name="clearLiveBroadcast" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="frontendConnection" type="frontendId" use="required"/>
<xs:attribute name="audioFilterConnection" type="filterId" use="required"/>
@@ -600,20 +602,27 @@
<xs:attribute name="dvrSoftwareFeConnection" type="dvrId" use="optional"/>
</xs:complexType>
</xs:element>
- <xs:element name="scan" minOccurs="1" maxOccurs="1">
+ <!-- scan is only optional when there is no physical frontend. In this case, the
+ dvrPlayback config is required. -->
+ <xs:element name="scan" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="frontendConnection" type="frontendId" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="descrambling" minOccurs="0" maxOccurs="1">
<xs:complexType>
+ <!-- If there is a software or hardware frontend connection or not. If false,
+ dvrSourceConnection config is required when testing dvrRecord. -->
+ <xs:attribute name="hasFrontendConnection" type="xs:boolean" use="required"/>
<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 -->
+ <!-- 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 -->
+ <xs:attribute name="dvrSourceConnection" type="dvrId" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="dvrPlayback" minOccurs="0" maxOccurs="1">
@@ -627,10 +636,15 @@
</xs:element>
<xs:element name="dvrRecord" minOccurs="0" maxOccurs="1">
<xs:complexType>
- <xs:attribute name="frontendConnection" type="frontendId" use="required"/>
+ <!-- If there is a software or hardware frontend connection or not. If false,
+ dvrSourceConnection config is required when testing dvrRecord. -->
+ <xs:attribute name="hasFrontendConnection" type="xs:boolean" use="required"/>
+ <xs:attribute name="frontendConnection" type="frontendId" use="optional"/>
<xs:attribute name="dvrRecordConnection" type="dvrId" use="required"/>
- <!-- DVR is only required when the frontend is using the software input -->
+ <!-- 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 -->
+ <xs:attribute name="dvrSourceConnection" type="dvrId" use="optional"/>
<xs:attribute name="recordFilterConnection" type="filterId" use="required"/>
</xs:complexType>
</xs:element>