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