1 /** 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 #ifndef ANDROID_MEDIA_TUNERDESCRAMBLER_H 18 #define ANDROID_MEDIA_TUNERDESCRAMBLER_H 19 20 #include <aidl/android/hardware/tv/tuner/IDescrambler.h> 21 #include <aidl/android/media/tv/tuner/BnTunerDescrambler.h> 22 23 using ::aidl::android::hardware::tv::tuner::DemuxPid; 24 using ::aidl::android::hardware::tv::tuner::IDescrambler; 25 26 using namespace std; 27 28 namespace aidl { 29 namespace android { 30 namespace media { 31 namespace tv { 32 namespace tuner { 33 34 class TunerDescrambler : public BnTunerDescrambler { 35 36 public: 37 TunerDescrambler(shared_ptr<IDescrambler> descrambler); 38 virtual ~TunerDescrambler(); 39 40 ::ndk::ScopedAStatus setDemuxSource(const shared_ptr<ITunerDemux>& in_tunerDemux) override; 41 ::ndk::ScopedAStatus setKeyToken(const vector<uint8_t>& in_keyToken) override; 42 ::ndk::ScopedAStatus addPid(const DemuxPid& in_pid, 43 const shared_ptr<ITunerFilter>& in_optionalSourceFilter) override; 44 ::ndk::ScopedAStatus removePid( 45 const DemuxPid& in_pid, 46 const shared_ptr<ITunerFilter>& in_optionalSourceFilter) override; 47 ::ndk::ScopedAStatus close() override; 48 49 private: 50 shared_ptr<IDescrambler> mDescrambler; 51 bool isClosed = false; 52 }; 53 54 } // namespace tuner 55 } // namespace tv 56 } // namespace media 57 } // namespace android 58 } // namespace aidl 59 60 #endif // ANDROID_MEDIA_TUNERDESCRAMBLER_H 61