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