Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: ppapi/api/private/ppb_content_decryptor_private.idl

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed last nit. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/api/private/ppp_content_decryptor_private.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /**
7 * This file defines the <code>PPB_ContentDecryptor_Private</code>
8 * interface. Note: This is a special interface, only to be used for Content
9 * Decryption Modules, not normal plugins.
10 */
11 label Chrome {
12 M23 = 0.1
13 };
14
15 /**
16 * <code>PPB_ContentDecryptor_Private</code> structure contains the function
17 * pointers the browser must implement to support plugins implementing the
18 * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides
19 * browser side support for the Content Decryption Module (CDM) for v0.1 of the
20 * proposed Encrypted Media Extensions: http://goo.gl/rbdnR
21 */
22 interface PPB_ContentDecryptor_Private {
23 /**
24 * The decryptor requires a key that has not been provided.
25 *
26 * Sent when the decryptor encounters encrypted content, but it does not have
27 * the key required to decrypt the data. The plugin will call this method in
28 * response to a call to the <code>Decrypt()</code> method on the
29 * <code>PPP_ContentDecryptor_Private<code> interface.
30 *
31 * The browser must notify the application that a key is needed, and, in
32 * response, the web application must direct the browser to call
33 * <code>AddKey()</code> on the <code>PPP_ContentDecryptor_Private<code>
34 * interface.
35 *
36 * @param[in] key_system A <code>PP_Var</code> of type
37 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
38 *
39 * @param[in] session_id A <code>PP_Var</code> of type
40 * <code>PP_VARTYPE_STRING</code> containing the session ID.
41 *
42 * @param[in] init_data A <code>PP_Var</code> of type
43 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container-specific
44 * initialization data.
45 */
46 void NeedKey(
47 [in] PP_Instance instance,
48 [in] PP_Var key_system,
49 [in] PP_Var session_id,
50 [in] PP_Var init_data);
51
52 /**
53 * A key has been added as the result of a call to the <code>AddKey()</code>
54 * method on the <code>PPP_ContentDecryptor_Private</code> interface.
55 *
56 * Note: The above describes the most simple case. Depending on the key
57 * system, a series of <code>KeyMessage()</code> calls from the CDM will be
58 * sent to the browser, and then on to the web application. The web
59 * application must then provide more data to the CDM by directing the browser
60 * to pass the data to the CDM via calls to <code>AddKey()</code> on the
61 * <code>PPP_ContentDecryptor_Private</code> interface.
62 * The CDM must call <code>KeyAdded()</code> when the sequence is completed,
63 * and, in response, the browser must notify the web application.
64 *
65 * @param[in] key_system A <code>PP_Var</code> of type
66 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
67 *
68 * @param[in] session_id A <code>PP_Var</code> of type
69 * <code>PP_VARTYPE_STRING</code> containing the session ID.
70 */
71 void KeyAdded(
72 [in] PP_Instance instance,
73 [in] PP_Var key_system,
74 [in] PP_Var session_id);
75
76 /**
77 * A message or request has been generated for key_system in the CDM, and
78 * must be sent to the web application.
79 *
80 * For example, when the browser invokes <code>GenerateKeyRequest()</code>
81 * on the <code>PPP_ContentDecryptor_Private</code> interface, the plugin
82 * must send a key message containing the key request.
83 *
84 * Note that <code>KeyMessage()</code> can be used for purposes other than
85 * responses to <code>GenerateKeyRequest()</code> calls. See also the text
86 * in the comment for <code>KeyAdded()</code>, which describes a sequence of
87 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to
88 * prepare for decryption.
89 *
90 * @param[in] key_system A <code>PP_Var</code> of type
91 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
92 *
93 * @param[in] session_id A <code>PP_Var</code> of type
94 * <code>PP_VARTYPE_STRING</code> containing the session ID.
95 *
96 * @param[in] resource A <code>PP_Resource</code> corresponding to a
97 * <code>PPB_Buffer_Dev</code> resource that contains the message.
98 *
99 * @param[in] default_url A <code>PP_Var</code> of type
100 * <code>PP_VARTYPE_STRING</code> containing the default URL for the message.
101 */
102 void KeyMessage(
103 [in] PP_Instance instance,
104 [in] PP_Var key_system,
105 [in] PP_Var session_id,
106 [in] PP_Resource message,
107 [in] PP_Var default_url);
108
109 /**
110 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method,
111 * or within the plugin implementing the interface.
112 *
113 * @param[in] key_system A <code>PP_Var</code> of type
114 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
115 *
116 * @param[in] session_id A <code>PP_Var</code> of type
117 * <code>PP_VARTYPE_STRING</code> containing the session ID.
118 *
119 * @param[in] media_error A MediaKeyError.
120 *
121 * @param[in] system_error A system error code.
122 */
123 void KeyError(
124 [in] PP_Instance instance,
125 [in] PP_Var key_system,
126 [in] PP_Var session_id,
127 [in] int32_t media_error,
128 [in] int32_t system_code);
129
130 /**
131 * Called after the <code>Decrypt()</code> method on the
132 * <code>PPP_ContentDecryptor_Private</code> interface completes to
133 * deliver decrypted_block to the browser for decoding and rendering.
134 *
135 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a
136 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data
137 * block.
138 *
139 * @param[in] request_id A unique value the browser can use to associate
140 * decrypted_block with a decrypt call.
141 */
142 void DeliverBlock(
143 [in] PP_Instance instance,
144 [in] PP_Resource decrypted_block,
145 [in] int32_t request_id);
146
147 /**
148 * Called after the <code>DecryptAndDecode()</code> method on the
149 * <code>PPP_ContentDecryptor_Private</code> interface completes to deliver
150 * a decrypted and decoded video frame to the browser for rendering.
151 *
152 * @param[in] decrypted_frame A <code>PP_Resource</code> corresponding to a
153 * <code>PPB_Buffer_Dev</code> resource that contains a video frame.
154 *
155 * @param[in] request_id A unique value the browser can use to associate
156 * decrypted_frame with a decrypt call.
157 */
158 void DeliverFrame(
159 [in] PP_Instance instance,
160 [in] PP_Resource decrypted_frame,
161 [in] int32_t request_id);
162
163 /**
164 * Called after the <code>DecryptAndDecode()</code> method on the
165 * <code>PPP_ContentDecryptor_Private</code> interface completes to
166 * deliver a buffer of decrypted and decoded audio samples to the browser for
167 * rendering.
168 *
169 * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a
170 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer
171 * of decoded audio samples.
172 *
173 * @param[in] request_id A unique value the browser can use to associate
174 * decrypted_samples with a decrypt call.
175 */
176 void DeliverSamples(
177 [in] PP_Instance instance,
178 [in] PP_Resource decrypted_samples,
179 [in] int32_t request_id);
180 };
OLDNEW
« no previous file with comments | « no previous file | ppapi/api/private/ppp_content_decryptor_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698