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

Side by Side Diff: ppapi/c/private/ppb_content_decryptor_private.h

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments in response to comments on comments... 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
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 /* From private/ppb_content_decryptor_private.idl,
7 * modified Tue Aug 14 09:36:47 2012.
8 */
9
10 #ifndef PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_
12
13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_instance.h"
15 #include "ppapi/c/pp_macros.h"
16 #include "ppapi/c/pp_resource.h"
17 #include "ppapi/c/pp_stdint.h"
18 #include "ppapi/c/pp_var.h"
19
20 #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 \
21 "PPB_ContentDecryptor_Private;0.1"
22 #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE \
23 PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1
24
25 /**
26 * @file
27 * This file defines the <code>PPB_ContentDecryptor_Private</code>
28 * interface. Note: This is a special interface, only to be used for Content
29 * Decryption Modules (CDM), not normal plugins.
30 */
31
32
33 /**
34 * @addtogroup Interfaces
35 * @{
36 */
37 /**
38 * <code>PPB_ContentDecryptor_Private</code> structure contains the function
39 * pointers the browser must implement to support plugins implementing the
40 * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides
41 * browser side support for the CDM for v0.1 of the proposed Encrypted Media
42 * Extensions: http://goo.gl/rbdnR
43 */
44 struct PPB_ContentDecryptor_Private_0_1 {
45 /**
46 * The decryptor requires a key that has not been provided.
47 *
48 * Sent when the decryptor encounters encrypted content, but it does not have
49 * the key required to decrypt the data. The plugin will call this method in
50 * response to a call to the <code>Decrypt()</code> method on the
51 * <code>PPP_ContentDecryptor_Private<code> interface.
52 *
53 * For an internally implemented key system, the browser must provide a key to
54 * the decryptor plugin by calling <code>AddKey()</code> on the
55 * <code>PPP_ContentDecryptor_Private<code> interface.
56 *
57 * For an external key system, the browser must notify the application that
58 * a key is needed by firing a <code>MediaKeyNeededEvent</code> at the
59 * <code>HTMLMediaElement</code>. In response the application must call
60 * <code>addKey()</code> on the <code>HTMLMediaElement</code> which results
61 * in the browser passing the application's key to <code>AddKey()</code> on
62 * the <code>PPP_ContentDecryptor_Private<code> interface.
63 *
64 * @param[in] key_system A <code>PP_Var</code> of type
65 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
66 *
67 * @param[in] session_id A <code>PP_Var</code> of type
68 * <code>PP_VARTYPE_STRING</code> containing the session ID.
69 *
70 * @param[in] init_data A <code>PP_Var</code> of type
71 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container-specific
72 * initialization data.
73 */
74 void (*NeedKey)(PP_Instance instance,
75 struct PP_Var key_system,
76 struct PP_Var session_id,
77 struct PP_Var init_data);
78 /**
79 * A key has been added as the result of a call to the <code>AddKey()</code>
80 * method on the <code>PPP_ContentDecryptor_Private</code> interface.
81 *
82 * Note: The above describes the most simple case. Depending on the key
83 * system, a series of <code>KeyMessage()</code> calls from the CDM will be
84 * sent to the browser, and then on to the application by firing a
85 * <code>MediaKeyMessageEvent</code> at the <code>HTMLMediaElement</code>.
86 * In response, the application must then provide more data via additional
87 * calls to the <code>addKey()</code> method on the
88 * <code>HTMLMediaElement</code>, which the browser must pass to the CDM via
89 * calls to <code>AddKey()</code> on the
90 * <code>PPP_ContentDecryptor_Private</code> interface.
91 * The CDM must call <code>KeyAdded()</code> when the sequence is completed,
92 * and, for external key systems, the browser must fire a
93 * <code>MediaKeyCompleteEvent</code> at the <code>HTMlMediaElement</code>.
94 *
95 * @param[in] key_system A <code>PP_Var</code> of type
96 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
97 *
98 * @param[in] session_id A <code>PP_Var</code> of type
99 * <code>PP_VARTYPE_STRING</code> containing the session ID.
100 */
101 void (*KeyAdded)(PP_Instance instance,
102 struct PP_Var key_system,
103 struct PP_Var session_id);
104 /**
105 * A message or request has been generated for key_system in the CDM, and,
106 * when the key system is external, must be sent to the application.
107 *
108 * For example, when the browser invokes <code>GenerateKeyRequest()</code>
109 * on the<code>PPP_ContentDecryptor_Private</code> interface, the decryptor
110 * must send a key message with the session ID.
111 *
112 * Note that <code>KeyMessage()</code> can be used for purposes other than
113 * responses to <code>GenerateKeyRequest()</code> calls. See also the text
114 * in the comment for <code>KeyAdded()</code>, which describes a sequence of
115 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to
116 * prepare for decryption.
117 *
118 * @param[in] key_system A <code>PP_Var</code> of type
119 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
120 *
121 * @param[in] session_id A <code>PP_Var</code> of type
122 * <code>PP_VARTYPE_STRING</code> containing the session ID.
123 *
124 * @param[in] resource A <code>PP_Resource</code> corresponding to a
125 * <code>PPB_Buffer_Dev</code> resource that contains the message.
126 *
127 * @param[in] default_url A <code>PP_Var</code> of type
128 * <code>PP_VARTYPE_STRING</code> containing the default URL for the message.
129 */
130 void (*KeyMessage)(PP_Instance instance,
131 struct PP_Var key_system,
132 struct PP_Var session_id,
133 PP_Resource message,
134 struct PP_Var default_url);
135 /**
136 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method,
137 * or within the plugin implementing the interface.
138 *
139 * @param[in] key_system A <code>PP_Var</code> of type
140 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
141 *
142 * @param[in] session_id A <code>PP_Var</code> of type
143 * <code>PP_VARTYPE_STRING</code> containing the session ID.
144 *
145 * @param[in] media_error A MediaKeyError.
146 *
147 * @param[in] system_error A system error code.
148 */
149 void (*KeyError)(PP_Instance instance,
150 struct PP_Var key_system,
151 struct PP_Var session_id,
152 int32_t media_error,
153 int32_t system_code);
154 /**
155 * Called after the <code>Decrypt()</code> method on the
156 * <code>PPP_ContentDecryptor_Private</code> interface completes to
157 * deliver decrypted_block to the browser for decoding and rendering.
158 *
159 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a
160 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data
161 * block.
162 *
163 * @param[in] request_id A unique value the browser can use to associate
164 * decrypted_block with a decrypt call.
165 */
166 void (*DeliverBlock)(PP_Instance instance,
167 PP_Resource decrypted_block,
168 int32_t request_id);
169 /**
170 * Called after the <code>DecryptAndDecode()</code> method on the
171 * <code>PPP_ContentDecryptor_Private</code> interface completes to deliver
172 * a decrypted and decoded video frame to the browser for rendering.
173 *
174 * @param[in] decrypted_frame A <code>PP_Resource</code> corresponding to a
175 * <code>PPB_Buffer_Dev</code> resource that contains a video frame.
176 *
177 * @param[in] request_id A unique value the browser can use to associate
178 * decrypted_frame with a decrypt call.
179 */
180 void (*DeliverFrame)(PP_Instance instance,
181 PP_Resource decrypted_frame,
182 int32_t request_id);
183 /**
184 * Called after the <code>DecryptAndDecode()</code> method on the
185 * <code>PPP_ContentDecryptor_Private</code> interface completes to
186 * deliver a buffer of decrypted and decoded audio samples to the browser for
187 * rendering.
188 *
189 * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a
190 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer
191 * of decoded audio samples.
192 *
193 * @param[in] request_id A unique value the browser can use to associate
194 * decrypted_samples with a decrypt call.
195 */
196 void (*DeliverSamples)(PP_Instance instance,
197 PP_Resource decrypted_samples,
198 int32_t request_id);
199 };
200
201 typedef struct PPB_ContentDecryptor_Private_0_1 PPB_ContentDecryptor_Private;
202 /**
203 * @}
204 */
205
206 #endif /* PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ */
207
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698