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-Descrambler" |
| 18 | |
| 19 | #include <android/hardware/tv/tuner/1.0/IFrontendCallback.h> |
| 20 | #include <utils/Log.h> |
| 21 | |
| 22 | #include "Descrambler.h" |
| 23 | |
| 24 | namespace android { |
| 25 | namespace hardware { |
| 26 | namespace tv { |
| 27 | namespace tuner { |
| 28 | namespace V1_0 { |
| 29 | namespace implementation { |
| 30 | |
| 31 | Descrambler::Descrambler() {} |
| 32 | |
| 33 | Descrambler::~Descrambler() {} |
| 34 | |
| 35 | Return<Result> Descrambler::setDemuxSource(uint32_t demuxId) { |
| 36 | ALOGV("%s", __FUNCTION__); |
| 37 | if (mDemuxSet) { |
| 38 | ALOGW("[ WARN ] Descrambler has already been set with a demux id %d", mSourceDemuxId); |
| 39 | return Result::INVALID_STATE; |
| 40 | } |
| 41 | mDemuxSet = true; |
| 42 | mSourceDemuxId = demuxId; |
| 43 | |
| 44 | return Result::SUCCESS; |
| 45 | } |
| 46 | |
Amy | a609d5a | 2019-08-23 14:38:31 -0700 | [diff] [blame^] | 47 | Return<Result> Descrambler::setKeyToken(const hidl_vec<uint8_t>& /* keyToken */) { |
| 48 | ALOGV("%s", __FUNCTION__); |
| 49 | |
| 50 | return Result::SUCCESS; |
| 51 | } |
| 52 | |
| 53 | Return<Result> Descrambler::addPid(uint16_t /* pid */) { |
| 54 | ALOGV("%s", __FUNCTION__); |
| 55 | |
| 56 | return Result::SUCCESS; |
| 57 | } |
| 58 | |
| 59 | Return<Result> Descrambler::removePid(uint16_t /* pid */) { |
| 60 | ALOGV("%s", __FUNCTION__); |
| 61 | |
| 62 | return Result::SUCCESS; |
| 63 | } |
| 64 | |
Amy | fd4243a | 2019-08-16 16:01:27 -0700 | [diff] [blame] | 65 | Return<Result> Descrambler::close() { |
| 66 | ALOGV("%s", __FUNCTION__); |
| 67 | mDemuxSet = false; |
| 68 | |
| 69 | return Result::SUCCESS; |
| 70 | } |
| 71 | |
| 72 | } // namespace implementation |
| 73 | } // namespace V1_0 |
| 74 | } // namespace tuner |
| 75 | } // namespace tv |
| 76 | } // namespace hardware |
| 77 | } // namespace android |