• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 MEDIA_CAS_SERVICE_H_
18 #define MEDIA_CAS_SERVICE_H_
19 
20 #include <android/media/BnMediaCasService.h>
21 
22 #include "FactoryLoader.h"
23 
24 namespace android {
25 using binder::Status;
26 struct CasFactory;
27 struct DescramblerFactory;
28 
29 class MediaCasService : public BnMediaCasService {
30 public:
31     static void instantiate();
32 
33     virtual Status enumeratePlugins(
34             vector<ParcelableCasPluginDescriptor>* results) override;
35 
36     virtual Status isSystemIdSupported(
37             int32_t CA_system_id, bool* result) override;
38 
39     virtual Status createPlugin(
40             int32_t CA_system_id,
41             const sp<ICasListener> &listener,
42             sp<ICas>* result) override;
43 
44     virtual Status isDescramblerSupported(
45             int32_t CA_system_id, bool* result) override;
46 
47     virtual Status createDescrambler(
48             int32_t CA_system_id, sp<IDescrambler>* result) override;
49 
50 private:
51     FactoryLoader<CasFactory> *mCasLoader;
52     FactoryLoader<DescramblerFactory> *mDescramblerLoader;
53 
54     MediaCasService();
55     virtual ~MediaCasService();
56 };
57 
58 } // namespace android
59 
60 #endif // MEDIA_CAS_SERVICE_H_
61