Add some new features to tuner AIDL HAL.

*) Allow section filter version to be optional.
*) Add separate DemuxScAvcIndex for the AVC.
*) Support for secure MediaFilter buffer configuration.
*) Remove duplicated UNDEFINED and NONE from DemuxRecordScIndexType.

Bug: 191825295
Bug: 204807405
Bug: 204178547
Test: atest VtsHalTvTunerTargetTest
Test: atest android.media.tv.tuner.cts
Change-Id: I34af9483b3496099a159ae22360415740dd792c1
This commit is contained in:
Hongguang 2021-11-01 15:51:52 -07:00
parent 8824d6c08a
commit 16dacc10b6
22 changed files with 291 additions and 39 deletions

View file

@ -47,4 +47,5 @@ enum Constant {
INVALID_FRONTEND_ID = -1,
INVALID_LNB_ID = -1,
INVALID_KEYTOKEN = 0,
INVALID_TABINFO_VERSION = -1,
}

View file

@ -36,4 +36,5 @@ package android.hardware.tv.tuner;
@VintfStability
parcelable DemuxFilterAvSettings {
boolean isPassthrough;
boolean isSecureMemory;
}

View file

@ -36,6 +36,6 @@ package android.hardware.tv.tuner;
@VintfStability
parcelable DemuxFilterRecordSettings {
int tsIndexMask;
android.hardware.tv.tuner.DemuxRecordScIndexType scIndexType = android.hardware.tv.tuner.DemuxRecordScIndexType.UNDEFINED;
android.hardware.tv.tuner.DemuxRecordScIndexType scIndexType = android.hardware.tv.tuner.DemuxRecordScIndexType.NONE;
android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask;
}

View file

@ -36,5 +36,6 @@ package android.hardware.tv.tuner;
@VintfStability
union DemuxFilterScIndexMask {
int scIndex;
int scAvc;
int scHevc;
}

View file

@ -38,5 +38,5 @@ enum DemuxRecordScIndexType {
NONE = 0,
SC = 1,
SC_HEVC = 2,
UNDEFINED = 3,
SC_AVC = 3,
}

View file

@ -0,0 +1,44 @@
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.tv.tuner;
/* @hide */
@Backing(type="int") @VintfStability
enum DemuxScAvcIndex {
UNDEFINED = 0,
I_SLICE = 1,
P_SLICE = 2,
B_SLICE = 4,
SI_SLICE = 8,
SP_SLICE = 16,
}

View file

