1 /*
2  * Copyright (C) 2018 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 CLEARKEY_DRM_FACTORY_H_
18 #define CLEARKEY_DRM_FACTORY_H_
19 
20 #include <android/hardware/drm/1.2/IDrmPlugin.h>
21 #include <android/hardware/drm/1.2/IDrmFactory.h>
22 
23 #include "ClearKeyTypes.h"
24 
25 namespace android {
26 namespace hardware {
27 namespace drm {
28 namespace V1_2 {
29 namespace clearkey {
30 
31 using ::android::hardware::hidl_array;
32 using ::android::hardware::hidl_string;
33 using ::android::hardware::Return;
34 
35 struct DrmFactory : public IDrmFactory {
DrmFactoryDrmFactory36     DrmFactory() {}
~DrmFactoryDrmFactory37     virtual ~DrmFactory() {}
38 
39     Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid)
40             override;
41 
42     Return<bool> isCryptoSchemeSupported_1_2(const hidl_array<uint8_t, 16>& uuid,
43                                              const hidl_string& mimeType,
44                                              SecurityLevel level) override;
45 
46     Return<bool> isContentTypeSupported(const hidl_string &mimeType)
47             override;
48 
49     Return<void> createPlugin(
50             const hidl_array<uint8_t, 16>& uuid,
51             const hidl_string& appPackageName,
52             createPlugin_cb _hidl_cb) override;
53 
54 private:
55     CLEARKEY_DISALLOW_COPY_AND_ASSIGN(DrmFactory);
56 };
57 
58 } // namespace clearkey
59 } // namespace V1_2
60 } // namespace drm
61 } // namespace hardware
62 } // namespace android
63 
64 #endif // CLEARKEY_DRM_FACTORY_H_
65