blob: aeab9bca0242216c00668fdb7392c84a6e7adffa [file] [log] [blame]
Jeff Tinker53b52fe2016-12-01 18:12:56 -08001/*
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 Tinkerda002fe2017-01-19 14:41:11 -080016package android.hardware.drm@1.0;
Jeff Tinker53b52fe2016-12-01 18:12:56 -080017
18import 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 */
27interface ICryptoFactory {
Jeff Tinker35594ec2016-12-14 09:55:22 -080028 /**
Jeff Tinker53b52fe2016-12-01 18:12:56 -080029 * 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 Tinker35594ec2016-12-14 09:55:22 -080036 /**
Jeff Tinker53b52fe2016-12-01 18:12:56 -080037 * 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 Tinkerb3a16722016-12-30 19:03:17 -080043 * @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 Tinker35594ec2016-12-14 09:55:22 -080046 * @return cryptoPlugin the created ICryptoPlugin
47 */
Jeff Tinker53b52fe2016-12-01 18:12:56 -080048 createPlugin(uint8_t[16] uuid, vec<uint8_t> initData)
49 generates (Status status, ICryptoPlugin cryptoPlugin);
Jeff Tinker53b52fe2016-12-01 18:12:56 -080050};