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

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: Cleaned up the comments a bit. 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 Fri Aug 10 07:56:59 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.
29 */
30
31
32 /**
33 * @addtogroup Interfaces
34 * @{
35 */
36 /**
37 * <code>PPB_ContentDecryptor_Private</code> structure contains the function
38 * pointers the browser MUST implement to support plugins implementing the
39 * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides
40 * browser side support for v0.1 of the proposed Encrypted Media Extensions:
41 * http://goo.gl/rbdnR
42 */
43 struct PPB_ContentDecryptor_Private_0_1 {
44 /**
45 * The decryptor requires a key that has not been provided.
46 *
47 * Sent when the decryptor encounters encrypted content, but it does not have
48 * the key required to decrypt the data. The plugin will call this method in
49 * response to a call to a decrypt method on the
50 * <code>PPP_ContentDecryptor_Private<code> interface, In response, the
51 * application must provide a key to the decryptor plugin by calling
52 * <code>AddKey()</code> on the <code>PPP_ContentDecryptor_Private<code>
53 * interface.
54 *
55 * @param[in] key_system A <code>PP_Var</code> of type
56 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
57 *
58 * @param[in] session_id A <code>PP_Var</code> of type
59 * <code>PP_VARTYPE_STRING</code> containing the session ID.
60 *
61 * @param[in] init_data A <code>PP_Var</code> of type
62 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific
63 * initialization data.
64 */
65 void (*NeedKey)(PP_Instance instance,
66 struct PP_Var key_system,
67 struct PP_Var session_id,
68 struct PP_Var init_data);
69 /**
70 * A key has been added as the result of a call to the <code>AddKey()</code>
71 * method on the <code>PPP_ContentDecryptor_Private</code> interface, and
72 * decryption of content can proceed.
73 *
74 * Note: the above describes the most simple case. Depending on the key
75 * system, a series of <code>KeyMessage()</code> calls with the application
76 * providing more data via additional calls to <code>AddKey()</code> could be
77 * required. <code>KeyAdded()</code> is sent once the sequence is completed,
78 * and the decryptor plugin is ready to begin decryption of data.
79 *
80 * @param[in] key_system A <code>PP_Var</code> of type
81 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
82 *
83 * @param[in] session_id A <code>PP_Var</code> of type
84 * <code>PP_VARTYPE_STRING</code> containing the session ID.
85 */
86 void (*KeyAdded)(PP_Instance instance,
87 struct PP_Var key_system,
88 struct PP_Var session_id);
89 /**
90 * A message or request has been generated by or for key_system, and needs to
91 * be sent to a key server.
92 *
93 * For example, in response to successful key request generation resulting
94 * from a call to the <code>GenerateKeyRequest()</code> method on the
95 * <code>PPP_ContentDecryptor_Private</code> interface, the decryptor will
96 * send a key message with the session ID.
97 *
98 * Note that <code>KeyMessage()</code> can be used for purposes other than
99 * responses to <code>GenerateKeyRequest()</code> calls. Of note is the text
100 * in the comment for <code>KeyAdded()</code>, which describes a sequence of
101 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to
102 * prepare for decryption.
103 *
104 * @param[in] key_system A <code>PP_Var</code> of type
105 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
106 *
107 * @param[in] session_id A <code>PP_Var</code> of type
108 * <code>PP_VARTYPE_STRING</code> containing the session ID.
109 *
110 * @param[in] resource A <code>PP_Resource</code> corresponding to a
111 * <code>PPB_Buffer_Dev</code> resource that contains the message.
112 *
113 * @param[in] session_id A <code>PP_Var</code> of type
114 * <code>PP_VARTYPE_STRING</code> containing the default URL for key system.
115 */
116 void (*KeyMessage)(PP_Instance instance,
117 struct PP_Var key_system,
118 struct PP_Var session_id,
119 PP_Resource message,
120 struct PP_Var default_url);
121 /**
122 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method,
123 * or within the plugin implementing the interface.
124 *
125 * @param[in] key_system A <code>PP_Var</code> of type
126 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
127 *
128 * @param[in] session_id A <code>PP_Var</code> of type
129 * <code>PP_VARTYPE_STRING</code> containing the session ID.
130 *
131 * @param[in] media_error A media stack error code.
132 *
133 * @param[in] system_error A system error code.
134 */
135 void (*KeyError)(PP_Instance instance,
136 struct PP_Var key_system,
137 struct PP_Var session_id,
138 int32_t media_error,
139 int32_t system_error);
140 /**
141 * Called after the <code>Decrypt()</code> method on the
142 * <code>PPP_ContentDecryptor_Private</code> interface completes to
143 * deliver decrypted_block to the browser.
144 *
145 * @param[in] resource A <code>PP_Resource</code> corresponding to a
146 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data
147 * block.
148 *
149 * @param[in] request_id A unique value the user agent can use to associate
150 * decrypted_block with a decrypt call.
151 */
152 void (*DeliverBlock)(PP_Instance instance,
153 PP_Resource decrypted_block,
154 uint64_t request_id);
155 /**
156 * Called after the <code>DecryptAndDecode</code> method on the
157 * <code>PPP_ContentDecryptor_Private</code> interface completes to
158 * deliver decrypted_frame to the browser.
159 *
160 * @param[in] resource A <code>PP_Resource</code> corresponding to a
161 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted video
162 * frame.
163 *
164 * @param[in] request_id A unique value the user agent can use to associate
165 * decrypted_frame with a decrypt call.
166 */
167 void (*DeliverFrame)(PP_Instance instance,
168 PP_Resource decrypted_frame,
169 uint64_t request_id);
170 /**
171 * Called after the <code>DecryptAndDecode()</code> method on the
172 * <code>PPP_ContentDecryptor_Private</code> interface completes to
173 * deliver decrypted_samples to the browser.
174 *
175 * @param[in] resource A <code>PP_Resource</code> corresponding to a
176 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer
177 * of audio samples.
178 *
179 * @param[in] request_id A unique value the user agent can use to associate
180 * decrypted_samples with a decrypt call.
181 */
182 void (*DeliverSamples)(PP_Instance instance,
183 PP_Resource decrypted_samples,
184 uint64_t request_id);
185 };
186
187 typedef struct PPB_ContentDecryptor_Private_0_1 PPB_ContentDecryptor_Private;
188 /**
189 * @}
190 */
191
192 #endif /* PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ */
193
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698