xref: /aosp_15_r20/hardware/interfaces/cas/aidl/default/MediaCasService.h (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1 /*
2  * Copyright (C) 2022 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 #include <aidl/android/hardware/cas/BnMediaCasService.h>
17 #include <media/cas/DescramblerAPI.h>
18 
19 #include "FactoryLoader.h"
20 
21 namespace aidl {
22 namespace android {
23 namespace hardware {
24 namespace cas {
25 
26 using namespace ::android;
27 using namespace std;
28 using ndk::ScopedAStatus;
29 
30 class MediaCasService : public BnMediaCasService {
31   public:
32     MediaCasService();
33 
34     virtual ScopedAStatus enumeratePlugins(
35             vector<AidlCasPluginDescriptor>* aidlCasPluginDescriptors) override;
36 
37     virtual ScopedAStatus isSystemIdSupported(int32_t in_CA_system_id, bool* _aidl_return) override;
38 
39     virtual ScopedAStatus createPlugin(int32_t in_CA_system_id,
40                                        const shared_ptr<ICasListener>& in_listener,
41                                        shared_ptr<ICas>* _aidl_return) override;
42 
43     virtual ScopedAStatus isDescramblerSupported(int32_t in_CA_system_id,
44                                                  bool* _aidl_return) override;
45 
46     virtual ScopedAStatus createDescrambler(int32_t in_CA_system_id,
47                                             shared_ptr<IDescrambler>* _aidl_return) override;
48 
49   private:
50     FactoryLoader<CasFactory> mCasLoader;
51     FactoryLoader<DescramblerFactory> mDescramblerLoader;
52 
53     virtual ~MediaCasService();
54 };
55 
56 }  // namespace cas
57 }  // namespace hardware
58 }  // namespace android
59 }  // namespace aidl
60