blob: df04b9f2267a0bc16ea9c885b61a6202ac787327 [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;
Robert Shih02f2da82021-01-15 08:25:24 -080022import @1.4::LogMessage;
23import @1.4::Status;
Robert Shih2194bb42021-01-16 20:29:56 -080024
25/**
26 * IDrmPlugin is used to interact with a specific drm plugin that was
27 * created by IDrmFactory::createPlugin. A drm plugin provides methods for
28 * obtaining drm keys to be used by a codec to decrypt protected video
29 * content.
30 */
31interface IDrmPlugin extends @1.2::IDrmPlugin {
32
33 /**
34 * Check if the specified mime-type & security level require a secure decoder
35 * component.
36 *
37 * @param mime The content mime-type
38 * @param level the requested security level
39 * @return secureRequired must be true if and only if a secure decoder is required
40 * for the specified mime-type & security level
41 */
42 requiresSecureDecoder(string mime, @1.1::SecurityLevel level) generates (bool secureRequired);
43
44 /**
45 * Check if the specified mime-type requires a secure decoder component
46 * at the highest security level supported on the device.
47 *
48 * @param mime The content mime-type
49 * @return secureRequired must be true if and only if a secure decoder is required
50 * for the specified mime-type
51 */
52 requiresSecureDecoderDefault(string mime) generates (bool secureRequired);
53
Robert Shihff911f42021-01-18 00:01:40 -080054 /**
55 * Set playback id of a drm session. The playback id can be used to join drm session metrics
56 * with metrics from other low level media components, e.g. codecs, or metrics from the high
57 * level player.
58 *
59 * @param sessionId drm session id
60 * @param playbackId high level playback id
61 * @return status the status of the call. The status must be OK on success, or
62 * ERROR_DRM_SESSION_NOT_OPENED if the drm session cannot be found
63 */
64 setPlaybackId(SessionId sessionId, string playbackId) generates (@1.0::Status status);
65
Robert Shih02f2da82021-01-15 08:25:24 -080066 /**
67 * @return logMessages latest plugin level log messages. Can be used
68 * by apps in diagnosis of errors.
69 * @return status the status of the call. The status must be:
70 * OK on success;
71 * GENERAL_OEM_ERROR on OEM-provided, low-level component failures;
72 * GENERAL_PLUGIN_ERROR on unexpected plugin-level errors.
73 */
74 getLogMessages() generates (@1.4::Status status, vec<LogMessage> logMessages);
75
Robert Shih2194bb42021-01-16 20:29:56 -080076};