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