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

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: Addressed ddorwin's 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 Mon Aug 13 09:13:30 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 the CDM for v0.1 of the proposed Encrypted Media
41 * Extensions: 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 <code>Decrypt()</code> on the
50 * <code>PPP_ContentDecryptor_Private<code> interface. In response, the
51 * browser should 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 container 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.
72 *
73 * Note: The above describes the most simple case. Depending on the key
74 * system, a series of <code>KeyMessage()</code> calls with the application
75 * providing more data via additional calls to <code>AddKey()</code> could be
76 * required. <code>KeyAdded()</code> is sent once the sequence is completed.
77 *
78 * @param[in] key_system A <code>PP_Var</code> of type
79 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
80 *
81 * @param[in] session_id A <code>PP_Var</code> of type
82 * <code>PP_VARTYPE_STRING</code> containing the session ID.
83 */
84 void (*KeyAdded)(PP_Instance instance,
85 struct PP_Var key_system,
86 struct PP_Var session_id);
87 /**
88 * A message or request has been generated by or for key_system, and needs to
89 * be sent to a key server.
90 *
91 * For example, in response to successful key request generation resulting
92 * from a call to the <code>GenerateKeyRequest()</code> method on the
93 * <code>PPP_ContentDecryptor_Private</code> interface, the decryptor will
94 * send a key message with the session ID.
95 *
96 * Note that <code>KeyMessage()</code> can be used for purposes other than
97 * responses to <code>GenerateKeyRequest()</code> calls. Of note is the text
98 * in the comment for <code>KeyAdded()</code>, which describes a sequence of
99 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to
100 * prepare for decryption.
101 *
102 * @param[in] key_system A <code>PP_Var</code> of type
103 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
104 *
105 * @param[in] session_id A <code>PP_Var</code> of type
106 * <code>PP_VARTYPE_STRING</code> containing the session ID.
107 *
108 * @param[in] resource A <code>PP_Resource</code> corresponding to a
109 * <code>PPB_Buffer_Dev</code> resource that contains the message.
110 *
111 * @param[in] default_url A <code>PP_Var</code> of type
112 * <code>PP_VARTYPE_STRING</code> containing the default URL for the message.
113 */
114 void (*KeyMessage)(PP_Instance instance,
115 struct PP_Var key_system,
116 struct PP_Var session_id,
117 PP_Resource message,
118 struct PP_Var default_url);
119 /**
120 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method,
121 * or within the plugin implementing the interface.
122 *
123 * @param[in] key_system A <code>PP_Var</code> of type
124 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
125 *
126 * @param[in] session_id A <code>PP_Var</code> of type
127 * <code>PP_VARTYPE_STRING</code> containing the session ID.
128 *
129 * @param[in] media_error A MediaKeyError.
130 *
131 * @param[in] system_error A system error code.
132 */
133 void (*KeyError)(PP_Instance instance,
134 struct PP_Var key_system,
135 struct PP_Var session_id,
136 int32_t media_error,
137 int32_t system_code);
138 /**
139 * Called after the <code>Decrypt()</code> method on the
140 * <code>PPP_ContentDecryptor_Private</code> interface completes to
141 * deliver decrypted_block to the browser.
142 *
143 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a
144 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data
145 * block.
146 *
147 * @param[in] request_id A unique value the browser can use to associate
148 * decrypted_block with a decrypt call.
149 */
150 void (*DeliverBlock)(PP_Instance instance,
151 PP_Resource decrypted_block,
152 int32_t request_id);
153 /**
154 * Called after the <code>DecryptAndDecode()</code> method on the
155 * <code>PPP_ContentDecryptor_Private</code> interface completes to
156 * deliver a decrypted and decoded video frame to the browser.
157 *
158 * @param[in] decrypted_frame A <code>PP_Resource</code> corresponding to a
159 * <code>PPB_Buffer_Dev</code> resource that contains a video frame.
160 *
161 * @param[in] request_id A unique value the browser can use to associate
162 * decrypted_frame with a decrypt call.
163 */
164 void (*DeliverFrame)(PP_Instance instance,
165 PP_Resource decrypted_frame,
166 int32_t request_id);
167 /**
168 * Called after the <code>DecryptAndDecode()</code> method on the
169 * <code>PPP_ContentDecryptor_Private</code> interface completes to
170 * deliver a buffer of decrypted and decoded audio samples to the browser.
171 *
172 * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a
173 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer
174 * of decoded audio samples.
175 *
176 * @param[in] request_id A unique value the browser can use to associate
177 * decrypted_samples with a decrypt call.
178 */
179 void (*DeliverSamples)(PP_Instance instance,
180 PP_Resource decrypted_samples,
181 int32_t request_id);
182 };
183
184 typedef struct PPB_ContentDecryptor_Private_0_1 PPB_ContentDecryptor_Private;
185 /**
186 * @}
187 */
188
189 #endif /* PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ */
190
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698