Loading tv/tuner/1.1/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ hidl_interface { "IFilter.hal", "IFrontend.hal", "IFilterCallback.hal", "IFrontendCallback.hal", "ITuner.hal", "types.hal", ], Loading tv/tuner/1.1/IFrontendCallback.hal 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright 2020 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@1.1; import @1.0::IFrontendCallback; import FrontendScanMessageExt1_1; import FrontendScanMessageTypeExt1_1; interface IFrontendCallback extends @1.0::IFrontendCallback { /** * The callback function that must be called by HAL implementation to notify * the client of the v1_1 extended scan messages. * * @param type the type of v1_1 extended scan message. * @param message the v1_1 extended scan message sent by HAL to the client. */ onScanMessageExt1_1(FrontendScanMessageTypeExt1_1 type, FrontendScanMessageExt1_1 messageExt); }; tv/tuner/1.1/default/Frontend.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ #define LOG_TAG "android.hardware.tv.tuner@1.1-Frontend" #include "Frontend.h" #include <android/hardware/tv/tuner/1.0/IFrontendCallback.h> #include <android/hardware/tv/tuner/1.1/IFrontendCallback.h> #include <utils/Log.h> namespace android { Loading Loading @@ -118,6 +118,17 @@ Return<Result> Frontend::scan(const FrontendSettings& settings, FrontendScanType mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg); mIsLocked = true; sp<V1_1::IFrontendCallback> frontendCallback_v1_1 = V1_1::IFrontendCallback::castFrom(mCallback); if (frontendCallback_v1_1 != NULL) { V1_1::FrontendScanMessageExt1_1 msg; msg.dvbc(FrontendDvbcModulation::MOD_16QAM); frontendCallback_v1_1->onScanMessageExt1_1(V1_1::FrontendScanMessageTypeExt1_1::MODULATION, msg); } else { ALOGD("[Filter] Couldn't cast to V1_1 IFrontendCallback"); } return Result::SUCCESS; } Loading tv/tuner/1.1/types.hal +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import @1.0::FrontendIsdbtBandwidth; import @1.0::FrontendIsdbtGuardInterval; import @1.0::FrontendIsdbtMode; import @1.0::FrontendIsdbtModulation; import @1.0::FrontendScanMessageType; import @1.0::FrontendStatusType; import @1.0::FrontendType; import android.hidl.safe_union@1.0; Loading Loading @@ -522,3 +523,9 @@ safe_union FrontendStatusExt1_1 { */ vec<uint32_t> tsDataRate; }; enum FrontendScanMessageTypeExt1_1 : uint32_t { MODULATION = @1.0::FrontendScanMessageType:ATSC3_PLP_INFO + 1, }; typedef FrontendModulation FrontendScanMessageExt1_1; tv/tuner/1.1/vts/functional/FrontendTests.cpp +45 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,51 @@ Return<void> FrontendCallback::onScanMessage(FrontendScanMessageType type, return Void(); } Return<void> FrontendCallback::onScanMessageExt1_1(FrontendScanMessageTypeExt1_1 type, const FrontendScanMessageExt1_1& message) { android::Mutex::Autolock autoLock(mMsgLock); ALOGD("[vts] frontend ext1_1 scan message. Type: %d", type); switch (type) { case FrontendScanMessageTypeExt1_1::MODULATION: readFrontendScanMessageExt1_1Modulation(message); break; default: break; } return Void(); } void FrontendCallback::readFrontendScanMessageExt1_1Modulation(FrontendModulation modulation) { switch (modulation.getDiscriminator()) { case FrontendModulation::hidl_discriminator::dvbc: ALOGD("[vts] frontend ext1_1 scan message modulation dvbc: %d", modulation.dvbc()); break; case FrontendModulation::hidl_discriminator::dvbs: ALOGD("[vts] frontend ext1_1 scan message modulation dvbs: %d", modulation.dvbs()); break; case FrontendModulation::hidl_discriminator::isdbs: ALOGD("[vts] frontend ext1_1 scan message modulation isdbs: %d", modulation.isdbs()); break; case FrontendModulation::hidl_discriminator::isdbs3: ALOGD("[vts] frontend ext1_1 scan message modulation isdbs3: %d", modulation.isdbs3()); break; case FrontendModulation::hidl_discriminator::isdbt: ALOGD("[vts] frontend ext1_1 scan message modulation isdbt: %d", modulation.isdbt()); break; case FrontendModulation::hidl_discriminator::atsc: ALOGD("[vts] frontend ext1_1 scan message modulation atsc: %d", modulation.atsc()); break; case FrontendModulation::hidl_discriminator::atsc3: ALOGD("[vts] frontend ext1_1 scan message modulation atsc3: %d", modulation.atsc3()); break; case FrontendModulation::hidl_discriminator::dvbt: ALOGD("[vts] frontend ext1_1 scan message modulation dvbt: %d", modulation.dvbt()); break; default: break; } } void FrontendCallback::tuneTestOnLock(sp<IFrontend>& frontend, FrontendSettings settings, FrontendSettingsExt1_1 settingsExt1_1) { sp<android::hardware::tv::tuner::V1_1::IFrontend> frontend_1_1; Loading Loading
tv/tuner/1.1/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ hidl_interface { "IFilter.hal", "IFrontend.hal", "IFilterCallback.hal", "IFrontendCallback.hal", "ITuner.hal", "types.hal", ], Loading
tv/tuner/1.1/IFrontendCallback.hal 0 → 100644 +32 −0 Original line number Diff line number Diff line /* * Copyright 2020 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@1.1; import @1.0::IFrontendCallback; import FrontendScanMessageExt1_1; import FrontendScanMessageTypeExt1_1; interface IFrontendCallback extends @1.0::IFrontendCallback { /** * The callback function that must be called by HAL implementation to notify * the client of the v1_1 extended scan messages. * * @param type the type of v1_1 extended scan message. * @param message the v1_1 extended scan message sent by HAL to the client. */ onScanMessageExt1_1(FrontendScanMessageTypeExt1_1 type, FrontendScanMessageExt1_1 messageExt); };
tv/tuner/1.1/default/Frontend.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ #define LOG_TAG "android.hardware.tv.tuner@1.1-Frontend" #include "Frontend.h" #include <android/hardware/tv/tuner/1.0/IFrontendCallback.h> #include <android/hardware/tv/tuner/1.1/IFrontendCallback.h> #include <utils/Log.h> namespace android { Loading Loading @@ -118,6 +118,17 @@ Return<Result> Frontend::scan(const FrontendSettings& settings, FrontendScanType mCallback->onScanMessage(FrontendScanMessageType::LOCKED, msg); mIsLocked = true; sp<V1_1::IFrontendCallback> frontendCallback_v1_1 = V1_1::IFrontendCallback::castFrom(mCallback); if (frontendCallback_v1_1 != NULL) { V1_1::FrontendScanMessageExt1_1 msg; msg.dvbc(FrontendDvbcModulation::MOD_16QAM); frontendCallback_v1_1->onScanMessageExt1_1(V1_1::FrontendScanMessageTypeExt1_1::MODULATION, msg); } else { ALOGD("[Filter] Couldn't cast to V1_1 IFrontendCallback"); } return Result::SUCCESS; } Loading
tv/tuner/1.1/types.hal +7 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import @1.0::FrontendIsdbtBandwidth; import @1.0::FrontendIsdbtGuardInterval; import @1.0::FrontendIsdbtMode; import @1.0::FrontendIsdbtModulation; import @1.0::FrontendScanMessageType; import @1.0::FrontendStatusType; import @1.0::FrontendType; import android.hidl.safe_union@1.0; Loading Loading @@ -522,3 +523,9 @@ safe_union FrontendStatusExt1_1 { */ vec<uint32_t> tsDataRate; }; enum FrontendScanMessageTypeExt1_1 : uint32_t { MODULATION = @1.0::FrontendScanMessageType:ATSC3_PLP_INFO + 1, }; typedef FrontendModulation FrontendScanMessageExt1_1;
tv/tuner/1.1/vts/functional/FrontendTests.cpp +45 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,51 @@ Return<void> FrontendCallback::onScanMessage(FrontendScanMessageType type, return Void(); } Return<void> FrontendCallback::onScanMessageExt1_1(FrontendScanMessageTypeExt1_1 type, const FrontendScanMessageExt1_1& message) { android::Mutex::Autolock autoLock(mMsgLock); ALOGD("[vts] frontend ext1_1 scan message. Type: %d", type); switch (type) { case FrontendScanMessageTypeExt1_1::MODULATION: readFrontendScanMessageExt1_1Modulation(message); break; default: break; } return Void(); } void FrontendCallback::readFrontendScanMessageExt1_1Modulation(FrontendModulation modulation) { switch (modulation.getDiscriminator()) { case FrontendModulation::hidl_discriminator::dvbc: ALOGD("[vts] frontend ext1_1 scan message modulation dvbc: %d", modulation.dvbc()); break; case FrontendModulation::hidl_discriminator::dvbs: ALOGD("[vts] frontend ext1_1 scan message modulation dvbs: %d", modulation.dvbs()); break; case FrontendModulation::hidl_discriminator::isdbs: ALOGD("[vts] frontend ext1_1 scan message modulation isdbs: %d", modulation.isdbs()); break; case FrontendModulation::hidl_discriminator::isdbs3: ALOGD("[vts] frontend ext1_1 scan message modulation isdbs3: %d", modulation.isdbs3()); break; case FrontendModulation::hidl_discriminator::isdbt: ALOGD("[vts] frontend ext1_1 scan message modulation isdbt: %d", modulation.isdbt()); break; case FrontendModulation::hidl_discriminator::atsc: ALOGD("[vts] frontend ext1_1 scan message modulation atsc: %d", modulation.atsc()); break; case FrontendModulation::hidl_discriminator::atsc3: ALOGD("[vts] frontend ext1_1 scan message modulation atsc3: %d", modulation.atsc3()); break; case FrontendModulation::hidl_discriminator::dvbt: ALOGD("[vts] frontend ext1_1 scan message modulation dvbt: %d", modulation.dvbt()); break; default: break; } } void FrontendCallback::tuneTestOnLock(sp<IFrontend>& frontend, FrontendSettings settings, FrontendSettingsExt1_1 settingsExt1_1) { sp<android::hardware::tv::tuner::V1_1::IFrontend> frontend_1_1; Loading