blob: 8af3a9283085f7c6e35a2a07192c107ff9629955 [file] [log] [blame]
Hongguang4092f2f2021-07-08 18:49:12 -07001/*
2 * Copyright 2021 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_NDEBUG 0
18#define LOG_TAG "android.hardware.tv.tuner-service.example-Descrambler"
19
20#include <aidl/android/hardware/tv/tuner/IFrontendCallback.h>
21#include <utils/Log.h>
22
23#include "Descrambler.h"
24
25namespace aidl {
26namespace android {
27namespace hardware {
28namespace tv {
29namespace tuner {
30
31Descrambler::Descrambler() {}
32
33Descrambler::~Descrambler() {}
34
35::ndk::ScopedAStatus Descrambler::setDemuxSource(int32_t in_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 ::ndk::ScopedAStatus::fromExceptionCode(STATUS_INVALID_OPERATION);
41 }
42 mDemuxSet = true;
43 mSourceDemuxId = in_demuxId;
44
45 return ::ndk::ScopedAStatus::ok();
46}
47
48::ndk::ScopedAStatus Descrambler::setKeyToken(const std::vector<uint8_t>& /* in_keyToken */) {
49 ALOGV("%s", __FUNCTION__);
50
51 return ::ndk::ScopedAStatus::ok();
52}
53
54::ndk::ScopedAStatus Descrambler::addPid(
55 const DemuxPid& /* in_pid */,
56 const std::shared_ptr<IFilter>& /* in_optionalSourceFilter */) {
57 ALOGV("%s", __FUNCTION__);
58
59 return ::ndk::ScopedAStatus::ok();
60}
61
62::ndk::ScopedAStatus Descrambler::removePid(
63 const DemuxPid& /* in_pid */,
64 const std::shared_ptr<IFilter>& /* in_optionalSourceFilter */) {
65 ALOGV("%s", __FUNCTION__);
66
67 return ::ndk::ScopedAStatus::ok();
68}
69
70::ndk::ScopedAStatus Descrambler::close() {
71 ALOGV("%s", __FUNCTION__);
72 mDemuxSet = false;
73
74 return ::ndk::ScopedAStatus::ok();
75}
76
77} // namespace tuner
78} // namespace tv
79} // namespace hardware
80} // namespace android
81} // namespace aidl