| 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 /* From private/ppp_content_decryptor_private.idl, | 6 /* From private/ppp_content_decryptor_private.idl, |
| 7 * modified Mon Feb 10 13:23:32 2014. | 7 * modified Thu May 1 10:36:31 2014. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ | 10 #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ |
| 11 #define PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ | 11 #define PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ |
| 12 | 12 |
| 13 #include "ppapi/c/pp_bool.h" | 13 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
| 16 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_stdint.h" | 17 #include "ppapi/c/pp_stdint.h" |
| 18 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
| 19 #include "ppapi/c/private/pp_content_decryptor.h" | 19 #include "ppapi/c/private/pp_content_decryptor.h" |
| 20 | 20 |
| 21 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_11 \ | 21 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_12 \ |
| 22 "PPP_ContentDecryptor_Private;0.11" | 22 "PPP_ContentDecryptor_Private;0.12" |
| 23 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ | 23 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ |
| 24 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_11 | 24 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_12 |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * @file | 27 * @file |
| 28 * This file defines the <code>PPP_ContentDecryptor_Private</code> | 28 * This file defines the <code>PPP_ContentDecryptor_Private</code> |
| 29 * interface. Note: This is a special interface, only to be used for Content | 29 * interface. Note: This is a special interface, only to be used for Content |
| 30 * Decryption Modules, not normal plugins. | 30 * Decryption Modules, not normal plugins. |
| 31 */ | 31 */ |
| 32 | 32 |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * @addtogroup Interfaces | 35 * @addtogroup Interfaces |
| 36 * @{ | 36 * @{ |
| 37 */ | 37 */ |
| 38 /** | 38 /** |
| 39 * <code>PPP_ContentDecryptor_Private</code> structure contains the function | 39 * <code>PPP_ContentDecryptor_Private</code> structure contains the function |
| 40 * pointers the decryption plugin must implement to provide services needed by | 40 * pointers the decryption plugin must implement to provide services needed by |
| 41 * the browser. This interface provides the plugin side support for the Content | 41 * the browser. This interface provides the plugin side support for the Content |
| 42 * Decryption Module (CDM) for Encrypted Media Extensions: | 42 * Decryption Module (CDM) for Encrypted Media Extensions: |
| 43 * http://www.w3.org/TR/encrypted-media/ | 43 * http://www.w3.org/TR/encrypted-media/ |
| 44 */ | 44 */ |
| 45 struct PPP_ContentDecryptor_Private_0_11 { | 45 struct PPP_ContentDecryptor_Private_0_12 { |
| 46 /** | 46 /** |
| 47 * Initialize for the specified key system. | 47 * Initialize for the specified key system. |
| 48 * | 48 * |
| 49 * @param[in] key_system A <code>PP_Var</code> of type | 49 * @param[in] key_system A <code>PP_Var</code> of type |
| 50 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | 50 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 51 */ | 51 */ |
| 52 void (*Initialize)(PP_Instance instance, struct PP_Var key_system); | 52 void (*Initialize)(PP_Instance instance, struct PP_Var key_system); |
| 53 /** | 53 /** |
| 54 * Creates a session. <code>content_type</code> contains the MIME type of | 54 * Creates a session. <code>init_data_type</code> contains the MIME type of |
| 55 * <code>init_data</code>. <code>init_data</code> is a data buffer | 55 * <code>init_data</code>. <code>init_data</code> is a data buffer |
| 56 * containing data for use in generating the request. | 56 * containing data for use in generating the request. |
| 57 * | 57 * |
| 58 * Note: <code>CreateSession()</code> must create a web session ID and provide | 58 * Note: <code>CreateSession()</code> must create a web session ID and provide |
| 59 * it to the browser via <code>SessionCreated()</code> on the | 59 * it to the browser via <code>SessionCreated()</code> on the |
| 60 * <code>PPB_ContentDecryptor_Private</code> interface. | 60 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 61 * | 61 * |
| 62 * @param[in] session_id A reference for the session for which a session | 62 * @param[in] promise_id A reference for the promise that gets resolved or |
| 63 * should be generated. | 63 * rejected depending upon the success or failure when creating the session. |
| 64 * | 64 * |
| 65 * @param[in] content_type A <code>PP_Var</code> of type | 65 * @param[in] init_data_type A <code>PP_Var</code> of type |
| 66 * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. | 66 * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. |
| 67 * | 67 * |
| 68 * @param[in] init_data A <code>PP_Var</code> of type | 68 * @param[in] init_data A <code>PP_Var</code> of type |
| 69 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 69 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| 70 * initialization data. | 70 * initialization data. |
| 71 * |
| 72 * @param[in] session_type A <code>PP_SessionType</code> that indicates the |
| 73 * type of session to be created. |
| 71 */ | 74 */ |
| 72 void (*CreateSession)(PP_Instance instance, | 75 void (*CreateSession)(PP_Instance instance, |
| 73 uint32_t session_id, | 76 uint32_t promise_id, |
| 74 struct PP_Var content_type, | 77 struct PP_Var init_data_type, |
| 75 struct PP_Var init_data); | 78 struct PP_Var init_data, |
| 79 PP_SessionType session_type); |
| 76 /** | 80 /** |
| 77 * Loads a session whose web session ID is <code>web_session_id</code>. | 81 * Loads a session whose web session ID is <code>web_session_id</code>. |
| 78 * | 82 * |
| 79 * Note: After the session is successfully loaded, the CDM must call | 83 * Note: After the session is successfully loaded, the CDM must call |
| 80 * <code>SessionCreated()</code> with <code>web_session_id</code> on the | 84 * <code>SessionCreated()</code> with <code>web_session_id</code> on the |
| 81 * <code>PPB_ContentDecryptor_Private</code> interface. | 85 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 82 * | 86 * |
| 83 * @param[in] session_id A reference for the session for which a session | 87 * @param[in] promise_id A reference for the promise that gets resolved or |
| 84 * should be loaded. | 88 * rejected depending upon the success or failure of loading the session. |
| 85 * | 89 * |
| 86 * @param[in] web_session_id A <code>PP_Var</code> of type | 90 * @param[in] web_session_id A <code>PP_Var</code> of type |
| 87 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session | 91 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session |
| 88 * to load. | 92 * to load. |
| 89 */ | 93 */ |
| 90 void (*LoadSession)(PP_Instance instance, | 94 void (*LoadSession)(PP_Instance instance, |
| 91 uint32_t session_id, | 95 uint32_t promise_id, |
| 92 struct PP_Var web_session_id); | 96 struct PP_Var web_session_id); |
| 93 /** | 97 /** |
| 94 * Provides a license or other message to the decryptor. | 98 * Provides a license or other message to the decryptor. |
| 95 * | 99 * |
| 96 * When the CDM needs more information, it must call | 100 * When the CDM needs more information, it must call |
| 97 * <code>SessionMessage()</code> on the | 101 * <code>SessionMessage()</code> on the |
| 98 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser | 102 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
| 99 * must notify the web application. When the CDM has finished processing | 103 * must notify the web application. When the CDM has finished processing |
| 100 * <code>response</code> and needs no more information, it must call | 104 * <code>response</code> and needs no more information, it must call |
| 101 * <code>SessionReady()</code> on the | 105 * <code>SessionReady()</code> on the |
| 102 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser | 106 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
| 103 * must notify the web application. | 107 * must notify the web application. |
| 104 * | 108 * |
| 105 * @param[in] session_id A reference for the session to update. | 109 * @param[in] promise_id A reference for the promise that gets resolved or |
| 110 * rejected depending upon the success or failure of updating the session. |
| 111 * |
| 112 * @param[in] web_session_id A <code>PP_Var</code> of type |
| 113 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session |
| 114 * to be updated. |
| 106 * | 115 * |
| 107 * @param[in] response A <code>PP_Var</code> of type | 116 * @param[in] response A <code>PP_Var</code> of type |
| 108 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the license or other | 117 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the license or other |
| 109 * message for the given session ID. | 118 * message for the given session ID. |
| 110 */ | 119 */ |
| 111 void (*UpdateSession)(PP_Instance instance, | 120 void (*UpdateSession)(PP_Instance instance, |
| 112 uint32_t session_id, | 121 uint32_t promise_id, |
| 122 struct PP_Var web_session_id, |
| 113 struct PP_Var response); | 123 struct PP_Var response); |
| 114 /** | 124 /** |
| 115 * Release the specified session and related resources. | 125 * Release the specified session and related resources. |
| 116 * | 126 * |
| 117 * @param[in] session_id A reference for the session that should be | 127 * @param[in] promise_id A reference for the promise that gets resolved or |
| 118 * released. | 128 * rejected depending upon the success or failure of releasing the session. |
| 129 * |
| 130 * @param[in] web_session_id A <code>PP_Var</code> of type |
| 131 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session |
| 132 * to be released. |
| 133 * |
| 119 */ | 134 */ |
| 120 void (*ReleaseSession)(PP_Instance instance, uint32_t session_id); | 135 void (*ReleaseSession)(PP_Instance instance, |
| 136 uint32_t promise_id, |
| 137 struct PP_Var web_session_id); |
| 121 /** | 138 /** |
| 122 * Decrypts the block and returns the unencrypted block via | 139 * Decrypts the block and returns the unencrypted block via |
| 123 * <code>DeliverBlock()</code> on the | 140 * <code>DeliverBlock()</code> on the |
| 124 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block | 141 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
| 125 * contains encoded data. | 142 * contains encoded data. |
| 126 * | 143 * |
| 127 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 144 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 128 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 145 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 129 * block. | 146 * block. |
| 130 * | 147 * |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 * contains all auxiliary information needed for decryption of the | 254 * contains all auxiliary information needed for decryption of the |
| 238 * <code>encrypted_block</code>. | 255 * <code>encrypted_block</code>. |
| 239 */ | 256 */ |
| 240 void (*DecryptAndDecode)( | 257 void (*DecryptAndDecode)( |
| 241 PP_Instance instance, | 258 PP_Instance instance, |
| 242 PP_DecryptorStreamType decoder_type, | 259 PP_DecryptorStreamType decoder_type, |
| 243 PP_Resource encrypted_buffer, | 260 PP_Resource encrypted_buffer, |
| 244 const struct PP_EncryptedBlockInfo* encrypted_block_info); | 261 const struct PP_EncryptedBlockInfo* encrypted_block_info); |
| 245 }; | 262 }; |
| 246 | 263 |
| 247 typedef struct PPP_ContentDecryptor_Private_0_11 PPP_ContentDecryptor_Private; | 264 typedef struct PPP_ContentDecryptor_Private_0_12 PPP_ContentDecryptor_Private; |
| 248 /** | 265 /** |
| 249 * @} | 266 * @} |
| 250 */ | 267 */ |
| 251 | 268 |
| 252 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ | 269 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ |
| 253 | 270 |
| OLD | NEW |