blob: 1fbc780c342f1ee1b927a232d96acc022abc856b [file] [log] [blame]
Amy Zhangbb94eeb2020-07-09 22:48:04 -07001/*
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-Descrambler"
18
19#include <android/hardware/tv/tuner/1.0/IFrontendCallback.h>
20#include <utils/Log.h>
21
22#include "Descrambler.h"
23
24namespace android {
25namespace hardware {
26namespace tv {
27namespace tuner {
28namespace V1_0 {
29namespace implementation {
30
31Descrambler::Descrambler() {}
32
33Descrambler::~Descrambler() {}
34
35Return<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 %" PRIu32,
39 mSourceDemuxId);
40 return Result::INVALID_STATE;
41 }
42 mDemuxSet = true;
43 mSourceDemuxId = static_cast<uint32_t>(demuxId);
44
45 return Result::SUCCESS;
46}
47
48Return<Result> Descrambler::setKeyToken(const hidl_vec<uint8_t>& /* keyToken */) {
49 ALOGV("%s", __FUNCTION__);
50
51 return Result::SUCCESS;
52}
53
54Return<Result> Descrambler::addPid(const DemuxPid& /* pid */,
55 const sp<IFilter>& /* optionalSourceFilter */) {
56 ALOGV("%s", __FUNCTION__);
57
58 return Result::SUCCESS;
59}
60
61Return<Result> Descrambler::removePid(const DemuxPid& /* pid */,
62 const sp<IFilter>& /* optionalSourceFilter */) {
63 ALOGV("%s", __FUNCTION__);
64
65 return Result::SUCCESS;
66}
67
68Return<Result> Descrambler::close() {
69 ALOGV("%s", __FUNCTION__);
70 mDemuxSet = false;
71
72 return Result::SUCCESS;
73}
74
75} // namespace implementation
76} // namespace V1_0
77} // namespace tuner
78} // namespace tv
79} // namespace hardware
80} // namespace android