Amy | fd4243a | 2019-08-16 16:01:27 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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.0-Demux" |
| 18 | |
| 19 | #include "Demux.h" |
| 20 | #include <utils/Log.h> |
| 21 | |
| 22 | namespace android { |
| 23 | namespace hardware { |
| 24 | namespace tv { |
| 25 | namespace tuner { |
| 26 | namespace V1_0 { |
| 27 | namespace implementation { |
| 28 | |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 29 | #define WAIT_TIMEOUT 3000000000 |
| 30 | |
| 31 | const std::vector<uint8_t> fakeDataInputBuffer{ |
| 32 | 0x00, 0x00, 0x00, 0x01, 0x09, 0xf0, 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0xc0, 0x1e, 0xdb, |
| 33 | 0x01, 0x40, 0x16, 0xec, 0x04, 0x40, 0x00, 0x00, 0x03, 0x00, 0x40, 0x00, 0x00, 0x0f, 0x03, |
| 34 | 0xc5, 0x8b, 0xb8, 0x00, 0x00, 0x00, 0x01, 0x68, 0xca, 0x8c, 0xb2, 0x00, 0x00, 0x01, 0x06, |
| 35 | 0x05, 0xff, 0xff, 0x70, 0xdc, 0x45, 0xe9, 0xbd, 0xe6, 0xd9, 0x48, 0xb7, 0x96, 0x2c, 0xd8, |
| 36 | 0x20, 0xd9, 0x23, 0xee, 0xef, 0x78, 0x32, 0x36, 0x34, 0x20, 0x2d, 0x20, 0x63, 0x6f, 0x72, |
| 37 | 0x65, 0x20, 0x31, 0x34, 0x32, 0x20, 0x2d, 0x20, 0x48, 0x2e, 0x32, 0x36, 0x34, 0x2f, 0x4d, |
| 38 | 0x50, 0x45, 0x47, 0x2d, 0x34, 0x20, 0x41, 0x56, 0x43, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x63, |
| 39 | 0x20, 0x2d, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x6c, 0x65, 0x66, 0x74, 0x20, 0x32, 0x30, 0x30, |
| 40 | 0x33, 0x2d, 0x32, 0x30, 0x31, 0x34, 0x20, 0x2d, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, |
| 41 | 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x6c, 0x61, 0x6e, 0x2e, 0x6f, |
| 42 | 0x72, 0x67, 0x2f, 0x78, 0x32, 0x36, 0x34, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20, 0x2d, 0x20, |
| 43 | 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x20, 0x63, 0x61, 0x62, 0x61, 0x63, 0x3d, |
| 44 | 0x30, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x32, 0x20, 0x64, 0x65, 0x62, 0x6c, 0x6f, 0x63, 0x6b, |
| 45 | 0x3d, 0x31, 0x3a, 0x30, 0x3a, 0x30, 0x20, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x65, 0x3d, |
| 46 | 0x30, 0x78, 0x31, 0x3a, 0x30, 0x78, 0x31, 0x31, 0x31, 0x20, 0x6d, 0x65, 0x3d, 0x68, 0x65, |
| 47 | 0x78, 0x20, 0x73, 0x75, 0x62, 0x6d, 0x65, 0x3d, 0x37, 0x20, 0x70, 0x73, 0x79, 0x3d, 0x31, |
| 48 | 0x20, 0x70, 0x73, 0x79, 0x5f, 0x72, 0x64, 0x3d, 0x31, 0x2e, 0x30, 0x30, 0x3a, 0x30, 0x2e, |
| 49 | 0x30, 0x30, 0x20, 0x6d, 0x69, 0x78, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x3d, 0x31, 0x20, |
| 50 | 0x6d, 0x65, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x31, 0x36, 0x20, 0x63, 0x68, 0x72, |
| 51 | 0x6f, 0x6d, 0x61, 0x5f, 0x6d, 0x65, 0x3d, 0x31, 0x20, 0x74, 0x72, 0x65, 0x6c, 0x6c, 0x69, |
| 52 | 0x73, 0x3d, 0x31, 0x20, 0x38, 0x78, 0x38, 0x64, 0x63, 0x74, 0x3d, 0x30, 0x20, 0x63, 0x71, |
| 53 | 0x6d, 0x3d, 0x30, 0x20, 0x64, 0x65, 0x61, 0x64, 0x7a, 0x6f, 0x6e, 0x65, 0x3d, 0x32, 0x31, |
| 54 | 0x2c, 0x31, 0x31, 0x20, 0x66, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x73, 0x6b, 0x69, 0x70, 0x3d, |
| 55 | 0x31, 0x20, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x61, 0x5f, 0x71, 0x70, 0x5f, 0x6f, 0x66, 0x66, |
| 56 | 0x73, 0x65, 0x74, 0x3d, 0x2d, 0x32, 0x20, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x3d, |
| 57 | 0x36, 0x30, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x61, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x68, |
| 58 | 0x72, 0x65, 0x61, 0x64, 0x73, 0x3d, 0x35, 0x20, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x64, 0x5f, |
| 59 | 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x3d, 0x30, 0x20, 0x6e, 0x72, 0x3d, 0x30, 0x20, |
| 60 | 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x3d, 0x31, 0x20, 0x69, 0x6e, 0x74, 0x65, |
| 61 | 0x72, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x3d, 0x30, 0x20, 0x62, 0x6c, 0x75, 0x72, 0x61, 0x79, |
| 62 | 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x3d, 0x30, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, |
| 63 | 0x72, 0x61, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x61, 0x3d, 0x30, 0x20, |
| 64 | 0x62, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x3d, 0x30, 0x20, 0x77, 0x65, 0x69, 0x67, 0x68, |
| 65 | 0x74, 0x70, 0x3d, 0x30, 0x20, 0x6b, 0x65, 0x79, 0x69, 0x6e, 0x74, 0x3d, 0x32, 0x35, 0x30, |
| 66 | 0x20, 0x6b, 0x65, 0x79, 0x69, 0x6e, 0x74, 0x5f, 0x6d, 0x69, 0x6e, 0x3d, 0x32, 0x35, 0x20, |
| 67 | 0x73, 0x63, 0x65, 0x6e, 0x65, |
| 68 | }; |
| 69 | |
Amy | fd4243a | 2019-08-16 16:01:27 -0700 | [diff] [blame] | 70 | Demux::Demux(uint32_t demuxId) { |
| 71 | mDemuxId = demuxId; |
| 72 | } |
| 73 | |
| 74 | Demux::~Demux() {} |
| 75 | |
| 76 | Return<Result> Demux::setFrontendDataSource(uint32_t frontendId) { |
| 77 | ALOGV("%s", __FUNCTION__); |
| 78 | |
| 79 | mSourceFrontendId = frontendId; |
| 80 | |
| 81 | return Result::SUCCESS; |
| 82 | } |
| 83 | |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 84 | Return<void> Demux::addFilter(DemuxFilterType type, uint32_t bufferSize, |
| 85 | const sp<IDemuxCallback>& cb, addFilter_cb _hidl_cb) { |
| 86 | ALOGV("%s", __FUNCTION__); |
| 87 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 88 | uint32_t filterId; |
| 89 | |
| 90 | if (!mUnusedFilterIds.empty()) { |
| 91 | filterId = *mUnusedFilterIds.begin(); |
| 92 | |
| 93 | mUnusedFilterIds.erase(filterId); |
| 94 | } else { |
| 95 | filterId = ++mLastUsedFilterId; |
| 96 | |
| 97 | mDemuxCallbacks.resize(filterId + 1); |
| 98 | mFilterMQs.resize(filterId + 1); |
| 99 | mFilterEvents.resize(filterId + 1); |
| 100 | mFilterEventFlags.resize(filterId + 1); |
| 101 | mFilterThreadRunning.resize(filterId + 1); |
| 102 | mFilterThreads.resize(filterId + 1); |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 103 | mFilterPids.resize(filterId + 1); |
| 104 | mFilterOutputs.resize(filterId + 1); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | mUsedFilterIds.insert(filterId); |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 108 | |
| 109 | if ((type != DemuxFilterType::PCR || type != DemuxFilterType::TS) && cb == nullptr) { |
| 110 | ALOGW("callback can't be null"); |
| 111 | _hidl_cb(Result::INVALID_ARGUMENT, filterId); |
| 112 | return Void(); |
| 113 | } |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 114 | |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 115 | // Add callback |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 116 | mDemuxCallbacks[filterId] = cb; |
| 117 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 118 | // Mapping from the filter ID to the filter event |
| 119 | DemuxFilterEvent event{ |
| 120 | .filterId = filterId, |
| 121 | .filterType = type, |
| 122 | }; |
| 123 | mFilterEvents[filterId] = event; |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 124 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 125 | if (!createFilterMQ(bufferSize, filterId)) { |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 126 | _hidl_cb(Result::UNKNOWN_ERROR, -1); |
| 127 | return Void(); |
| 128 | } |
| 129 | |
| 130 | _hidl_cb(Result::SUCCESS, filterId); |
| 131 | return Void(); |
| 132 | } |
| 133 | |
| 134 | Return<void> Demux::getFilterQueueDesc(uint32_t filterId, getFilterQueueDesc_cb _hidl_cb) { |
| 135 | ALOGV("%s", __FUNCTION__); |
| 136 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 137 | if (mUsedFilterIds.find(filterId) == mUsedFilterIds.end()) { |
| 138 | ALOGW("No filter with id: %d exists to get desc", filterId); |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 139 | _hidl_cb(Result::INVALID_ARGUMENT, FilterMQ::Descriptor()); |
| 140 | return Void(); |
| 141 | } |
| 142 | |
| 143 | _hidl_cb(Result::SUCCESS, *mFilterMQs[filterId]->getDesc()); |
| 144 | return Void(); |
| 145 | } |
| 146 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 147 | Return<Result> Demux::configureFilter(uint32_t filterId, const DemuxFilterSettings& settings) { |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 148 | ALOGV("%s", __FUNCTION__); |
| 149 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 150 | switch (mFilterEvents[filterId].filterType) { |
| 151 | case DemuxFilterType::SECTION: |
| 152 | mFilterPids[filterId] = settings.section().tpid; |
| 153 | break; |
| 154 | case DemuxFilterType::PES: |
| 155 | mFilterPids[filterId] = settings.pesData().tpid; |
| 156 | break; |
| 157 | case DemuxFilterType::TS: |
| 158 | mFilterPids[filterId] = settings.ts().tpid; |
| 159 | break; |
| 160 | case DemuxFilterType::AUDIO: |
| 161 | mFilterPids[filterId] = settings.audio().tpid; |
| 162 | break; |
| 163 | case DemuxFilterType::VIDEO: |
| 164 | mFilterPids[filterId] = settings.video().tpid; |
| 165 | break; |
| 166 | case DemuxFilterType::RECORD: |
| 167 | mFilterPids[filterId] = settings.record().tpid; |
| 168 | break; |
| 169 | case DemuxFilterType::PCR: |
| 170 | mFilterPids[filterId] = settings.pcr().tpid; |
| 171 | break; |
| 172 | default: |
| 173 | return Result::UNKNOWN_ERROR; |
| 174 | } |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 175 | return Result::SUCCESS; |
| 176 | } |
| 177 | |
| 178 | Return<Result> Demux::startFilter(uint32_t filterId) { |
| 179 | ALOGV("%s", __FUNCTION__); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 180 | Result result; |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 181 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 182 | if (mUsedFilterIds.find(filterId) == mUsedFilterIds.end()) { |
| 183 | ALOGW("No filter with id: %d exists to start filter", filterId); |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 184 | return Result::INVALID_ARGUMENT; |
| 185 | } |
| 186 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 187 | result = startFilterLoop(filterId); |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 188 | |
| 189 | return result; |
| 190 | } |
| 191 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 192 | Return<Result> Demux::stopFilter(uint32_t filterId) { |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 193 | ALOGV("%s", __FUNCTION__); |
| 194 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 195 | mFilterThreadRunning[filterId] = false; |
| 196 | |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 197 | return Result::SUCCESS; |
| 198 | } |
| 199 | |
| 200 | Return<Result> Demux::flushFilter(uint32_t /* filterId */) { |
| 201 | ALOGV("%s", __FUNCTION__); |
| 202 | |
| 203 | return Result::SUCCESS; |
| 204 | } |
| 205 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 206 | Return<Result> Demux::removeFilter(uint32_t filterId) { |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 207 | ALOGV("%s", __FUNCTION__); |
| 208 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 209 | // resetFilterRecords(filterId); |
| 210 | mUsedFilterIds.erase(filterId); |
| 211 | mUnusedFilterIds.insert(filterId); |
| 212 | |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 213 | return Result::SUCCESS; |
| 214 | } |
| 215 | |
| 216 | Return<void> Demux::getAvSyncHwId(uint32_t /* filterId */, getAvSyncHwId_cb _hidl_cb) { |
| 217 | ALOGV("%s", __FUNCTION__); |
| 218 | |
| 219 | AvSyncHwId avSyncHwId = 0; |
| 220 | |
| 221 | _hidl_cb(Result::SUCCESS, avSyncHwId); |
| 222 | return Void(); |
| 223 | } |
| 224 | |
| 225 | Return<void> Demux::getAvSyncTime(AvSyncHwId /* avSyncHwId */, getAvSyncTime_cb _hidl_cb) { |
| 226 | ALOGV("%s", __FUNCTION__); |
| 227 | |
| 228 | uint64_t avSyncTime = 0; |
| 229 | |
| 230 | _hidl_cb(Result::SUCCESS, avSyncTime); |
| 231 | return Void(); |
| 232 | } |
| 233 | |
Amy | fd4243a | 2019-08-16 16:01:27 -0700 | [diff] [blame] | 234 | Return<Result> Demux::close() { |
| 235 | ALOGV("%s", __FUNCTION__); |
| 236 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 237 | set<uint32_t>::iterator it; |
| 238 | mInputThread = 0; |
| 239 | mOutputThread = 0; |
| 240 | mFilterThreads.clear(); |
| 241 | mUnusedFilterIds.clear(); |
| 242 | mUsedFilterIds.clear(); |
| 243 | mDemuxCallbacks.clear(); |
| 244 | mFilterMQs.clear(); |
| 245 | mFilterEvents.clear(); |
| 246 | mFilterEventFlags.clear(); |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 247 | mFilterOutputs.clear(); |
| 248 | mFilterPids.clear(); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 249 | mLastUsedFilterId = -1; |
| 250 | |
Amy | fd4243a | 2019-08-16 16:01:27 -0700 | [diff] [blame] | 251 | return Result::SUCCESS; |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 254 | Return<Result> Demux::addOutput(uint32_t bufferSize, const sp<IDemuxCallback>& cb) { |
| 255 | ALOGV("%s", __FUNCTION__); |
| 256 | |
| 257 | // Create a synchronized FMQ that supports blocking read/write |
| 258 | std::unique_ptr<FilterMQ> tmpFilterMQ = |
| 259 | std::unique_ptr<FilterMQ>(new (std::nothrow) FilterMQ(bufferSize, true)); |
| 260 | if (!tmpFilterMQ->isValid()) { |
| 261 | ALOGW("Failed to create output FMQ"); |
| 262 | return Result::UNKNOWN_ERROR; |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 263 | } |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 264 | |
| 265 | mOutputMQ = std::move(tmpFilterMQ); |
| 266 | |
| 267 | if (EventFlag::createEventFlag(mOutputMQ->getEventFlagWord(), &mOutputEventFlag) != OK) { |
| 268 | return Result::UNKNOWN_ERROR; |
| 269 | } |
| 270 | |
| 271 | mOutputCallback = cb; |
| 272 | |
| 273 | return Result::SUCCESS; |
| 274 | } |
| 275 | |
| 276 | Return<void> Demux::getOutputQueueDesc(getOutputQueueDesc_cb _hidl_cb) { |
| 277 | ALOGV("%s", __FUNCTION__); |
| 278 | |
| 279 | if (!mOutputMQ) { |
| 280 | _hidl_cb(Result::NOT_INITIALIZED, FilterMQ::Descriptor()); |
| 281 | return Void(); |
| 282 | } |
| 283 | |
| 284 | _hidl_cb(Result::SUCCESS, *mOutputMQ->getDesc()); |
| 285 | return Void(); |
| 286 | } |
| 287 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 288 | Return<Result> Demux::configureOutput(const DemuxOutputSettings& settings) { |
| 289 | ALOGV("%s", __FUNCTION__); |
| 290 | |
| 291 | mOutputConfigured = true; |
| 292 | mOutputSettings = settings; |
| 293 | return Result::SUCCESS; |
| 294 | } |
| 295 | |
| 296 | Return<Result> Demux::attachOutputFilter(uint32_t /*filterId*/) { |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 297 | ALOGV("%s", __FUNCTION__); |
| 298 | |
| 299 | return Result::SUCCESS; |
| 300 | } |
| 301 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 302 | Return<Result> Demux::detachOutputFilter(uint32_t /* filterId */) { |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 303 | ALOGV("%s", __FUNCTION__); |
| 304 | |
| 305 | return Result::SUCCESS; |
| 306 | } |
| 307 | |
| 308 | Return<Result> Demux::startOutput() { |
| 309 | ALOGV("%s", __FUNCTION__); |
| 310 | |
| 311 | return Result::SUCCESS; |
| 312 | } |
| 313 | |
| 314 | Return<Result> Demux::stopOutput() { |
| 315 | ALOGV("%s", __FUNCTION__); |
| 316 | |
| 317 | return Result::SUCCESS; |
| 318 | } |
| 319 | |
| 320 | Return<Result> Demux::flushOutput() { |
| 321 | ALOGV("%s", __FUNCTION__); |
| 322 | |
| 323 | return Result::SUCCESS; |
| 324 | } |
| 325 | |
| 326 | Return<Result> Demux::removeOutput() { |
| 327 | ALOGV("%s", __FUNCTION__); |
| 328 | |
| 329 | return Result::SUCCESS; |
| 330 | } |
| 331 | |
| 332 | Return<Result> Demux::addInput(uint32_t bufferSize, const sp<IDemuxCallback>& cb) { |
| 333 | ALOGV("%s", __FUNCTION__); |
| 334 | |
| 335 | // Create a synchronized FMQ that supports blocking read/write |
| 336 | std::unique_ptr<FilterMQ> tmpInputMQ = |
| 337 | std::unique_ptr<FilterMQ>(new (std::nothrow) FilterMQ(bufferSize, true)); |
| 338 | if (!tmpInputMQ->isValid()) { |
| 339 | ALOGW("Failed to create input FMQ"); |
| 340 | return Result::UNKNOWN_ERROR; |
| 341 | } |
| 342 | |
| 343 | mInputMQ = std::move(tmpInputMQ); |
| 344 | |
| 345 | if (EventFlag::createEventFlag(mInputMQ->getEventFlagWord(), &mInputEventFlag) != OK) { |
| 346 | return Result::UNKNOWN_ERROR; |
| 347 | } |
| 348 | |
| 349 | mInputCallback = cb; |
| 350 | |
| 351 | return Result::SUCCESS; |
| 352 | } |
| 353 | |
| 354 | Return<void> Demux::getInputQueueDesc(getInputQueueDesc_cb _hidl_cb) { |
| 355 | ALOGV("%s", __FUNCTION__); |
| 356 | |
| 357 | if (!mInputMQ) { |
| 358 | _hidl_cb(Result::NOT_INITIALIZED, FilterMQ::Descriptor()); |
| 359 | return Void(); |
| 360 | } |
| 361 | |
| 362 | _hidl_cb(Result::SUCCESS, *mInputMQ->getDesc()); |
| 363 | return Void(); |
| 364 | } |
| 365 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 366 | Return<Result> Demux::configureInput(const DemuxInputSettings& settings) { |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 367 | ALOGV("%s", __FUNCTION__); |
| 368 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 369 | mInputConfigured = true; |
| 370 | mInputSettings = settings; |
| 371 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 372 | return Result::SUCCESS; |
| 373 | } |
| 374 | |
| 375 | Return<Result> Demux::startInput() { |
| 376 | ALOGV("%s", __FUNCTION__); |
| 377 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 378 | if (!mInputCallback) { |
| 379 | return Result::NOT_INITIALIZED; |
| 380 | } |
| 381 | |
| 382 | if (!mInputConfigured) { |
| 383 | return Result::INVALID_STATE; |
| 384 | } |
| 385 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 386 | pthread_create(&mInputThread, NULL, __threadLoopInput, this); |
| 387 | pthread_setname_np(mInputThread, "demux_input_waiting_loop"); |
| 388 | |
| 389 | // TODO start another thread to send filter status callback to the framework |
| 390 | |
| 391 | return Result::SUCCESS; |
| 392 | } |
| 393 | |
| 394 | Return<Result> Demux::stopInput() { |
| 395 | ALOGV("%s", __FUNCTION__); |
| 396 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 397 | mInputThreadRunning = false; |
| 398 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 399 | return Result::SUCCESS; |
| 400 | } |
| 401 | |
| 402 | Return<Result> Demux::flushInput() { |
| 403 | ALOGV("%s", __FUNCTION__); |
| 404 | |
| 405 | return Result::SUCCESS; |
| 406 | } |
| 407 | |
| 408 | Return<Result> Demux::removeInput() { |
| 409 | ALOGV("%s", __FUNCTION__); |
| 410 | |
| 411 | mInputMQ = nullptr; |
| 412 | |
| 413 | return Result::SUCCESS; |
| 414 | } |
| 415 | |
| 416 | Result Demux::startFilterLoop(uint32_t filterId) { |
| 417 | struct ThreadArgs* threadArgs = (struct ThreadArgs*)malloc(sizeof(struct ThreadArgs)); |
| 418 | threadArgs->user = this; |
| 419 | threadArgs->filterId = filterId; |
| 420 | |
| 421 | pthread_t mFilterThread; |
| 422 | pthread_create(&mFilterThread, NULL, __threadLoopFilter, (void*)threadArgs); |
| 423 | mFilterThreads[filterId] = mFilterThread; |
| 424 | pthread_setname_np(mFilterThread, "demux_filter_waiting_loop"); |
| 425 | |
| 426 | return Result::SUCCESS; |
| 427 | } |
| 428 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 429 | Result Demux::startSectionFilterHandler(uint32_t filterId) { |
| 430 | if (mFilterOutputs[filterId].empty()) { |
| 431 | return Result::SUCCESS; |
| 432 | } |
| 433 | if (!writeSectionsAndCreateEvent(filterId, mFilterOutputs[filterId])) { |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 434 | ALOGD("[Demux] filter %d fails to write into FMQ. Ending thread", filterId); |
| 435 | return Result::UNKNOWN_ERROR; |
| 436 | } |
| 437 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 438 | mFilterOutputs[filterId].clear(); |
| 439 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 440 | return Result::SUCCESS; |
| 441 | } |
| 442 | |
| 443 | Result Demux::startPesFilterHandler(uint32_t filterId) { |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 444 | std::lock_guard<std::mutex> lock(mFilterEventLock); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 445 | DemuxFilterPesEvent pesEvent; |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 446 | if (mFilterOutputs[filterId].empty()) { |
| 447 | return Result::SUCCESS; |
| 448 | } |
| 449 | |
| 450 | // TODO extract PES from TS |
| 451 | if (!writeDataToFilterMQ(mFilterOutputs[filterId], filterId)) { |
| 452 | mFilterOutputs[filterId].clear(); |
| 453 | return Result::INVALID_STATE; |
| 454 | } |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 455 | pesEvent = { |
| 456 | // temp dump meta data |
| 457 | .streamId = 0, |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 458 | .dataLength = static_cast<uint16_t>(mFilterOutputs[filterId].size()), |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 459 | }; |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 460 | int size = mFilterEvents[filterId].events.size(); |
| 461 | mFilterEvents[filterId].events.resize(size + 1); |
| 462 | mFilterEvents[filterId].events[size].pes(pesEvent); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 463 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 464 | mFilterOutputs[filterId].clear(); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 465 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 466 | return Result::SUCCESS; |
| 467 | } |
| 468 | |
| 469 | Result Demux::startTsFilterHandler() { |
| 470 | // TODO handle starting TS filter |
| 471 | return Result::SUCCESS; |
| 472 | } |
| 473 | |
| 474 | Result Demux::startMediaFilterHandler(uint32_t filterId) { |
| 475 | DemuxFilterMediaEvent mediaEvent; |
| 476 | mediaEvent = { |
| 477 | // temp dump meta data |
| 478 | .pts = 0, |
| 479 | .dataLength = 530, |
| 480 | .secureMemory = nullptr, |
| 481 | }; |
| 482 | mFilterEvents[filterId].events.resize(1); |
| 483 | mFilterEvents[filterId].events[0].media() = mediaEvent; |
| 484 | // TODO handle write FQM for media stream |
| 485 | return Result::SUCCESS; |
| 486 | } |
| 487 | |
| 488 | Result Demux::startRecordFilterHandler(uint32_t filterId) { |
| 489 | DemuxFilterRecordEvent recordEvent; |
| 490 | recordEvent = { |
| 491 | // temp dump meta data |
| 492 | .tpid = 0, |
| 493 | .packetNum = 0, |
| 494 | }; |
| 495 | recordEvent.indexMask.tsIndexMask() = 0x01; |
| 496 | mFilterEvents[filterId].events.resize(1); |
| 497 | mFilterEvents[filterId].events[0].ts() = recordEvent; |
| 498 | return Result::SUCCESS; |
| 499 | } |
| 500 | |
| 501 | Result Demux::startPcrFilterHandler() { |
| 502 | // TODO handle starting PCR filter |
| 503 | return Result::SUCCESS; |
| 504 | } |
| 505 | |
| 506 | bool Demux::createFilterMQ(uint32_t bufferSize, uint32_t filterId) { |
| 507 | ALOGV("%s", __FUNCTION__); |
| 508 | |
| 509 | // Create a synchronized FMQ that supports blocking read/write |
| 510 | std::unique_ptr<FilterMQ> tmpFilterMQ = |
| 511 | std::unique_ptr<FilterMQ>(new (std::nothrow) FilterMQ(bufferSize, true)); |
| 512 | if (!tmpFilterMQ->isValid()) { |
| 513 | ALOGW("Failed to create FMQ of filter with id: %d", filterId); |
| 514 | return false; |
| 515 | } |
| 516 | |
| 517 | mFilterMQs[filterId] = std::move(tmpFilterMQ); |
| 518 | |
| 519 | EventFlag* filterEventFlag; |
| 520 | if (EventFlag::createEventFlag(mFilterMQs[filterId]->getEventFlagWord(), &filterEventFlag) != |
| 521 | OK) { |
| 522 | return false; |
| 523 | } |
| 524 | mFilterEventFlags[filterId] = filterEventFlag; |
| 525 | |
| 526 | return true; |
| 527 | } |
| 528 | |
| 529 | bool Demux::writeSectionsAndCreateEvent(uint32_t filterId, vector<uint8_t> data) { |
| 530 | // TODO check how many sections has been read |
| 531 | std::lock_guard<std::mutex> lock(mFilterEventLock); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 532 | if (!writeDataToFilterMQ(data, filterId)) { |
| 533 | return false; |
| 534 | } |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 535 | int size = mFilterEvents[filterId].events.size(); |
| 536 | mFilterEvents[filterId].events.resize(size + 1); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 537 | DemuxFilterSectionEvent secEvent; |
| 538 | secEvent = { |
| 539 | // temp dump meta data |
| 540 | .tableId = 0, |
| 541 | .version = 1, |
| 542 | .sectionNum = 1, |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 543 | .dataLength = static_cast<uint16_t>(data.size()), |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 544 | }; |
| 545 | mFilterEvents[filterId].events[size].section(secEvent); |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 546 | return true; |
| 547 | } |
| 548 | |
| 549 | bool Demux::writeDataToFilterMQ(const std::vector<uint8_t>& data, uint32_t filterId) { |
| 550 | std::lock_guard<std::mutex> lock(mWriteLock); |
| 551 | if (mFilterMQs[filterId]->write(data.data(), data.size())) { |
| 552 | return true; |
| 553 | } |
| 554 | return false; |
| 555 | } |
| 556 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 557 | bool Demux::filterAndOutputData() { |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 558 | Result result; |
| 559 | set<uint32_t>::iterator it; |
| 560 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 561 | // Read input data from the input FMQ |
| 562 | int size = mInputMQ->availableToRead(); |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 563 | int inputPacketSize = mInputSettings.packetSize; |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 564 | vector<uint8_t> dataOutputBuffer; |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 565 | dataOutputBuffer.resize(inputPacketSize); |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 566 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 567 | // Dispatch the packet to the PID matching filter output buffer |
| 568 | for (int i = 0; i < size / inputPacketSize; i++) { |
| 569 | mInputMQ->read(dataOutputBuffer.data(), inputPacketSize); |
| 570 | for (it = mUsedFilterIds.begin(); it != mUsedFilterIds.end(); it++) { |
| 571 | uint16_t pid = ((dataOutputBuffer[1] & 0x1f) << 8) | ((dataOutputBuffer[2] & 0xff)); |
| 572 | if (pid == mFilterPids[*it]) { |
| 573 | mFilterOutputs[*it].insert(mFilterOutputs[*it].end(), dataOutputBuffer.begin(), |
| 574 | dataOutputBuffer.end()); |
| 575 | } |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | // Handle the output data per filter type |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 580 | for (it = mUsedFilterIds.begin(); it != mUsedFilterIds.end(); it++) { |
| 581 | switch (mFilterEvents[*it].filterType) { |
| 582 | case DemuxFilterType::SECTION: |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 583 | result = startSectionFilterHandler(*it); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 584 | break; |
| 585 | case DemuxFilterType::PES: |
| 586 | result = startPesFilterHandler(*it); |
| 587 | break; |
| 588 | case DemuxFilterType::TS: |
| 589 | result = startTsFilterHandler(); |
| 590 | break; |
| 591 | case DemuxFilterType::AUDIO: |
| 592 | case DemuxFilterType::VIDEO: |
| 593 | result = startMediaFilterHandler(*it); |
| 594 | break; |
| 595 | case DemuxFilterType::RECORD: |
| 596 | result = startRecordFilterHandler(*it); |
| 597 | break; |
| 598 | case DemuxFilterType::PCR: |
| 599 | result = startPcrFilterHandler(); |
| 600 | break; |
| 601 | default: |
| 602 | return false; |
| 603 | } |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 604 | } |
| 605 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 606 | return result == Result::SUCCESS; |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 607 | } |
| 608 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 609 | void* Demux::__threadLoopFilter(void* threadArg) { |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 610 | Demux* const self = static_cast<Demux*>(((struct ThreadArgs*)threadArg)->user); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 611 | self->filterThreadLoop(((struct ThreadArgs*)threadArg)->filterId); |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 612 | return 0; |
| 613 | } |
| 614 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 615 | void* Demux::__threadLoopInput(void* user) { |
| 616 | Demux* const self = static_cast<Demux*>(user); |
| 617 | self->inputThreadLoop(); |
| 618 | return 0; |
| 619 | } |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 620 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 621 | void Demux::filterThreadLoop(uint32_t filterId) { |
| 622 | ALOGD("[Demux] filter %d threadLoop start.", filterId); |
| 623 | mFilterThreadRunning[filterId] = true; |
| 624 | |
| 625 | // For the first time of filter output, implementation needs to send the filter |
| 626 | // Event Callback without waiting for the DATA_CONSUMED to init the process. |
| 627 | while (mFilterThreadRunning[filterId]) { |
| 628 | if (mFilterEvents[filterId].events.size() == 0) { |
| 629 | ALOGD("[Demux] wait for filter data output."); |
| 630 | usleep(1000 * 1000); |
| 631 | continue; |
| 632 | } |
| 633 | // After successfully write, send a callback and wait for the read to be done |
| 634 | mDemuxCallbacks[filterId]->onFilterEvent(mFilterEvents[filterId]); |
| 635 | mFilterEvents[filterId].events.resize(0); |
| 636 | break; |
| 637 | } |
| 638 | |
| 639 | while (mFilterThreadRunning[filterId]) { |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 640 | uint32_t efState = 0; |
| 641 | // We do not wait for the last round of writen data to be read to finish the thread |
| 642 | // because the VTS can verify the reading itself. |
| 643 | for (int i = 0; i < SECTION_WRITE_COUNT; i++) { |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 644 | while (mFilterThreadRunning[filterId]) { |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 645 | status_t status = mFilterEventFlags[filterId]->wait( |
| 646 | static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_CONSUMED), &efState, |
| 647 | WAIT_TIMEOUT, true /* retry on spurious wake */); |
| 648 | if (status != OK) { |
| 649 | ALOGD("[Demux] wait for data consumed"); |
| 650 | continue; |
| 651 | } |
| 652 | break; |
| 653 | } |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 654 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 655 | if (mDemuxCallbacks[filterId] == nullptr) { |
| 656 | ALOGD("[Demux] filter %d does not hava callback. Ending thread", filterId); |
| 657 | break; |
| 658 | } |
| 659 | |
| 660 | while (mFilterThreadRunning[filterId]) { |
| 661 | std::lock_guard<std::mutex> lock(mFilterEventLock); |
| 662 | if (mFilterEvents[filterId].events.size() == 0) { |
| 663 | continue; |
| 664 | } |
| 665 | // After successfully write, send a callback and wait for the read to be done |
| 666 | mDemuxCallbacks[filterId]->onFilterEvent(mFilterEvents[filterId]); |
| 667 | mFilterEvents[filterId].events.resize(0); |
| 668 | break; |
| 669 | } |
| 670 | // We do not wait for the last read to be done |
| 671 | // VTS can verify the read result itself. |
| 672 | if (i == SECTION_WRITE_COUNT - 1) { |
| 673 | ALOGD("[Demux] filter %d writing done. Ending thread", filterId); |
| 674 | break; |
| 675 | } |
| 676 | } |
| 677 | mFilterThreadRunning[filterId] = false; |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame] | 678 | } |
| 679 | |
| 680 | ALOGD("[Demux] filter thread ended."); |
Amy | fd4243a | 2019-08-16 16:01:27 -0700 | [diff] [blame] | 681 | } |
| 682 | |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 683 | void Demux::inputThreadLoop() { |
| 684 | ALOGD("[Demux] input threadLoop start."); |
| 685 | mInputThreadRunning = true; |
| 686 | |
| 687 | while (mInputThreadRunning) { |
| 688 | uint32_t efState = 0; |
| 689 | status_t status = |
| 690 | mInputEventFlag->wait(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_READY), |
| 691 | &efState, WAIT_TIMEOUT, true /* retry on spurious wake */); |
| 692 | if (status != OK) { |
| 693 | ALOGD("[Demux] wait for data ready on the input FMQ"); |
| 694 | continue; |
| 695 | } |
| 696 | // Our current implementation filter the data and write it into the filter FMQ immedaitely |
| 697 | // after the DATA_READY from the VTS/framework |
| 698 | if (!filterAndOutputData()) { |
| 699 | ALOGD("[Demux] input data failed to be filtered. Ending thread"); |
| 700 | break; |
| 701 | } |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 702 | |
| 703 | maySendInputStatusCallback(); |
Amy | a488529 | 2019-09-06 10:30:53 -0700 | [diff] [blame] | 704 | } |
| 705 | |
| 706 | mInputThreadRunning = false; |
| 707 | ALOGD("[Demux] input thread ended."); |
| 708 | } |
| 709 | |
Amy | 42a5b4b | 2019-10-03 16:49:48 -0700 | [diff] [blame^] | 710 | void Demux::maySendInputStatusCallback() { |
| 711 | std::lock_guard<std::mutex> lock(mInputStatusLock); |
| 712 | int availableToRead = mInputMQ->availableToRead(); |
| 713 | int availableToWrite = mInputMQ->availableToWrite(); |
| 714 | |
| 715 | DemuxInputStatus newStatus = |
| 716 | checkStatusChange(availableToWrite, availableToRead, mInputSettings.highThreshold, |
| 717 | mInputSettings.lowThreshold); |
| 718 | if (mIntputStatus != newStatus) { |
| 719 | mInputCallback->onInputStatus(newStatus); |
| 720 | mIntputStatus = newStatus; |
| 721 | } |
| 722 | } |
| 723 | |
| 724 | DemuxInputStatus Demux::checkStatusChange(uint32_t availableToWrite, uint32_t availableToRead, |
| 725 | uint32_t highThreshold, uint32_t lowThreshold) { |
| 726 | if (availableToWrite == 0) { |
| 727 | return DemuxInputStatus::SPACE_FULL; |
| 728 | } else if (availableToRead > highThreshold) { |
| 729 | return DemuxInputStatus::SPACE_ALMOST_FULL; |
| 730 | } else if (availableToRead < lowThreshold) { |
| 731 | return DemuxInputStatus::SPACE_ALMOST_EMPTY; |
| 732 | } else if (availableToRead == 0) { |
| 733 | return DemuxInputStatus::SPACE_EMPTY; |
| 734 | } |
| 735 | return mIntputStatus; |
| 736 | } |
| 737 | |
Amy | fd4243a | 2019-08-16 16:01:27 -0700 | [diff] [blame] | 738 | } // namespace implementation |
| 739 | } // namespace V1_0 |
| 740 | } // namespace tuner |
| 741 | } // namespace tv |
| 742 | } // namespace hardware |
| 743 | } // namespace android |