OLD | NEW |
(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 /** |
| 7 * This file defines the <code>PPB_ContentDecryptor_Dev</code> |
| 8 * interface. |
| 9 */ |
| 10 label Chrome { |
| 11 M23 = 0.1 |
| 12 }; |
| 13 |
| 14 /** |
| 15 * <code>PPB_ContentDecryptor_Dev</code> structure contains the function |
| 16 * pointers the browser MUST implement to support plugins implementing the |
| 17 * <code>PPP_ContentDecryptor_Dev</code> interface. |
| 18 */ |
| 19 interface PPB_ContentDecryptor_Dev { |
| 20 |
| 21 /** |
| 22 * The media stack needs a key to decrypt content, and uses this method to |
| 23 * notify the decryptor of the requirement and provide content specific |
| 24 * decryptor initialization data. <code>NeedKey</code> is used in the |
| 25 * typical playback start up case, after playback resumes, or because a |
| 26 * key already in use has expired. |
| 27 * |
| 28 * @param[in] key_system A <code>PP_Var</code> of type |
| 29 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 30 * |
| 31 * @param[in] session_id A <code>PP_Var</code> of type |
| 32 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 33 * |
| 34 * @param[in] init_data A <code>PP_Var</code> of type |
| 35 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific |
| 36 * initialization data. |
| 37 */ |
| 38 void NeedKey( |
| 39 [in] PP_Instance instance, |
| 40 [in] PP_Var key_system, |
| 41 [in] PP_Var session_id, |
| 42 [in] PP_Var init_data); |
| 43 |
| 44 /** |
| 45 * A key has been added as the result of a call to the <code>AddKey()</code> |
| 46 * method on the <code>PPP_ContentDecryptor_Dev</code> interface. |
| 47 * |
| 48 * @param[in] key_system A <code>PP_Var</code> of type |
| 49 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 50 * |
| 51 * @param[in] session_id A <code>PP_Var</code> of type |
| 52 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 53 */ |
| 54 void KeyAdded( |
| 55 [in] PP_Instance instance, |
| 56 [in] PP_Var key_system, |
| 57 [in] PP_Var session_id); |
| 58 |
| 59 /** |
| 60 * A message or request has been generated by or for key_system. For example, |
| 61 * a key request has been generated as the result of call to the |
| 62 * <code>GenerateKeyRequest()</code> method on the |
| 63 * <code>PPP_ContentDecryptor_Dev</code> interface or another message |
| 64 * must be sent in response to an <code>AddKey()</code> call. Note that |
| 65 * <code>KeyMessage</code> can be used for purposes other than results to |
| 66 * <code>AddKey()</code> calls. |
| 67 * |
| 68 * @param[in] key_system A <code>PP_Var</code> of type |
| 69 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 70 * |
| 71 * @param[in] session_id A <code>PP_Var</code> of type |
| 72 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 73 * |
| 74 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 75 * <code>PPB_Buffer_Dev</code> resource that contains the message. |
| 76 * |
| 77 * @param[in] session_id A <code>PP_Var</code> of type |
| 78 * <code>PP_VARTYPE_STRING</code> containing the default URL for key system. |
| 79 */ |
| 80 void KeyMessage( |
| 81 [in] PP_Instance instance, |
| 82 [in] PP_Var key_system, |
| 83 [in] PP_Var session_id, |
| 84 [in] PP_Resource message, |
| 85 [in] PP_Var default_url); |
| 86 |
| 87 /** |
| 88 * An error occurred in a <code>PPP_ContentDecryptor_Dev</code> method, |
| 89 * or within the plugin implementing the interface. |
| 90 * |
| 91 * @param[in] key_system A <code>PP_Var</code> of type |
| 92 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 93 * |
| 94 * @param[in] session_id A <code>PP_Var</code> of type |
| 95 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 96 * |
| 97 * @param[in] media_error A media stack error code. |
| 98 * |
| 99 * @param[in] system_error A system error code. |
| 100 */ |
| 101 void KeyError( |
| 102 [in] PP_Instance instance, |
| 103 [in] PP_Var key_system, |
| 104 [in] PP_Var session_id, |
| 105 [in] int32_t media_error, |
| 106 [in] int32_t system_error); |
| 107 |
| 108 /** |
| 109 * Called after the <code>Decrypt</code> method on the |
| 110 * <code>PPP_ContentDecryptor_Dev</code> interface completes to |
| 111 * deliver decrypted_block to the media stack. |
| 112 * |
| 113 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 114 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data |
| 115 * block. |
| 116 * |
| 117 * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to |
| 118 * match returned decrypted data to a callback sent from the media stack. |
| 119 */ |
| 120 void DeliverBlock( |
| 121 [in] PP_Instance instance, |
| 122 [in] PP_Resource decrypted_block, |
| 123 [in] uint64_t request_id); |
| 124 |
| 125 /** |
| 126 * Called after the <code>DecryptAndDecode</code> method on the |
| 127 * <code>PPP_ContentDecryptor_Dev</code> interface completes to |
| 128 * deliver decrypted_frame to the media stack. |
| 129 * |
| 130 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 131 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted video |
| 132 * frame. |
| 133 * |
| 134 * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to |
| 135 * match returned decrypted data to a callback sent from the media stack. |
| 136 */ |
| 137 void DeliverFrame( |
| 138 [in] PP_Instance instance, |
| 139 [in] PP_Resource decrypted_frame, |
| 140 [in] uint64_t request_id); |
| 141 |
| 142 /** |
| 143 * Called after the <code>DecryptAndDecode</code> method on the |
| 144 * <code>PPP_ContentDecryptor_Dev</code> interface completes to |
| 145 * deliver decrypted_samples to the media stack. |
| 146 * |
| 147 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 148 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer |
| 149 * of audio samples. |
| 150 * |
| 151 * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to |
| 152 * match returned decrypted data to a callback sent from the media stack. |
| 153 */ |
| 154 void DeliverSamples( |
| 155 [in] PP_Instance instance, |
| 156 [in] PP_Resource decrypted_samples, |
| 157 [in] uint64_t request_id); |
| 158 }; |
OLD | NEW |