/* * Copyright 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _ANDROID_MEDIA_TV_DESCRAMBLER_CLIENT_H_ #define _ANDROID_MEDIA_TV_DESCRAMBLER_CLIENT_H_ #include #include #include "DemuxClient.h" #include "FilterClient.h" using ::aidl::android::hardware::tv::tuner::DemuxPid; using ::aidl::android::hardware::tv::tuner::Result; using ::aidl::android::media::tv::tuner::ITunerDescrambler; using namespace std; namespace android { struct DescramblerClient : public RefBase { public: DescramblerClient(shared_ptr tunerDescrambler); ~DescramblerClient(); /** * Set a demux as source of the descrambler. */ Result setDemuxSource(sp demuxClient); /** * Set a key token to link descrambler to a key slot. */ Result setKeyToken(vector keyToken); /** * Add packets' PID to the descrambler for descrambling. */ Result addPid(DemuxPid pid, sp optionalSourceFilter); /** * Remove packets' PID from the descrambler. */ Result removePid(DemuxPid pid, sp optionalSourceFilter); /** * Close a new interface of ITunerDescrambler. */ Result close(); private: /** * An AIDL Tuner Descrambler Singleton assigned at the first time the Tuner Client * opens a descrambler. Default null when descrambler is not opened. */ shared_ptr mTunerDescrambler; }; } // namespace android #endif // _ANDROID_MEDIA_TV_DESCRAMBLER_CLIENT_H_