blob: cb828f2fc148839ccbf66fb8f28d166a1d456d06 [file] [log] [blame]
Chong Zhang9dbe9a52017-01-03 11:35:15 -08001/*
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
24namespace android {
25using binder::Status;
26struct CasFactory;
27struct DescramblerFactory;
28
29class MediaCasService : public BnMediaCasService {
30public:
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
50private:
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_