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