From 16dacc10b62dea2de5f7f2ef51eddfc26a965ba1 Mon Sep 17 00:00:00 2001 From: Hongguang Date: Mon, 1 Nov 2021 15:51:52 -0700 Subject: [PATCH] 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 --- .../android/hardware/tv/tuner/Constant.aidl | 1 + .../tv/tuner/DemuxFilterAvSettings.aidl | 1 + .../tv/tuner/DemuxFilterRecordSettings.aidl | 2 +- .../tv/tuner/DemuxFilterScIndexMask.aidl | 1 + .../tv/tuner/DemuxRecordScIndexType.aidl | 2 +- .../hardware/tv/tuner/DemuxScAvcIndex.aidl | 44 +++++ .../hardware/tv/tuner/DemuxScHevcIndex.aidl | 1 + .../hardware/tv/tuner/DemuxScIndex.aidl | 5 - .../android/hardware/tv/tuner/Constant.aidl | 5 + .../tv/tuner/DemuxFilterAvSettings.aidl | 5 + .../tv/tuner/DemuxFilterRecordSettings.aidl | 2 +- .../tv/tuner/DemuxFilterScIndexMask.aidl | 6 + ...lterSectionSettingsConditionTableInfo.aidl | 3 +- .../tv/tuner/DemuxRecordScIndexType.aidl | 4 +- .../hardware/tv/tuner/DemuxScAvcIndex.aidl | 52 ++++++ .../hardware/tv/tuner/DemuxScHevcIndex.aidl | 2 + .../hardware/tv/tuner/DemuxScIndex.aidl | 27 +-- .../VtsHalTvTunerTestConfigurations.h | 2 +- .../config/TunerTestingConfigAidlReaderV1_0.h | 1 + tv/tuner/config/api/current.txt | 2 + .../sample_tuner_vts_config_aidl_V1.xml | 159 ++++++++++++++++++ .../tuner_testing_dynamic_configuration.xsd | 3 +- 22 files changed, 291 insertions(+), 39 deletions(-) create mode 100644 tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScAvcIndex.aidl create mode 100644 tv/tuner/aidl/android/hardware/tv/tuner/DemuxScAvcIndex.aidl create mode 100644 tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl index 8e31bd9f77..95ecc51e6c 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/Constant.aidl @@ -47,4 +47,5 @@ enum Constant { INVALID_FRONTEND_ID = -1, INVALID_LNB_ID = -1, INVALID_KEYTOKEN = 0, + INVALID_TABINFO_VERSION = -1, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl index 95911f93d7..3e5df2d635 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl @@ -36,4 +36,5 @@ package android.hardware.tv.tuner; @VintfStability parcelable DemuxFilterAvSettings { boolean isPassthrough; + boolean isSecureMemory; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl index 17bdd1fe3f..02c478f4c1 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl @@ -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; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl index 3fd19100b5..371e075617 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -36,5 +36,6 @@ package android.hardware.tv.tuner; @VintfStability union DemuxFilterScIndexMask { int scIndex; + int scAvc; int scHevc; } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl index 91a5e52996..30ec29a23b 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -38,5 +38,5 @@ enum DemuxRecordScIndexType { NONE = 0, SC = 1, SC_HEVC = 2, - UNDEFINED = 3, + SC_AVC = 3, } diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScAvcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScAvcIndex.aidl new file mode 100644 index 0000000000..651b66c345 --- /dev/null +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScAvcIndex.aidl @@ -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 -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, +} diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl index 3035dad332..670b34e62a 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScHevcIndex.aidl @@ -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, diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl index 808b212311..25f0585715 100644 --- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl +++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxScIndex.aidl @@ -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, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl index 891794a50f..0751d264a5 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/Constant.aidl @@ -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, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl index 30a1054575..fe4db5bdcf 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterAvSettings.aidl @@ -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; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl index 2f8886469e..475910b6c4 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterRecordSettings.aidl @@ -30,7 +30,7 @@ parcelable DemuxFilterRecordSettings { */ int tsIndexMask; - DemuxRecordScIndexType scIndexType = DemuxRecordScIndexType.UNDEFINED; + DemuxRecordScIndexType scIndexType = DemuxRecordScIndexType.NONE; DemuxFilterScIndexMask scIndexMask; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl index a9f4b6fede..4036b06c8f 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterScIndexMask.aidl @@ -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. */ diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl index 898b9cc0cc..dbd438cbae 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterSectionSettingsConditionTableInfo.aidl @@ -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; } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl index 44b985cc67..98427f774f 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxRecordScIndexType.aidl @@ -39,7 +39,7 @@ enum DemuxRecordScIndexType { SC_HEVC, /** - * SC index is undefined + * Use Start Code index for AVC */ - UNDEFINED, + SC_AVC, } diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScAvcIndex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScAvcIndex.aidl new file mode 100644 index 0000000000..ed418f2144 --- /dev/null +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScAvcIndex.aidl @@ -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, +} diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl index f2ddd004b9..0d1f112cba 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScHevcIndex.aidl @@ -23,6 +23,8 @@ package android.hardware.tv.tuner; @VintfStability @Backing(type="int") enum DemuxScHevcIndex { + UNDEFINED = 0, + SPS = 1 << 0, AUD = 1 << 1, diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl index 0aef739742..4fed1e55b7 100644 --- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl +++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxScIndex.aidl @@ -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, } diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h index 006bf17c2e..5a72ba45b5 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h @@ -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 diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index 08270d60dc..7ccf31ae74 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -956,6 +956,7 @@ struct TunerTestingConfigAidlReader1_0 { } auto av = filterConfig.getFirstAvFilterSettings_optional(); settings.isPassthrough = av->getIsPassthrough(); + settings.isSecureMemory = av->getIsSecureMemory(); return settings; } diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt index d026bf9e40..6c637a4689 100644 --- a/tv/tuner/config/api/current.txt +++ b/tv/tuner/config/api/current.txt @@ -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); } diff --git a/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml new file mode 100644 index 0000000000..8a6229ebb9 --- /dev/null +++ b/tv/tuner/config/sample_tuner_vts_config_aidl_V1.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + 2 + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd index 6a04b7ebe1..fc2827f9a3 100644 --- a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd +++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd @@ -191,7 +191,7 @@ - + @@ -220,6 +220,7 @@ +