Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | */ |
Jeff Tinker | da002fe | 2017-01-19 14:41:11 -0800 | [diff] [blame] | 16 | #ifndef ANDROID_HARDWARE_DRM_V1_0__DRMFACTORY_H |
| 17 | #define ANDROID_HARDWARE_DRM_V1_0__DRMFACTORY_H |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 18 | |
Jeff Tinker | da002fe | 2017-01-19 14:41:11 -0800 | [diff] [blame] | 19 | #include <android/hardware/drm/1.0/IDrmFactory.h> |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 20 | #include <hidl/Status.h> |
| 21 | #include <media/drm/DrmAPI.h> |
Jiyong Park | 07770c7 | 2017-06-19 22:06:41 +0900 | [diff] [blame^] | 22 | #include <PluginLoader.h> |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 23 | #include <media/SharedLibrary.h> |
| 24 | |
| 25 | namespace android { |
| 26 | namespace hardware { |
| 27 | namespace drm { |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 28 | namespace V1_0 { |
| 29 | namespace implementation { |
| 30 | |
Jiyong Park | 07770c7 | 2017-06-19 22:06:41 +0900 | [diff] [blame^] | 31 | using ::android::hardware::drm::V1_0::helper::PluginLoader; |
Jeff Tinker | da002fe | 2017-01-19 14:41:11 -0800 | [diff] [blame] | 32 | using ::android::hardware::drm::V1_0::IDrmFactory; |
| 33 | using ::android::hardware::drm::V1_0::IDrmPlugin; |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 34 | using ::android::hardware::hidl_array; |
| 35 | using ::android::hardware::hidl_string; |
| 36 | using ::android::hardware::hidl_vec; |
| 37 | using ::android::hardware::Return; |
| 38 | using ::android::hardware::Void; |
| 39 | using ::android::sp; |
| 40 | |
| 41 | struct DrmFactory : public IDrmFactory { |
| 42 | DrmFactory(); |
| 43 | virtual ~DrmFactory() {} |
| 44 | |
Jeff Tinker | da002fe | 2017-01-19 14:41:11 -0800 | [diff] [blame] | 45 | // Methods from ::android::hardware::drm::V1_0::IDrmFactory follow. |
Jeff Tinker | 9a33bb2 | 2017-02-14 21:04:31 +0000 | [diff] [blame] | 46 | |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 47 | Return<bool> isCryptoSchemeSupported(const hidl_array<uint8_t, 16>& uuid) |
| 48 | override; |
| 49 | |
Jeff Tinker | 9a33bb2 | 2017-02-14 21:04:31 +0000 | [diff] [blame] | 50 | Return<bool> isContentTypeSupported(const hidl_string &mimeType) |
Jeff Tinker | b3a1672 | 2016-12-30 19:03:17 -0800 | [diff] [blame] | 51 | override; |
| 52 | |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 53 | Return<void> createPlugin(const hidl_array<uint8_t, 16>& uuid, |
Jeff Tinker | 45548ea | 2017-01-25 11:46:52 -0800 | [diff] [blame] | 54 | const hidl_string& appPackageName, createPlugin_cb _hidl_cb) override; |
| 55 | |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 56 | private: |
Jiyong Park | 07770c7 | 2017-06-19 22:06:41 +0900 | [diff] [blame^] | 57 | PluginLoader<android::DrmFactory> loader; |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 58 | |
| 59 | DrmFactory(const DrmFactory &) = delete; |
| 60 | void operator=(const DrmFactory &) = delete; |
| 61 | }; |
| 62 | |
| 63 | extern "C" IDrmFactory* HIDL_FETCH_IDrmFactory(const char* name); |
| 64 | |
| 65 | } // namespace implementation |
| 66 | } // namespace V1_0 |
| 67 | } // namespace drm |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 68 | } // namespace hardware |
| 69 | } // namespace android |
| 70 | |
Jeff Tinker | da002fe | 2017-01-19 14:41:11 -0800 | [diff] [blame] | 71 | #endif // ANDROID_HARDWARE_DRM_V1_0__DRMFACTORY_H |