Chromium Code Reviews| 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 M33 = 0.9 | 15 M33 = 0.9 |
| 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 session has been created by the CDM. |
| 28 * | 28 * |
| 29 * @param[in] reference_id A reference for the session for which the CDM | 29 * @param[in] session_id A reference for the session for which the CDM |
|
ddorwin
2013/12/05 00:44:52
An identifier...?
Identifies the session...?
jrummell
2013/12/06 23:42:35
Done.
| |
| 30 * created a session. | 30 * created a session. |
| 31 * | 31 * |
| 32 * @param[in] web_session_id A <code>PP_Var</code> of type | 32 * @param[in] web_session_id A <code>PP_Var</code> of type |
| 33 * <code>PP_VARTYPE_STRING</code> containing the string for the | 33 * <code>PP_VARTYPE_STRING</code> containing the string for the |
| 34 * MediaKeySession's sessionId attribute. | 34 * MediaKeySession's sessionId attribute. |
| 35 * | 35 * |
| 36 */ | 36 */ |
| 37 void SessionCreated( | 37 void SessionCreated( |
| 38 [in] PP_Instance instance, | 38 [in] PP_Instance instance, |
| 39 [in] uint32_t reference_id, | 39 [in] uint32_t session_id, |
| 40 [in] PP_Var web_session_id); | 40 [in] PP_Var web_session_id); |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * A message or request has been generated for key_system in the CDM, and | 43 * A message or request has been generated for key_system in the CDM, and |
| 44 * must be sent to the web application. | 44 * must be sent to the web application. |
| 45 * | 45 * |
| 46 * For example, when the browser invokes <code>CreateSession()</code> | 46 * For example, when the browser invokes <code>CreateSession()</code> |
| 47 * on the <code>PPP_ContentDecryptor_Private</code> interface, the plugin | 47 * on the <code>PPP_ContentDecryptor_Private</code> interface, the plugin |
| 48 * must send a message containing the license request. | 48 * must send a message containing the license request. |
| 49 * | 49 * |
| 50 * Note that <code>SessionMessage()</code> can be used for purposes other than | 50 * Note that <code>SessionMessage()</code> can be used for purposes other than |
| 51 * responses to <code>CreateSession()</code> calls. See also the text | 51 * responses to <code>CreateSession()</code> calls. See also the text |
| 52 * in the comment for <code>SessionReady()</code>, which describes a sequence | 52 * in the comment for <code>SessionReady()</code>, which describes a sequence |
| 53 * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls | 53 * of <code>UpdateSession()</code> and <code>SessionMessage()</code> calls |
| 54 * required to prepare for decryption. | 54 * required to prepare for decryption. |
| 55 * | 55 * |
| 56 * @param[in] reference_id A reference for the session for which the message | 56 * @param[in] session_id A reference for the session for which the message |
| 57 * is intended. | 57 * is intended. |
| 58 * | 58 * |
| 59 * @param[in] message A <code>PP_Var</code> of type | 59 * @param[in] message A <code>PP_Var</code> of type |
| 60 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message. | 60 * <code>PP_VARTYPE_ARRAY_BUFFER</code> that contains the message. |
| 61 * | 61 * |
| 62 * @param[in] destination_url A <code>PP_Var</code> of type | 62 * @param[in] destination_url A <code>PP_Var</code> of type |
| 63 * <code>PP_VARTYPE_STRING</code> containing the destination URL for the | 63 * <code>PP_VARTYPE_STRING</code> containing the destination URL for the |
| 64 * message. | 64 * message. |
| 65 */ | 65 */ |
| 66 void SessionMessage( | 66 void SessionMessage( |
| 67 [in] PP_Instance instance, | 67 [in] PP_Instance instance, |
| 68 [in] uint32_t reference_id, | 68 [in] uint32_t session_id, |
| 69 [in] PP_Var message, | 69 [in] PP_Var message, |
| 70 [in] PP_Var destination_url); | 70 [in] PP_Var destination_url); |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * The session is now ready to decrypt the media stream. | 73 * The session is now ready to decrypt the media stream. |
| 74 * | 74 * |
| 75 * Note: The above describes the most simple case. Depending on the key | 75 * 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 | 76 * 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 | 77 * 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 | 78 * 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 | 79 * to pass the data to the CDM via calls to <code>UpdateSession()</code> on |
| 80 * the <code>PPP_ContentDecryptor_Private</code> interface. | 80 * the <code>PPP_ContentDecryptor_Private</code> interface. |
| 81 * The CDM must call <code>SessionReady()</code> when the sequence is | 81 * The CDM must call <code>SessionReady()</code> when the sequence is |
| 82 * completed, and, in response, the browser must notify the web application. | 82 * completed, and, in response, the browser must notify the web application. |
| 83 * | 83 * |
| 84 * @param[in] reference_id A reference for the session that is ready. | 84 * @param[in] session_id A reference for the session that is ready. |
| 85 */ | 85 */ |
| 86 void SessionReady( | 86 void SessionReady( |
| 87 [in] PP_Instance instance, | 87 [in] PP_Instance instance, |
| 88 [in] uint32_t reference_id); | 88 [in] uint32_t session_id); |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * The session has been closed as the result of a call to the | 91 * The session has been closed as the result of a call to the |
| 92 * <code>ReleaseSession()</code> method on the | 92 * <code>ReleaseSession()</code> method on the |
| 93 * <code>PPP_ContentDecryptor_Private</code> interface, or due to other | 93 * <code>PPP_ContentDecryptor_Private</code> interface, or due to other |
| 94 * factors as determined by the CDM. | 94 * factors as determined by the CDM. |
| 95 * | 95 * |
| 96 * @param[in] reference_id A reference for the session that is closed. | 96 * @param[in] session_id A reference for the session that is closed. |
| 97 */ | 97 */ |
| 98 void SessionClosed( | 98 void SessionClosed( |
| 99 [in] PP_Instance instance, | 99 [in] PP_Instance instance, |
| 100 [in] uint32_t reference_id); | 100 [in] uint32_t session_id); |
| 101 | 101 |
| 102 /** | 102 /** |
| 103 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, | 103 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, |
| 104 * or within the plugin implementing the interface. | 104 * or within the plugin implementing the interface. |
| 105 * | 105 * |
| 106 * @param[in] reference_id A reference for the session for which the error | 106 * @param[in] session_id A reference for the session for which the error |
| 107 * is intended. | 107 * is intended. |
| 108 * | 108 * |
| 109 * @param[in] media_error A MediaKeyError. | 109 * @param[in] media_error A MediaKeyError. |
| 110 * | 110 * |
| 111 * @param[in] system_error A system error code. | 111 * @param[in] system_error A system error code. |
| 112 */ | 112 */ |
| 113 void SessionError( | 113 void SessionError( |
| 114 [in] PP_Instance instance, | 114 [in] PP_Instance instance, |
| 115 [in] uint32_t reference_id, | 115 [in] uint32_t session_id, |
| 116 [in] int32_t media_error, | 116 [in] int32_t media_error, |
| 117 [in] int32_t system_code); | 117 [in] int32_t system_code); |
| 118 | 118 |
| 119 /** | 119 /** |
| 120 * Called after the <code>Decrypt()</code> method on the | 120 * Called after the <code>Decrypt()</code> method on the |
| 121 * <code>PPP_ContentDecryptor_Private</code> interface completes to | 121 * <code>PPP_ContentDecryptor_Private</code> interface completes to |
| 122 * deliver decrypted_block to the browser for decoding and rendering. | 122 * deliver decrypted_block to the browser for decoding and rendering. |
| 123 * | 123 * |
| 124 * The plugin must not hold a reference to the encrypted buffer resource | 124 * 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 | 125 * provided to <code>Decrypt()</code> when it calls this method. The browser |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 * | 245 * |
| 246 * @param[in] decrypted_sample_info A <code>PP_DecryptedSampleInfo</code> that | 246 * @param[in] decrypted_sample_info A <code>PP_DecryptedSampleInfo</code> that |
| 247 * contains the tracking info and result code associated with the decrypted | 247 * contains the tracking info and result code associated with the decrypted |
| 248 * samples. | 248 * samples. |
| 249 */ | 249 */ |
| 250 void DeliverSamples( | 250 void DeliverSamples( |
| 251 [in] PP_Instance instance, | 251 [in] PP_Instance instance, |
| 252 [in] PP_Resource audio_frames, | 252 [in] PP_Resource audio_frames, |
| 253 [in] PP_DecryptedSampleInfo decrypted_sample_info); | 253 [in] PP_DecryptedSampleInfo decrypted_sample_info); |
| 254 }; | 254 }; |
| OLD | NEW |