blob: e8af2300336695816fff03f34d30628be3eb1b3c [file] [log] [blame]
Robert Shih2194bb42021-01-16 20:29:56 -08001/**
2 * Copyright (C) 2021 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.4;
17
Robert Shihff911f42021-01-18 00:01:40 -080018import @1.0::Status;
19import @1.0::SessionId;
Robert Shih2194bb42021-01-16 20:29:56 -080020import @1.1::SecurityLevel;
21import @1.2::IDrmPlugin;
22
23/**
24 * IDrmPlugin is used to interact with a specific drm plugin that was
25 * created by IDrmFactory::createPlugin. A drm plugin provides methods for
26 * obtaining drm keys to be used by a codec to decrypt protected video
27 * content.
28 */
29interface IDrmPlugin extends @1.2::IDrmPlugin {
30
31 /**
32 * Check if the specified mime-type & security level require a secure decoder
33 * component.
34 *
35 * @param mime The content mime-type
36 * @param level the requested security level
37 * @return secureRequired must be true if and only if a secure decoder is required
38 * for the specified mime-type & security level
39 */
40 requiresSecureDecoder(string mime, @1.1::SecurityLevel level) generates (bool secureRequired);
41
42 /**
43 * Check if the specified mime-type requires a secure decoder component
44 * at the highest security level supported on the device.
45 *
46 * @param mime The content mime-type
47 * @return secureRequired must be true if and only if a secure decoder is required
48 * for the specified mime-type
49 */
50 requiresSecureDecoderDefault(string mime) generates (bool secureRequired);
51
Robert Shihff911f42021-01-18 00:01:40 -080052 /**
53 * Set playback id of a drm session. The playback id can be used to join drm session metrics
54 * with metrics from other low level media components, e.g. codecs, or metrics from the high
55 * level player.
56 *
57 * @param sessionId drm session id
58 * @param playbackId high level playback id
59 * @return status the status of the call. The status must be OK on success, or
60 * ERROR_DRM_SESSION_NOT_OPENED if the drm session cannot be found
61 */
62 setPlaybackId(SessionId sessionId, string playbackId) generates (@1.0::Status status);
63
Robert Shih2194bb42021-01-16 20:29:56 -080064};