2 * Copyright (C) 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package android.hardware.drm@1.0;
21 * Ref: frameworks/native/include/media/drm/DrmAPI.h:DrmFactory
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.
29 interface IDrmFactory {
31 * Determine if a crypto scheme is supported by this HAL
33 * @param uuid identifies the crypto scheme in question
34 * @return isSupported must be true only if the scheme is supported
36 isCryptoSchemeSupported(uint8_t[16] uuid) generates(bool isSupported);
39 * Determine if the HAL factory is able to construct plugins that support a
40 * given media container format specified by mimeType
42 * @param mimeType identifies the mime type in question
43 * @return isSupported must be true only if the scheme is supported
45 isContentTypeSupported(string mimeType) generates(bool isSupported);
48 * Create a drm plugin instance for the specified uuid and scheme-specific
49 * initialization data.
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
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
59 createPlugin(uint8_t[16] uuid, string appPackageName)
60 generates (Status status, IDrmPlugin drmPlugin);