blob: 96623135baa43da4f6e24ec3c470d81d9bd28a84 [file] [log] [blame]
Shraddha Basantwani6545b4e2022-09-21 16:26:19 +05301/*
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
21namespace aidl {
22namespace android {
23namespace hardware {
24namespace cas {
25
26using namespace ::android;
27using namespace std;
28using ndk::ScopedAStatus;
29
30class 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