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 ANDROID_HARDWARE_CAS_V1_0_MEDIA_CAS_SERVICE_H_ 18 #define ANDROID_HARDWARE_CAS_V1_0_MEDIA_CAS_SERVICE_H_ 19 20 #include <android/hardware/cas/1.0/IMediaCasService.h> 21 22 #include "FactoryLoader.h" 23 24 namespace android { 25 struct CasFactory; 26 struct DescramblerFactory; 27 namespace hardware { 28 namespace cas { 29 namespace V1_0 { 30 namespace implementation { 31 32 class MediaCasService : public IMediaCasService { 33 public: 34 MediaCasService(); 35 36 virtual Return<void> enumeratePlugins( 37 enumeratePlugins_cb _hidl_cb) override; 38 39 virtual Return<bool> isSystemIdSupported( 40 int32_t CA_system_id) override; 41 42 virtual Return<sp<ICas>> createPlugin( 43 int32_t CA_system_id, const sp<ICasListener>& listener) override; 44 45 virtual Return<bool> isDescramblerSupported( 46 int32_t CA_system_id) override; 47 48 virtual Return<sp<IDescramblerBase>> createDescrambler( 49 int32_t CA_system_id) override; 50 51 private: 52 FactoryLoader<CasFactory> mCasLoader; 53 FactoryLoader<DescramblerFactory> mDescramblerLoader; 54 55 virtual ~MediaCasService(); 56 }; 57 58 } // namespace implementation 59 } // namespace V1_0 60 } // namespace cas 61 } // namespace hardware 62 } // namespace android 63 64 #endif // ANDROID_HARDWARE_CAS_V1_0_MEDIA_CAS_SERVICE_H_ 65