Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "android.hardware.tv.tuner@1.1-Tuner" |
| 18 | |
| 19 | #include "Tuner.h" |
| 20 | #include <utils/Log.h> |
| 21 | #include "Demux.h" |
| 22 | #include "Descrambler.h" |
| 23 | #include "Frontend.h" |
| 24 | #include "Lnb.h" |
| 25 | |
| 26 | namespace android { |
| 27 | namespace hardware { |
| 28 | namespace tv { |
| 29 | namespace tuner { |
| 30 | namespace V1_0 { |
| 31 | namespace implementation { |
| 32 | |
| 33 | Tuner::Tuner() { |
| 34 | // Static Frontends array to maintain local frontends information |
| 35 | // Array index matches their FrontendId in the default impl |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 36 | mFrontendSize = 10; |
Amy Zhang | f2354c6 | 2021-02-08 19:58:04 -0800 | [diff] [blame] | 37 | mFrontends[0] = new Frontend(FrontendType::ISDBS, 0, this); |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 38 | mFrontends[1] = new Frontend(FrontendType::ATSC3, 1, this); |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 39 | mFrontends[2] = new Frontend(FrontendType::DVBC, 2, this); |
| 40 | mFrontends[3] = new Frontend(FrontendType::DVBS, 3, this); |
| 41 | mFrontends[4] = new Frontend(FrontendType::DVBT, 4, this); |
| 42 | mFrontends[5] = new Frontend(FrontendType::ISDBT, 5, this); |
| 43 | mFrontends[6] = new Frontend(FrontendType::ANALOG, 6, this); |
| 44 | mFrontends[7] = new Frontend(FrontendType::ATSC, 7, this); |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 45 | mFrontends[8] = new Frontend(FrontendType::ISDBS3, 8, this); |
| 46 | mFrontends[9] = |
| 47 | new Frontend(static_cast<V1_0::FrontendType>(V1_1::FrontendType::DTMB), 9, this); |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 48 | |
| 49 | FrontendInfo::FrontendCapabilities caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 50 | vector<FrontendStatusType> statusCaps; |
| 51 | |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 52 | caps = FrontendInfo::FrontendCapabilities(); |
Amy Zhang | f2354c6 | 2021-02-08 19:58:04 -0800 | [diff] [blame] | 53 | caps.isdbsCaps(FrontendIsdbsCapabilities()); |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 54 | mFrontendCaps[0] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 55 | statusCaps = { |
| 56 | FrontendStatusType::DEMOD_LOCK, |
| 57 | FrontendStatusType::SNR, |
| 58 | FrontendStatusType::FEC, |
| 59 | FrontendStatusType::MODULATION, |
| 60 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 61 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::ROLL_OFF), |
| 62 | }; |
| 63 | mFrontendStatusCaps[0] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 64 | |
| 65 | caps = FrontendInfo::FrontendCapabilities(); |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 66 | caps.atsc3Caps(FrontendAtsc3Capabilities()); |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 67 | mFrontendCaps[1] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 68 | statusCaps = { |
| 69 | FrontendStatusType::BER, |
| 70 | FrontendStatusType::PER, |
| 71 | FrontendStatusType::ATSC3_PLP_INFO, |
| 72 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 73 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::BERS), |
| 74 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::INTERLEAVINGS), |
| 75 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::BANDWIDTH), |
| 76 | }; |
| 77 | mFrontendStatusCaps[1] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 78 | |
| 79 | caps = FrontendInfo::FrontendCapabilities(); |
| 80 | caps.dvbcCaps(FrontendDvbcCapabilities()); |
| 81 | mFrontendCaps[2] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 82 | statusCaps = { |
| 83 | FrontendStatusType::PRE_BER, |
| 84 | FrontendStatusType::SIGNAL_QUALITY, |
| 85 | FrontendStatusType::MODULATION, |
| 86 | FrontendStatusType::SPECTRAL, |
| 87 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 88 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::CODERATES), |
| 89 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::INTERLEAVINGS), |
| 90 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::BANDWIDTH), |
| 91 | }; |
| 92 | mFrontendStatusCaps[2] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 93 | |
| 94 | caps = FrontendInfo::FrontendCapabilities(); |
| 95 | caps.dvbsCaps(FrontendDvbsCapabilities()); |
| 96 | mFrontendCaps[3] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 97 | statusCaps = { |
| 98 | FrontendStatusType::SIGNAL_STRENGTH, |
| 99 | FrontendStatusType::SYMBOL_RATE, |
| 100 | FrontendStatusType::MODULATION, |
| 101 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 102 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::ROLL_OFF), |
| 103 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::IS_MISO), |
| 104 | }; |
| 105 | mFrontendStatusCaps[3] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 106 | |
| 107 | caps = FrontendInfo::FrontendCapabilities(); |
| 108 | caps.dvbtCaps(FrontendDvbtCapabilities()); |
| 109 | mFrontendCaps[4] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 110 | statusCaps = { |
| 111 | FrontendStatusType::EWBS, |
| 112 | FrontendStatusType::PLP_ID, |
| 113 | FrontendStatusType::HIERARCHY, |
| 114 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 115 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::BANDWIDTH), |
| 116 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::GUARD_INTERVAL), |
| 117 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::TRANSMISSION_MODE), |
| 118 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::T2_SYSTEM_ID), |
| 119 | }; |
| 120 | mFrontendStatusCaps[4] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 121 | |
| 122 | caps = FrontendInfo::FrontendCapabilities(); |
| 123 | FrontendIsdbtCapabilities isdbtCaps{ |
| 124 | .modeCap = FrontendIsdbtMode::MODE_1 | FrontendIsdbtMode::MODE_2, |
| 125 | .bandwidthCap = (unsigned int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, |
| 126 | .modulationCap = (unsigned int)FrontendIsdbtModulation::MOD_16QAM, |
| 127 | // ISDBT shares coderate and guard interval with DVBT |
| 128 | .coderateCap = FrontendDvbtCoderate::CODERATE_4_5 | FrontendDvbtCoderate::CODERATE_6_7, |
| 129 | .guardIntervalCap = (unsigned int)FrontendDvbtGuardInterval::INTERVAL_1_128, |
| 130 | }; |
| 131 | caps.isdbtCaps(isdbtCaps); |
| 132 | mFrontendCaps[5] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 133 | statusCaps = { |
| 134 | FrontendStatusType::AGC, |
| 135 | FrontendStatusType::LNA, |
| 136 | FrontendStatusType::MODULATION, |
| 137 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 138 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::BANDWIDTH), |
| 139 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::GUARD_INTERVAL), |
| 140 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::TRANSMISSION_MODE), |
| 141 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::ISDBT_SEGMENTS), |
| 142 | }; |
| 143 | mFrontendStatusCaps[5] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 144 | |
| 145 | caps = FrontendInfo::FrontendCapabilities(); |
| 146 | caps.analogCaps(FrontendAnalogCapabilities()); |
| 147 | mFrontendCaps[6] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 148 | statusCaps = { |
| 149 | FrontendStatusType::LAYER_ERROR, |
| 150 | FrontendStatusType::MER, |
| 151 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::UEC), |
| 152 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::TS_DATA_RATES), |
| 153 | }; |
| 154 | mFrontendStatusCaps[6] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 155 | |
| 156 | caps = FrontendInfo::FrontendCapabilities(); |
| 157 | caps.atscCaps(FrontendAtscCapabilities()); |
| 158 | mFrontendCaps[7] = caps; |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 159 | statusCaps = { |
| 160 | FrontendStatusType::FREQ_OFFSET, |
| 161 | FrontendStatusType::RF_LOCK, |
| 162 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 163 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::IS_LINEAR), |
| 164 | }; |
| 165 | mFrontendStatusCaps[7] = statusCaps; |
| 166 | |
| 167 | caps = FrontendInfo::FrontendCapabilities(); |
| 168 | caps.isdbs3Caps(FrontendIsdbs3Capabilities()); |
| 169 | mFrontendCaps[8] = caps; |
| 170 | statusCaps = { |
| 171 | FrontendStatusType::DEMOD_LOCK, |
| 172 | FrontendStatusType::MODULATION, |
| 173 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 174 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::ROLL_OFF), |
| 175 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::IS_SHORT_FRAMES), |
| 176 | }; |
| 177 | mFrontendStatusCaps[8] = statusCaps; |
| 178 | |
| 179 | statusCaps = { |
| 180 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::MODULATIONS), |
| 181 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::INTERLEAVINGS), |
| 182 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::BANDWIDTH), |
| 183 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::GUARD_INTERVAL), |
| 184 | static_cast<FrontendStatusType>(V1_1::FrontendStatusTypeExt1_1::TRANSMISSION_MODE), |
| 185 | }; |
| 186 | mFrontendStatusCaps[9] = statusCaps; |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 187 | |
| 188 | mLnbs.resize(2); |
| 189 | mLnbs[0] = new Lnb(0); |
| 190 | mLnbs[1] = new Lnb(1); |
| 191 | } |
| 192 | |
| 193 | Tuner::~Tuner() {} |
| 194 | |
| 195 | Return<void> Tuner::getFrontendIds(getFrontendIds_cb _hidl_cb) { |
| 196 | ALOGV("%s", __FUNCTION__); |
| 197 | |
| 198 | vector<FrontendId> frontendIds; |
| 199 | frontendIds.resize(mFrontendSize); |
| 200 | for (int i = 0; i < mFrontendSize; i++) { |
| 201 | frontendIds[i] = mFrontends[i]->getFrontendId(); |
| 202 | } |
| 203 | |
| 204 | _hidl_cb(Result::SUCCESS, frontendIds); |
| 205 | return Void(); |
| 206 | } |
| 207 | |
| 208 | Return<void> Tuner::openFrontendById(uint32_t frontendId, openFrontendById_cb _hidl_cb) { |
| 209 | ALOGV("%s", __FUNCTION__); |
| 210 | |
| 211 | if (frontendId >= mFrontendSize || frontendId < 0) { |
| 212 | ALOGW("[ WARN ] Frontend with id %d isn't available", frontendId); |
| 213 | _hidl_cb(Result::UNAVAILABLE, nullptr); |
| 214 | return Void(); |
| 215 | } |
| 216 | |
| 217 | _hidl_cb(Result::SUCCESS, mFrontends[frontendId]); |
| 218 | return Void(); |
| 219 | } |
| 220 | |
| 221 | Return<void> Tuner::openDemux(openDemux_cb _hidl_cb) { |
| 222 | ALOGV("%s", __FUNCTION__); |
| 223 | |
| 224 | uint32_t demuxId = mLastUsedId + 1; |
| 225 | mLastUsedId += 1; |
| 226 | sp<Demux> demux = new Demux(demuxId, this); |
| 227 | mDemuxes[demuxId] = demux; |
| 228 | |
| 229 | _hidl_cb(Result::SUCCESS, demuxId, demux); |
| 230 | return Void(); |
| 231 | } |
| 232 | |
| 233 | Return<void> Tuner::getDemuxCaps(getDemuxCaps_cb _hidl_cb) { |
| 234 | ALOGV("%s", __FUNCTION__); |
| 235 | |
| 236 | DemuxCapabilities caps; |
| 237 | |
| 238 | // IP filter can be an MMTP filter's data source. |
| 239 | caps.linkCaps = {0x00, 0x00, 0x02, 0x00, 0x00}; |
| 240 | _hidl_cb(Result::SUCCESS, caps); |
| 241 | return Void(); |
| 242 | } |
| 243 | |
| 244 | Return<void> Tuner::openDescrambler(openDescrambler_cb _hidl_cb) { |
| 245 | ALOGV("%s", __FUNCTION__); |
| 246 | |
| 247 | sp<V1_0::IDescrambler> descrambler = new Descrambler(); |
| 248 | |
| 249 | _hidl_cb(Result::SUCCESS, descrambler); |
| 250 | return Void(); |
| 251 | } |
| 252 | |
| 253 | Return<void> Tuner::getFrontendInfo(FrontendId frontendId, getFrontendInfo_cb _hidl_cb) { |
| 254 | ALOGV("%s", __FUNCTION__); |
| 255 | |
| 256 | FrontendInfo info; |
| 257 | if (frontendId >= mFrontendSize) { |
| 258 | _hidl_cb(Result::INVALID_ARGUMENT, info); |
| 259 | return Void(); |
| 260 | } |
| 261 | |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 262 | // assign randomly selected values for testing. |
| 263 | info = { |
| 264 | .type = mFrontends[frontendId]->getFrontendType(), |
| 265 | .minFrequency = 139, |
| 266 | .maxFrequency = 1139, |
| 267 | .minSymbolRate = 45, |
| 268 | .maxSymbolRate = 1145, |
| 269 | .acquireRange = 30, |
| 270 | .exclusiveGroupId = 57, |
Amy Zhang | 7394e62 | 2021-02-23 22:29:48 -0800 | [diff] [blame^] | 271 | .statusCaps = mFrontendStatusCaps[frontendId], |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 272 | .frontendCaps = mFrontendCaps[frontendId], |
| 273 | }; |
| 274 | |
| 275 | _hidl_cb(Result::SUCCESS, info); |
| 276 | return Void(); |
| 277 | } |
| 278 | |
| 279 | Return<void> Tuner::getLnbIds(getLnbIds_cb _hidl_cb) { |
| 280 | ALOGV("%s", __FUNCTION__); |
| 281 | |
| 282 | vector<V1_0::LnbId> lnbIds; |
| 283 | lnbIds.resize(mLnbs.size()); |
| 284 | for (int i = 0; i < lnbIds.size(); i++) { |
| 285 | lnbIds[i] = mLnbs[i]->getId(); |
| 286 | } |
| 287 | |
| 288 | _hidl_cb(Result::SUCCESS, lnbIds); |
| 289 | return Void(); |
| 290 | } |
| 291 | |
| 292 | Return<void> Tuner::openLnbById(V1_0::LnbId lnbId, openLnbById_cb _hidl_cb) { |
| 293 | ALOGV("%s", __FUNCTION__); |
| 294 | |
| 295 | if (lnbId >= mLnbs.size()) { |
| 296 | _hidl_cb(Result::INVALID_ARGUMENT, nullptr); |
| 297 | return Void(); |
| 298 | } |
| 299 | |
| 300 | _hidl_cb(Result::SUCCESS, mLnbs[lnbId]); |
| 301 | return Void(); |
| 302 | } |
| 303 | |
| 304 | sp<Frontend> Tuner::getFrontendById(uint32_t frontendId) { |
| 305 | ALOGV("%s", __FUNCTION__); |
| 306 | |
| 307 | return mFrontends[frontendId]; |
| 308 | } |
| 309 | |
| 310 | Return<void> Tuner::openLnbByName(const hidl_string& /*lnbName*/, openLnbByName_cb _hidl_cb) { |
| 311 | ALOGV("%s", __FUNCTION__); |
| 312 | |
| 313 | sp<V1_0::ILnb> lnb = new Lnb(); |
| 314 | |
| 315 | _hidl_cb(Result::SUCCESS, 1234, lnb); |
| 316 | return Void(); |
| 317 | } |
| 318 | |
Amy Zhang | 4c49c15 | 2020-08-25 21:08:19 -0700 | [diff] [blame] | 319 | Return<void> Tuner::getFrontendDtmbCapabilities(uint32_t frontendId, |
| 320 | getFrontendDtmbCapabilities_cb _hidl_cb) { |
| 321 | ALOGV("%s", __FUNCTION__); |
| 322 | |
| 323 | if (mFrontends[frontendId] != nullptr && |
| 324 | (mFrontends[frontendId]->getFrontendType() == |
| 325 | static_cast<V1_0::FrontendType>(V1_1::FrontendType::DTMB))) { |
| 326 | _hidl_cb(Result::SUCCESS, mDtmbCaps); |
| 327 | } else { |
| 328 | _hidl_cb(Result::UNAVAILABLE, mDtmbCaps); |
| 329 | } |
| 330 | return Void(); |
| 331 | } |
| 332 | |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 333 | void Tuner::setFrontendAsDemuxSource(uint32_t frontendId, uint32_t demuxId) { |
| 334 | mFrontendToDemux[frontendId] = demuxId; |
| 335 | if (mFrontends[frontendId] != nullptr && mFrontends[frontendId]->isLocked()) { |
| 336 | mDemuxes[demuxId]->startFrontendInputLoop(); |
| 337 | } |
| 338 | } |
| 339 | |
Amy Zhang | 80cb960 | 2020-07-15 13:06:39 -0700 | [diff] [blame] | 340 | void Tuner::removeDemux(uint32_t demuxId) { |
| 341 | map<uint32_t, uint32_t>::iterator it; |
Amy Zhang | 68afca6 | 2020-07-20 18:28:58 -0700 | [diff] [blame] | 342 | for (it = mFrontendToDemux.begin(); it != mFrontendToDemux.end(); it++) { |
Amy Zhang | 80cb960 | 2020-07-15 13:06:39 -0700 | [diff] [blame] | 343 | if (it->second == demuxId) { |
| 344 | it = mFrontendToDemux.erase(it); |
Amy Zhang | 68afca6 | 2020-07-20 18:28:58 -0700 | [diff] [blame] | 345 | break; |
Amy Zhang | 80cb960 | 2020-07-15 13:06:39 -0700 | [diff] [blame] | 346 | } |
| 347 | } |
| 348 | mDemuxes.erase(demuxId); |
| 349 | } |
| 350 | |
| 351 | void Tuner::removeFrontend(uint32_t frontendId) { |
| 352 | mFrontendToDemux.erase(frontendId); |
| 353 | } |
| 354 | |
Amy Zhang | bb94eeb | 2020-07-09 22:48:04 -0700 | [diff] [blame] | 355 | void Tuner::frontendStopTune(uint32_t frontendId) { |
| 356 | map<uint32_t, uint32_t>::iterator it = mFrontendToDemux.find(frontendId); |
| 357 | uint32_t demuxId; |
| 358 | if (it != mFrontendToDemux.end()) { |
| 359 | demuxId = it->second; |
| 360 | mDemuxes[demuxId]->stopFrontendInput(); |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | void Tuner::frontendStartTune(uint32_t frontendId) { |
| 365 | map<uint32_t, uint32_t>::iterator it = mFrontendToDemux.find(frontendId); |
| 366 | uint32_t demuxId; |
| 367 | if (it != mFrontendToDemux.end()) { |
| 368 | demuxId = it->second; |
| 369 | mDemuxes[demuxId]->startFrontendInputLoop(); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | } // namespace implementation |
| 374 | } // namespace V1_0 |
| 375 | } // namespace tuner |
| 376 | } // namespace tv |
| 377 | } // namespace hardware |
| 378 | } // namespace android |