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.4/IDrmPlugin.h> 21 #include <android/hardware/drm/1.4/IDrmFactory.h> 22 23 #include "ClearKeyTypes.h" 24 25 namespace android { 26 namespace hardware { 27 namespace drm { 28 namespace V1_4 { 29 namespace clearkey { 30 31 using ::android::hardware::drm::V1_1::SecurityLevel; 32 using ::android::hardware::hidl_array; 33 using ::android::hardware::hidl_handle; 34 using ::android::hardware::hidl_string; 35 using ::android::hardware::Return; 36 37 struct DrmFactory : public IDrmFactory { DrmFactoryDrmFactory38 DrmFactory() {} ~DrmFactoryDrmFactory39 virtual ~DrmFactory() {} 40 41 Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid) 42 override; 43 44 Return<bool> isCryptoSchemeSupported_1_2(const hidl_array<uint8_t, 16>& uuid, 45 const hidl_string& mimeType, 46 SecurityLevel level) override; 47 48 Return<bool> isContentTypeSupported(const hidl_string &mimeType) 49 override; 50 51 Return<void> createPlugin( 52 const hidl_array<uint8_t, 16>& uuid, 53 const hidl_string& appPackageName, 54 createPlugin_cb _hidl_cb) override; 55 56 Return<void> getSupportedCryptoSchemes( 57 getSupportedCryptoSchemes_cb _hidl_cb) override; 58 59 Return<void> debug(const hidl_handle& fd, const hidl_vec<hidl_string>& args); 60 61 private: 62 CLEARKEY_DISALLOW_COPY_AND_ASSIGN(DrmFactory); 63 }; 64 65 } // namespace clearkey 66 } // namespace V1_4 67 } // namespace drm 68 } // namespace hardware 69 } // namespace android 70 71 #endif // CLEARKEY_DRM_FACTORY_H_ 72