From aee8c9e2f9d75e7eed2f9465fbf187f4e9b5f53d Mon Sep 17 00:00:00 2001 From: Frankie Lizcano Date: Fri, 24 Jun 2022 21:28:00 +0000 Subject: [PATCH] vts: Added support for ISDBT Frontend types The latest version of the dynamic VTS for Tuner HALs did not support the configuration of ISDBT Frontend types. Logic was added to allow this feature. Editing the tuner_testing_dynamic_configuration file directly changes the api outlined in api/current.txt to support reading the newly added features from the vendor's configuration file. Bug: b/237112300 Test: manual - Ran local tests that ensured the ATSC frontend was being configured correctly. Also ran the VTS module to ensure no failures were occuring. Change-Id: Ic18a116f15c79b30c7ecf827f5f7a1e453c20236 --- .../config/TunerTestingConfigAidlReaderV1_0.h | 39 +++++++++++++++++++ tv/tuner/config/api/current.txt | 32 +++++++++++++++ .../tuner_testing_dynamic_configuration.xsd | 21 ++++++++-- 3 files changed, 89 insertions(+), 3 deletions(-) diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h index e0118cd6fb..9e461b6115 100644 --- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h +++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h @@ -295,6 +295,8 @@ struct TunerTestingConfigAidlReader1_0 { break; case FrontendTypeEnum::ISDBT: type = FrontendType::ISDBT; + frontendMap[id].settings.set( + readIsdbtFrontendSettings(feConfig)); break; case FrontendTypeEnum::DTMB: type = FrontendType::DTMB; @@ -743,6 +745,43 @@ struct TunerTestingConfigAidlReader1_0 { return isdbsSettings; } + static FrontendIsdbtSettings readIsdbtFrontendSettings(Frontend& feConfig) { + ALOGW("[ConfigReader] fe type is isdbt"); + FrontendIsdbtSettings isdbtSettings{ + .frequency = (int64_t)feConfig.getFrequency(), + }; + if (feConfig.hasEndFrequency()) { + isdbtSettings.endFrequency = (int64_t)feConfig.getEndFrequency(); + } + if (!feConfig.hasIsdbtFrontendSettings_optional()) { + ALOGW("[ConfigReader] no more isdbt settings"); + return isdbtSettings; + } + auto isdbt = feConfig.getFirstIsdbtFrontendSettings_optional(); + isdbtSettings.inversion = static_cast(isdbt->getInversion()); + isdbtSettings.bandwidth = static_cast(isdbt->getBandwidth()); + isdbtSettings.mode = static_cast(isdbt->getMode()); + isdbtSettings.guardInterval = + static_cast(isdbt->getGuardInterval()); + isdbtSettings.serviceAreaId = (int32_t)isdbt->getServiceAreaId(); + isdbtSettings.partialReceptionFlag = + static_cast(isdbt->getPartialReceptionFlag()); + if (!isdbt->hasFrontendIsdbtLayerSettings()) { + ALOGW("[ConfigReader] no isdbt layer settings"); + return isdbtSettings; + } + auto layerSettings = isdbt->getFirstFrontendIsdbtLayerSettings(); + ::aidl::android::hardware::tv::tuner::FrontendIsdbtLayerSettings mLayerSettings; + mLayerSettings.modulation = + static_cast(layerSettings->getModulation()); + mLayerSettings.coderate = static_cast(layerSettings->getCoderate()); + mLayerSettings.timeInterleave = + static_cast(layerSettings->getTimeInterleave()); + mLayerSettings.numOfSegment = (int32_t)layerSettings->getNumOfSegment(); + isdbtSettings.layerSettings.push_back(mLayerSettings); + return isdbtSettings; + } + static bool readFilterTypeAndSettings(Filter filterConfig, DemuxFilterType& type, DemuxFilterSettings& settings) { auto mainType = filterConfig.getMainType(); diff --git a/tv/tuner/config/api/current.txt b/tv/tuner/config/api/current.txt index aa7b88c249..acaf07af4d 100644 --- a/tv/tuner/config/api/current.txt +++ b/tv/tuner/config/api/current.txt @@ -327,6 +327,7 @@ package android.media.tuner.testing.configuration.V1_0 { method @Nullable public String getId(); method @Nullable public boolean getIsSoftwareFrontend(); method @Nullable public android.media.tuner.testing.configuration.V1_0.IsdbsFrontendSettings getIsdbsFrontendSettings_optional(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.IsdbtFrontendSettings getIsdbtFrontendSettings_optional(); method @Nullable public java.math.BigInteger getRemoveOutputPid(); method @Nullable public android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum getType(); method public void setAtscFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.AtscFrontendSettings); @@ -338,10 +339,23 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setId(@Nullable String); method public void setIsSoftwareFrontend(@Nullable boolean); method public void setIsdbsFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.IsdbsFrontendSettings); + method public void setIsdbtFrontendSettings_optional(@Nullable android.media.tuner.testing.configuration.V1_0.IsdbtFrontendSettings); method public void setRemoveOutputPid(@Nullable java.math.BigInteger); method public void setType(@Nullable android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum); } + public class FrontendIsdbtLayerSettings { + ctor public FrontendIsdbtLayerSettings(); + method @Nullable public java.math.BigInteger getCoderate(); + method @Nullable public java.math.BigInteger getModulation(); + method @Nullable public java.math.BigInteger getNumOfSegment(); + method @Nullable public java.math.BigInteger getTimeInterleave(); + method public void setCoderate(@Nullable java.math.BigInteger); + method public void setModulation(@Nullable java.math.BigInteger); + method public void setNumOfSegment(@Nullable java.math.BigInteger); + method public void setTimeInterleave(@Nullable java.math.BigInteger); + } + public enum FrontendTypeEnum { method @NonNull public String getRawName(); enum_constant public static final android.media.tuner.testing.configuration.V1_0.FrontendTypeEnum ANALOG; @@ -450,6 +464,24 @@ package android.media.tuner.testing.configuration.V1_0 { method public void setSymbolRate(@Nullable java.math.BigInteger); } + public class IsdbtFrontendSettings { + ctor public IsdbtFrontendSettings(); + method @Nullable public java.math.BigInteger getBandwidth(); + method @Nullable public android.media.tuner.testing.configuration.V1_0.FrontendIsdbtLayerSettings getFrontendIsdbtLayerSettings(); + method @Nullable public java.math.BigInteger getGuardInterval(); + method @Nullable public java.math.BigInteger getInversion(); + method @Nullable public java.math.BigInteger getMode(); + method @Nullable public java.math.BigInteger getPartialReceptionFlag(); + method @Nullable public java.math.BigInteger getServiceAreaId(); + method public void setBandwidth(@Nullable java.math.BigInteger); + method public void setFrontendIsdbtLayerSettings(@Nullable android.media.tuner.testing.configuration.V1_0.FrontendIsdbtLayerSettings); + method public void setGuardInterval(@Nullable java.math.BigInteger); + method public void setInversion(@Nullable java.math.BigInteger); + method public void setMode(@Nullable java.math.BigInteger); + method public void setPartialReceptionFlag(@Nullable java.math.BigInteger); + method public void setServiceAreaId(@Nullable java.math.BigInteger); + } + public class Lnb { ctor public Lnb(); method @Nullable public String getId(); diff --git a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd index 282433e741..f4347f0d73 100644 --- a/tv/tuner/config/tuner_testing_dynamic_configuration.xsd +++ b/tv/tuner/config/tuner_testing_dynamic_configuration.xsd @@ -92,6 +92,21 @@ + + + + + + + + + + + + + + + @@ -128,9 +143,9 @@ - + + +