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 */
16package android.hardware.drm@1.0;
17
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 {
30    /**
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
38    /**
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    /**
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
53     * @param appPackageName identifies the package name of the calling
54     * application.
55     * @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.
58     */
59    createPlugin(uint8_t[16] uuid, string appPackageName)
60            generates (Status status, IDrmPlugin drmPlugin);
61};
62