Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -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 | package android.hardware.drm@1.0; |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 17 | |
| 18 | import IDrmPlugin; |
| 19 | |
| 20 | /** |
| 21 | * Ref: frameworks/native/include/media/drm/DrmAPI.h:DrmFactory |
| 22 | * |
| 23 | * IDrmFactory is the main entry point for interacting with a vendor's |
| 24 | * drm HAL to create drm plugin instances. A drm plugin instance |
| 25 | * creates drm sessions which are used to obtain keys for a crypto |
| 26 | * session so it can decrypt* protected video content. |
| 27 | */ |
| 28 | |
| 29 | interface IDrmFactory { |
Jeff Tinker | 35594ec | 2016-12-14 09:55:22 -0800 | [diff] [blame] | 30 | /** |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 31 | * Determine if a crypto scheme is supported by this HAL |
| 32 | * |
| 33 | * @param uuid identifies the crypto scheme in question |
| 34 | * @return isSupported must be true only if the scheme is supported |
| 35 | */ |
| 36 | isCryptoSchemeSupported(uint8_t[16] uuid) generates(bool isSupported); |
| 37 | |
Jeff Tinker | 35594ec | 2016-12-14 09:55:22 -0800 | [diff] [blame] | 38 | /** |
Jeff Tinker | b3a1672 | 2016-12-30 19:03:17 -0800 | [diff] [blame] | 39 | * Determine if the HAL factory is able to construct plugins that support a |
| 40 | * given media container format specified by mimeType |
| 41 | * |
| 42 | * @param mimeType identifies the mime type in question |
| 43 | * @return isSupported must be true only if the scheme is supported |
| 44 | */ |
| 45 | isContentTypeSupported(string mimeType) generates(bool isSupported); |
| 46 | |
| 47 | /** |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 48 | * Create a drm plugin instance for the specified uuid and scheme-specific |
| 49 | * initialization data. |
| 50 | * |
| 51 | * @param uuid uniquely identifies the drm scheme. See |
| 52 | * http://dashif.org/identifiers/protection for uuid assignments |
Jeff Tinker | b3a1672 | 2016-12-30 19:03:17 -0800 | [diff] [blame] | 53 | * @return status the status of the call. The HAL implementation must return |
| 54 | * OK if the plugin is created and ERROR_DRM_CANNOT_HANDLE if the plugin |
| 55 | * cannot be created. |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 56 | */ |
Jeff Tinker | b075caa | 2016-12-06 23:15:20 -0800 | [diff] [blame] | 57 | createPlugin(uint8_t[16] uuid) generates (Status status, |
| 58 | IDrmPlugin drmPlugin); |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 59 | }; |