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 #ifndef ANDROID_HARDWARE_TV_TUNER_V1_1_DESCRAMBLER_H_
18 #define ANDROID_HARDWARE_TV_TUNER_V1_1_DESCRAMBLER_H_
19 
20 #include <android/hardware/tv/tuner/1.0/IDescrambler.h>
21 #include <android/hardware/tv/tuner/1.1/ITuner.h>
22 #include <inttypes.h>
23 
24 using namespace std;
25 
26 namespace android {
27 namespace hardware {
28 namespace tv {
29 namespace tuner {
30 namespace V1_0 {
31 namespace implementation {
32 
33 class Descrambler : public IDescrambler {
34   public:
35     Descrambler();
36 
37     virtual Return<Result> setDemuxSource(uint32_t demuxId) override;
38 
39     virtual Return<Result> setKeyToken(const hidl_vec<uint8_t>& keyToken) override;
40 
41     virtual Return<Result> addPid(const DemuxPid& pid,
42                                   const sp<IFilter>& optionalSourceFilter) override;
43 
44     virtual Return<Result> removePid(const DemuxPid& pid,
45                                      const sp<IFilter>& optionalSourceFilter) override;
46 
47     virtual Return<Result> close() override;
48 
49   private:
50     virtual ~Descrambler();
51     uint32_t mSourceDemuxId;
52     bool mDemuxSet = false;
53 };
54 
55 }  // namespace implementation
56 }  // namespace V1_0
57 }  // namespace tuner
58 }  // namespace tv
59 }  // namespace hardware
60 }  // namespace android
61 
62 #endif  // ANDROID_HARDWARE_TV_TUNER_V1_DESCRAMBLER_H_
63