OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From private/ppb_content_decryptor_private.idl, | 6 /* From private/ppb_content_decryptor_private.idl, |
7 * modified Wed Feb 26 16:37:47 2014. | 7 * modified Thu Jun 5 13:39:15 2014. |
8 */ | 8 */ |
9 | 9 |
10 #ifndef PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ | 10 #ifndef PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ |
11 #define PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ | 11 #define PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ |
12 | 12 |
13 #include "ppapi/c/pp_bool.h" | 13 #include "ppapi/c/pp_bool.h" |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
17 #include "ppapi/c/pp_stdint.h" | 17 #include "ppapi/c/pp_stdint.h" |
18 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
19 #include "ppapi/c/private/pp_content_decryptor.h" | 19 #include "ppapi/c/private/pp_content_decryptor.h" |
20 | 20 |
21 #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_11 \ | 21 #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_12 \ |
22 "PPB_ContentDecryptor_Private;0.11" | 22 "PPB_ContentDecryptor_Private;0.12" |
23 #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ | 23 #define PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ |
24 PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_11 | 24 PPB_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_12 |
25 | 25 |
26 /** | 26 /** |
27 * @file | 27 * @file |
28 * This file defines the <code>PPB_ContentDecryptor_Private</code> | 28 * This file defines the <code>PPB_ContentDecryptor_Private</code> |
29 * interface. Note: This is a special interface, only to be used for Content | 29 * interface. Note: This is a special interface, only to be used for Content |
30 * Decryption Modules, not normal plugins. | 30 * Decryption Modules, not normal plugins. |
31 */ | 31 */ |
32 | 32 |
33 | 33 |
34 /** | 34 /** |
35 * @addtogroup Interfaces | 35 * @addtogroup Interfaces |
36 * @{ | 36 * @{ |
37 */ | 37 */ |
38 /** | 38 /** |
39 * <code>PPB_ContentDecryptor_Private</code> structure contains the function | 39 * <code>PPB_ContentDecryptor_Private</code> structure contains the function |
40 * pointers the browser must implement to support plugins implementing the | 40 * pointers the browser must implement to support plugins implementing the |
41 * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides | 41 * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides |
42 * browser side support for the Content Decryption Module (CDM) for Encrypted | 42 * browser side support for the Content Decryption Module (CDM) for Encrypted |
43 * Media Extensions: http://www.w3.org/TR/encrypted-media/ | 43 * Media Extensions: http://www.w3.org/TR/encrypted-media/ |
44 */ | 44 */ |
45 struct PPB_ContentDecryptor_Private_0_11 { | 45 struct PPB_ContentDecryptor_Private_0_12 { |
46 /** | 46 /** |
47 * A session has been created by the CDM. | 47 * A promise has been resolved by the CDM. |
48 * | 48 * |
49 * @param[in] session_id Identifies the session for which the CDM | 49 * @param[in] promise_id Identifies the promise that the CDM resolved. |
50 * created a session. | 50 */ |
| 51 void (*PromiseResolved)(PP_Instance instance, uint32_t promise_id); |
| 52 /** |
| 53 * A promise has been resolved by the CDM. |
| 54 * |
| 55 * @param[in] promise_id Identifies the promise that the CDM resolved. |
51 * | 56 * |
52 * @param[in] web_session_id A <code>PP_Var</code> of type | 57 * @param[in] web_session_id A <code>PP_Var</code> of type |
53 * <code>PP_VARTYPE_STRING</code> containing the string for the | 58 * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute. |
54 * MediaKeySession's sessionId attribute. | 59 */ |
| 60 void (*PromiseResolvedWithSession)(PP_Instance instance, |
| 61 uint32_t promise_id, |
| 62 struct PP_Var web_session_id); |
| 63 /** |
| 64 * A promise has been rejected by the CDM due to an error. |
55 * | 65 * |
| 66 * @param[in] promise_id Identifies the promise that the CDM rejected. |
| 67 * |
| 68 * @param[in] exception_code A <code>PP_CdmExceptionCode</code> containing |
| 69 * the exception code. |
| 70 * |
| 71 * @param[in] system_code A system error code. |
| 72 * |
| 73 * @param[in] error_description A <code>PP_Var</code> of type |
| 74 * <code>PP_VARTYPE_STRING</code> containing the error description. |
56 */ | 75 */ |
57 void (*SessionCreated)(PP_Instance instance, | 76 void (*PromiseRejected)(PP_Instance instance, |
58 uint32_t session_id, | 77 uint32_t promise_id, |
59 struct PP_Var web_session_id); | 78 PP_CdmExceptionCode exception_code, |
| 79 uint32_t system_code, |
| 80 struct PP_Var error_description); |
60 /** | 81 /** |
61 * A message or request has been generated for key_system in the CDM, and | 82 * A message or request has been generated for key_system in the CDM, and |
62 * must be sent to the web application. | 83 * must be sent to the web application. |
63 * | 84 * |
64 * For example, when the browser invokes <code>CreateSession()</code> | 85 * For example, when the browser invokes <code>CreateSession()</code> |
65 * on the <code>PPP_ContentDecryptor_Private</code> interface, the plugin | 86 * on the <code>PPP_ContentDecryptor_Private</code> interface, the plugin |
66 * must send a message containing the license request. | 87 * must send a message containing the license request. |
67 * | 88 * |
68 * Note that <code>SessionMessage()</code> can be used for purposes other than | 89 * Note that <code>SessionMessage()</code> can be used for purposes other than |
69 * responses to <code>CreateSession()</code> calls. See also the text | 90 * responses to <code>CreateSession()</code> calls. See also the text |
70 * in the comment for <code>SessionReady()</code>, which describes a sequence | 91 * in the comment for <code>SessionReady()</code>, which describes a sequence |
71 * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls | 92 * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls |
72 * required to prepare for decryption. | 93 * required to prepare for decryption. |
73 * | 94 * |
74 * @param[in] session_id Identifies the session for which the message | 95 * @param[in] web_session_id A <code>PP_Var</code> of type |
75 * is intended. | 96 * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute for |
| 97 * which the message is intended. |
76 * | 98 * |
77 * @param[in] message A <code>PP_Var</code> of type | 99 * @param[in] message A <code>PP_Var</code> of type |
78 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message. | 100 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message. |
79 * | 101 * |
80 * @param[in] destination_url A <code>PP_Var</code> of type | 102 * @param[in] destination_url A <code>PP_Var</code> of type |
81 * <code>PP_VARTYPE_STRING</code> containing the destination URL for the | 103 * <code>PP_VARTYPE_STRING</code> containing the destination URL for the |
82 * message. | 104 * message. |
83 */ | 105 */ |
84 void (*SessionMessage)(PP_Instance instance, | 106 void (*SessionMessage)(PP_Instance instance, |
85 uint32_t session_id, | 107 struct PP_Var web_session_id, |
86 struct PP_Var message, | 108 struct PP_Var message, |
87 struct PP_Var destination_url); | 109 struct PP_Var destination_url); |
88 /** | 110 /** |
89 * The session is now ready to decrypt the media stream. | 111 * The session is now ready to decrypt the media stream. |
90 * | 112 * |
91 * Note: The above describes the most simple case. Depending on the key | 113 * Note: The above describes the most simple case. Depending on the key |
92 * system, a series of <code>SessionMessage()</code> calls from the CDM will | 114 * system, a series of <code>SessionMessage()</code> calls from the CDM will |
93 * be sent to the browser, and then on to the web application. The web | 115 * be sent to the browser, and then on to the web application. The web |
94 * application must then provide more data to the CDM by directing the browser | 116 * application must then provide more data to the CDM by directing the browser |
95 * to pass the data to the CDM via calls to <code>UpdateSession()</code> on | 117 * to pass the data to the CDM via calls to <code>UpdateSession()</code> on |
96 * the <code>PPP_ContentDecryptor_Private</code> interface. | 118 * the <code>PPP_ContentDecryptor_Private</code> interface. |
97 * The CDM must call <code>SessionReady()</code> when the sequence is | 119 * The CDM must call <code>SessionReady()</code> when the sequence is |
98 * completed, and, in response, the browser must notify the web application. | 120 * completed, and, in response, the browser must notify the web application. |
99 * | 121 * |
100 * @param[in] session_id Identifies the session that is ready. | 122 * @param[in] web_session_id A <code>PP_Var</code> of type |
| 123 * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute of |
| 124 * the session that is now ready. |
101 */ | 125 */ |
102 void (*SessionReady)(PP_Instance instance, uint32_t session_id); | 126 void (*SessionReady)(PP_Instance instance, struct PP_Var web_session_id); |
103 /** | 127 /** |
104 * The session has been closed as the result of a call to the | 128 * The session has been closed as the result of a call to the |
105 * <code>ReleaseSession()</code> method on the | 129 * <code>ReleaseSession()</code> method on the |
106 * <code>PPP_ContentDecryptor_Private</code> interface, or due to other | 130 * <code>PPP_ContentDecryptor_Private</code> interface, or due to other |
107 * factors as determined by the CDM. | 131 * factors as determined by the CDM. |
108 * | 132 * |
109 * @param[in] session_id Identifies the session that is closed. | 133 * @param[in] web_session_id A <code>PP_Var</code> of type |
| 134 * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute of |
| 135 * the session that is now closed. |
110 */ | 136 */ |
111 void (*SessionClosed)(PP_Instance instance, uint32_t session_id); | 137 void (*SessionClosed)(PP_Instance instance, struct PP_Var web_session_id); |
112 /** | 138 /** |
113 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, | 139 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, |
114 * or within the plugin implementing the interface. | 140 * or within the plugin implementing the interface. |
115 * | 141 * |
116 * @param[in] session_id Identifies the session for which the error | 142 * @param[in] web_session_id A <code>PP_Var</code> of type |
117 * is intended. | 143 * <code>PP_VARTYPE_STRING</code> containing the session's ID attribute of |
| 144 * the session that caused the error. |
118 * | 145 * |
119 * @param[in] media_error A MediaKeyError. | 146 * @param[in] exception_code A <code>PP_CdmExceptionCode</code> containing |
| 147 * the exception code. |
120 * | 148 * |
121 * @param[in] system_error A system error code. | 149 * @param[in] system_code A system error code. |
| 150 * |
| 151 * @param[in] error_description A <code>PP_Var</code> of type |
| 152 * <code>PP_VARTYPE_STRING</code> containing the error description. |
122 */ | 153 */ |
123 void (*SessionError)(PP_Instance instance, | 154 void (*SessionError)(PP_Instance instance, |
124 uint32_t session_id, | 155 struct PP_Var web_session_id, |
125 int32_t media_error, | 156 PP_CdmExceptionCode exception_code, |
126 uint32_t system_code); | 157 uint32_t system_code, |
| 158 struct PP_Var error_description); |
127 /** | 159 /** |
128 * Called after the <code>Decrypt()</code> method on the | 160 * Called after the <code>Decrypt()</code> method on the |
129 * <code>PPP_ContentDecryptor_Private</code> interface completes to | 161 * <code>PPP_ContentDecryptor_Private</code> interface completes to |
130 * deliver decrypted_block to the browser for decoding and rendering. | 162 * deliver decrypted_block to the browser for decoding and rendering. |
131 * | 163 * |
132 * The plugin must not hold a reference to the encrypted buffer resource | 164 * The plugin must not hold a reference to the encrypted buffer resource |
133 * provided to <code>Decrypt()</code> when it calls this method. The browser | 165 * provided to <code>Decrypt()</code> when it calls this method. The browser |
134 * will reuse the buffer in a subsequent <code>Decrypt()</code> call. | 166 * will reuse the buffer in a subsequent <code>Decrypt()</code> call. |
135 * | 167 * |
136 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a | 168 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 * @param[in] decrypted_sample_info A <code>PP_DecryptedSampleInfo</code> that | 278 * @param[in] decrypted_sample_info A <code>PP_DecryptedSampleInfo</code> that |
247 * contains the tracking info and result code associated with the decrypted | 279 * contains the tracking info and result code associated with the decrypted |
248 * samples. | 280 * samples. |
249 */ | 281 */ |
250 void (*DeliverSamples)( | 282 void (*DeliverSamples)( |
251 PP_Instance instance, | 283 PP_Instance instance, |
252 PP_Resource audio_frames, | 284 PP_Resource audio_frames, |
253 const struct PP_DecryptedSampleInfo* decrypted_sample_info); | 285 const struct PP_DecryptedSampleInfo* decrypted_sample_info); |
254 }; | 286 }; |
255 | 287 |
256 typedef struct PPB_ContentDecryptor_Private_0_11 PPB_ContentDecryptor_Private; | 288 typedef struct PPB_ContentDecryptor_Private_0_12 PPB_ContentDecryptor_Private; |
257 /** | 289 /** |
258 * @} | 290 * @} |
259 */ | 291 */ |
260 | 292 |
261 #endif /* PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ */ | 293 #endif /* PPAPI_C_PRIVATE_PPB_CONTENT_DECRYPTOR_PRIVATE_H_ */ |
262 | 294 |
OLD | NEW |