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 ICryptoPlugin; |
| 19 | |
| 20 | /** |
| 21 | * Ref: frameworks/native/include/media/hardware/CryptoAPI.h:CryptoFactory |
| 22 | * |
| 23 | * ICryptoFactory is the main entry point for interacting with a vendor's |
| 24 | * crypto HAL to create crypto plugins. Crypto plugins create crypto sessions |
| 25 | * which are used by a codec to decrypt protected video content. |
| 26 | */ |
| 27 | interface ICryptoFactory { |
Jeff Tinker | 35594ec | 2016-12-14 09:55:22 -0800 | [diff] [blame] | 28 | /** |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 29 | * Determine if a crypto scheme is supported by this HAL |
| 30 | * |
| 31 | * @param uuid identifies the crypto scheme in question |
| 32 | * @return isSupported must be true only if the scheme is supported |
| 33 | */ |
| 34 | isCryptoSchemeSupported(uint8_t[16] uuid) generates(bool isSupported); |
| 35 | |
Jeff Tinker | 35594ec | 2016-12-14 09:55:22 -0800 | [diff] [blame] | 36 | /** |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 37 | * Create a crypto plugin for the specified uuid and scheme-specific |
| 38 | * initialization data. |
| 39 | * |
| 40 | * @param uuid uniquely identifies the drm scheme. See |
| 41 | * http://dashif.org/identifiers/protection for uuid assignments |
| 42 | * @param initData scheme-specific init data. |
Jeff Tinker | b3a1672 | 2016-12-30 19:03:17 -0800 | [diff] [blame] | 43 | * @return status the status of the call. The HAL implementation must return |
| 44 | * OK if the plugin is created and ERROR_DRM_CANNOT_HANDLE if the plugin |
| 45 | * cannot be created. |
Jeff Tinker | 35594ec | 2016-12-14 09:55:22 -0800 | [diff] [blame] | 46 | * @return cryptoPlugin the created ICryptoPlugin |
| 47 | */ |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 48 | createPlugin(uint8_t[16] uuid, vec<uint8_t> initData) |
| 49 | generates (Status status, ICryptoPlugin cryptoPlugin); |
Jeff Tinker | 53b52fe | 2016-12-01 18:12:56 -0800 | [diff] [blame] | 50 | }; |