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/hardware/CryptoAPI.h:CryptoFactory
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.
27 interface ICryptoFactory {
29 * Determine if a crypto scheme is supported by this HAL
31 * @param uuid identifies the crypto scheme in question
32 * @return isSupported must be true only if the scheme is supported
34 isCryptoSchemeSupported(uint8_t[16] uuid) generates(bool isSupported);
37 * Create a crypto plugin for the specified uuid and scheme-specific
38 * initialization data.
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.
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
46 * @return cryptoPlugin the created ICryptoPlugin
48 createPlugin(uint8_t[16] uuid, vec<uint8_t> initData)
49 generates (Status status, ICryptoPlugin cryptoPlugin);