@ -35,6 +35,7 @@ package android.hardware.tv.tuner;
/* @hide */
@Backing(type="int") @VintfStability
enum DemuxScHevcIndex {
UNDEFINED = 0,
SPS = 1,
AUD = 2,
SLICE_CE_BLA_W_LP = 4,

View file

@ -40,9 +40,4 @@ enum DemuxScIndex {
P_FRAME = 2,
B_FRAME = 4,
SEQUENCE = 8,
I_SLICE = 16,
P_SLICE = 32,
B_SLICE = 64,
SI_SLICE = 128,
SP_SLICE = 256,
}

View file

@ -83,4 +83,9 @@ enum Constant {
* An invalid key token. It is used to remove the current key from the descrambler.
*/
INVALID_KEYTOKEN = 0x00,
/**
* An invalid section filter version number.
*/
INVALID_TABINFO_VERSION = 0xFFFFFFFF,
}

View file

@ -26,4 +26,9 @@ parcelable DemuxFilterAvSettings {
* true if the filter output goes to decoder directly in pass through mode.
*/
boolean isPassthrough;
/**
* true if the avMemory should be allocated from secure area.
*/
boolean isSecureMemory;
}

View file

@ -30,7 +30,7 @@ parcelable DemuxFilterRecordSettings {
*/
int tsIndexMask;
DemuxRecordScIndexType scIndexType = DemuxRecordScIndexType.UNDEFINED;
DemuxRecordScIndexType scIndexType = DemuxRecordScIndexType.NONE;
DemuxFilterScIndexMask scIndexMask;
}

View file

@ -16,6 +16,7 @@
package android.hardware.tv.tuner;
import android.hardware.tv.tuner.DemuxScAvcIndex;
import android.hardware.tv.tuner.DemuxScHevcIndex;
import android.hardware.tv.tuner.DemuxScIndex;
@ -29,6 +30,11 @@ union DemuxFilterScIndexMask {
*/
int scIndex;
/**
* Indexes defined by DemuxScAvcIndex.
*/
int scAvc;
/**
* Indexes defined by DemuxScHevcIndex.
*/

View file

@ -28,7 +28,8 @@ parcelable DemuxFilterSectionSettingsConditionTableInfo {
int tableId;
/**
* Version number for Section Filter
* Optional version number for Section Filter. It should be ignored if INVALID_TABINFO_VERSION
* is set.
*/
int version;
}

View file

@ -39,7 +39,7 @@ enum DemuxRecordScIndexType {
SC_HEVC,
/**
* SC index is undefined
* Use Start Code index for AVC
*/
UNDEFINED,
SC_AVC,
}

View file

@ -0,0 +1,52 @@
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.tv.tuner;
/**
* Indexes can be tagged by start point of slice groups according to ISO/IEC 14496-10.
* @hide
*/
@VintfStability
@Backing(type="int")
enum DemuxScAvcIndex {
UNDEFINED = 0,
/**
* All blocks are coded as I blocks.
*/
I_SLICE = 1 << 0,
/**
* Blocks are coded as I or P blocks.
*/
P_SLICE = 1 << 1,
/**
* Blocks are coded as I, P or B blocks.
*/
B_SLICE = 1 << 2,
/**
* A so-called switching I slice that is coded.
*/
SI_SLICE = 1 << 3,
/**
* A so-called switching P slice that is coded.
*/
SP_SLICE = 1 << 4,
}

View file

@ -23,6 +23,8 @@ package android.hardware.tv.tuner;
@VintfStability
@Backing(type="int")
enum DemuxScHevcIndex {
UNDEFINED = 0,
SPS = 1 << 0,
AUD = 1 << 1,

View file

@ -18,7 +18,7 @@ package android.hardware.tv.tuner;
/**
* Indexes can be tagged by Start Code in PES (Packetized Elementary Stream)
* according to ISO/IEC 13818-1 and Slice Groups according to ISO/IEC 14496-10.
* according to ISO/IEC 13818-1.
* @hide
*/
@VintfStability
@ -45,29 +45,4 @@ enum DemuxScIndex {
* Start Code is for a new Sequence
*/
SEQUENCE = 1 << 3,
/**
* All blocks are coded as I blocks.
*/
I_SLICE = 1 << 4,
/**
* Blocks are coded as I or P blocks.
*/
P_SLICE = 1 << 5,
/**
* Blocks are coded as I, P or B blocks.
*/
B_SLICE = 1 << 6,
/**
* A so-called switching I slice that is coded.
*/
SI_SLICE = 1 << 7,
/**
* A so-called switching P slice that is coded.
*/
SP_SLICE = 1 << 8,
}

View file

@ -52,7 +52,7 @@ using namespace android::media::tuner::testing::configuration::V1_0;
const int32_t FMQ_SIZE_4M = 0x400000;
const int32_t FMQ_SIZE_16M = 0x1000000;
const string configFilePath = "/vendor/etc/tuner_vts_config_1_1.xml";
const string configFilePath = "/vendor/etc/tuner_vts_config_aidl_V1.xml";
#define FILTER_MAIN_TYPE_BIT_COUNT 5

View file

@ -956,6 +956,7 @@ struct TunerTestingConfigAidlReader1_0 {
}
auto av = filterConfig.getFirstAvFilterSettings_optional();
settings.isPassthrough = av->getIsPassthrough();
settings.isSecureMemory = av->getIsSecureMemory();
return settings;
}

View file

@ -5,9 +5,11 @@ package android.media.tuner.testing.configuration.V1_0 {
ctor public AvFilterSettings();
method @Nullable public short getAudioStreamType_optional();
method @Nullable public boolean getIsPassthrough();
method @Nullable public boolean getIsSecureMemory();
method @Nullable public short getVideoStreamType_optional();
method public void setAudioStreamType_optional(@Nullable short);
method public void setIsPassthrough(@Nullable boolean);
method public void setIsSecureMemory(@Nullable boolean);
method public void setVideoStreamType_optional(@Nullable short);
}

View file

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (C) 2021 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The Sample Tuner Testing Configuration.
Name the customized xml with "tuner_vts_config.xml" and push into the device
"/vendor/etc" path. Please use "tuner_testing_dynamic_configuration.xsd" to verify the xml.
The version section contains a “version” tag in the form “major.minor” e.g. version=”1.0”
This shows the tuner dynamic configuration version. -->
<TunerConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- Hardware Configuration section contains the configurations of all the hardwares
that would be used in the tests. In the "dataFlowConfiguration" section, each data flow
under test has its required/optional hardwares. The ids configured in the
"dataFlowConfiguration" would be used to connect the hardware to each data flow test. -->
<hardwareConfiguration>
<!-- Frontends section:
This section contains configurations of all the frontends that would be used
in the tests.
- This section is optional and can be skipped to use the default fe settings.
- The default settings can be found in the sample_tuner_vts_configurations.xml.
- The users can also override the default frontend settings using id="FE_DEFAULT".
- The users can configure 1 or more frontend elements in the frontends sections.
Each frontend element contain the following attributes:
"id": unique id of the frontend that could be used to connect to the test the
"dataFlowConfiguration"
"type": the frontend type. The enums are defined in the xsd.
"isSoftwareFrontend": if the test environment is using hardware or software
frontend. If using software, a ts input file path needs to be configured.
"softwareFeInputPath": used as the source of the software frontend.
"connectToCicamId": if the device supports frontend connecting to cicam, the target
cicam id needs to be configured here. Supported in Tuner 1.1 or higher.
"frequency": the frequency used to configure tune and scan.
"endFrequency": the end frequency of scan. Supported in Tuner 1.1 or higher.
Each frontend element also contains one and only one type-related "frontendSettings".
- The settings type should match the frontend "type" attribute.
- For example, when frontend type="DVBT", dvbtFrontendSettings can be configured.
- This is optional and skipping the settings would pass a setting with frequency
config only to the hal.
-->
<frontends>
<frontend id="FE_DEFAULT" type="DVBT" isSoftwareFrontend="true"
connectToCicamId="0" frequency="578000000" endFrequency="800000000">
<dvbtFrontendSettings bandwidth="8" transmissionMode="128" isHighPriority="1"/>
</frontend>
<frontend id="FE_DVBS_0" type="DVBS" isSoftwareFrontend="true"
connectToCicamId="0" frequency="578000000" endFrequency="800000000">
</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" monitorEventTypes="3">
<avFilterSettings isPassthrough="false" isSecureMemory="false">
<audioStreamType>2</audioStreamType>
</avFilterSettings>
</filter>
<filter id="FILTER_VIDEO_DEFAULT" mainType="TS" subType="VIDEO"
bufferSize="16777216" pid="256" useFMQ="false" monitorEventTypes="3">
<avFilterSettings isPassthrough="false" isSecureMemory="false">
<videoStreamType>2</videoStreamType>
</avFilterSettings>
</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_IP_IP_0" mainType="IP" subType="IP" bufferSize="16777216" useFMQ="false">
<ipFilterConfig ipCid="1">
<srcIpAddress isIpV4="true" ip="192 168 1 1"/>
<destIpAddress isIpV4="true" ip="192 168 1 1"/>
</ipFilterConfig>
</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>
</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"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"
ipFilterConnection="FILTER_IP_IP_0"
dvrSoftwareFeConnection="DVR_PLAYBACK_1"/>
<scan frontendConnection="FE_DEFAULT"/>
<dvrPlayback dvrConnection="DVR_PLAYBACK_1"
audioFilterConnection="FILTER_AUDIO_DEFAULT"
videoFilterConnection="FILTER_VIDEO_DEFAULT"/>
<dvrRecord hasFrontendConnection="true"
frontendConnection="FE_DEFAULT"
recordFilterConnection="FILTER_TS_RECORD_0"
dvrRecordConnection="DVR_RECORD_0"
dvrSoftwareFeConnection="DVR_PLAYBACK_1"/>
</dataFlowConfiguration>
</TunerConfiguration>

View file

@ -191,7 +191,7 @@
<xs:enumeration value="IP"/>
<xs:enumeration value="NTP"/>
<xs:enumeration value="IP_PAYLOAD"/>
<xs:enumeration value="PAYLOAD_THROUGH"/>
<xs:enumeration value="PAYLOAD_THROUGH"/>
</xs:restriction>
</xs:simpleType>
@ -220,6 +220,7 @@
<xs:element name="videoStreamType" type="xs:unsignedByte"/>
</xs:choice>
<xs:attribute name="isPassthrough" type="xs:boolean" use="required"/>
<xs:attribute name="isSecureMemory" type="xs:boolean" use="required"/>
</xs:complexType>
<xs:complexType name="sectionFilterSettings">
<xs:attribute name="isCheckCrc" type="xs:boolean" use="required"/>