blob: f8e4779e166363f5e7f1e24f884536b9032adc98 [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 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
29interface IDrmFactory {
Jeff Tinker35594ec2016-12-14 09:55:22 -080030 /**
Jeff Tinker53b52fe2016-12-01 18:12:56 -080031 * 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 Tinker35594ec2016-12-14 09:55:22 -080038 /**
Jeff Tinkerb3a16722016-12-30 19:03:17 -080039 * 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 Tinker53b52fe2016-12-01 18:12:56 -080048 * 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 Tinker45548ea2017-01-25 11:46:52 -080053 * @param appPackageName identifies the package name of the calling
54 * application.
Jeff Tinkerb3a16722016-12-30 19:03:17 -080055 * @return status the status of the call. The HAL implementation must return
56 * OK if the plugin is created and ERROR_DRM_CANNOT_HANDLE if the plugin
57 * cannot be created.
Jeff Tinker53b52fe2016-12-01 18:12:56 -080058 */
Jeff Tinker45548ea2017-01-25 11:46:52 -080059 createPlugin(uint8_t[16] uuid, string appPackageName)
60 generates (Status status, IDrmPlugin drmPlugin);
Jeff Tinker53b52fe2016-12-01 18:12:56 -080061};