1 /* 2 * Copyright (C) 2017 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 DESCRAMBLER_IMPL_H_ 18 #define DESCRAMBLER_IMPL_H_ 19 20 #include <media/stagefright/foundation/ABase.h> 21 #include <android/media/BnDescrambler.h> 22 23 namespace android { 24 using namespace media; 25 using namespace MediaDescrambler; 26 using binder::Status; 27 class DescramblerPlugin; 28 class SharedLibrary; 29 30 class DescramblerImpl : public BnDescrambler { 31 public: 32 DescramblerImpl(const sp<SharedLibrary>& library, DescramblerPlugin *plugin); 33 virtual ~DescramblerImpl(); 34 35 virtual Status setMediaCasSession( 36 const CasSessionId& sessionId) override; 37 38 virtual Status requiresSecureDecoderComponent( 39 const String16& mime, bool *result) override; 40 41 virtual Status descramble( 42 const DescrambleInfo& descrambleInfo, int32_t *result) override; 43 44 virtual Status release() override; 45 46 private: 47 sp<SharedLibrary> mLibrary; 48 DescramblerPlugin *mPlugin; 49 50 DISALLOW_EVIL_CONSTRUCTORS(DescramblerImpl); 51 }; 52 53 } // namespace android 54 55 #endif // DESCRAMBLER_IMPL_H_ 56