| 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 Fri Aug 17 09:07:21 2012. | 7 * modified Tue Aug 21 18:37:34 2012. |
| 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_1 \ | 21 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 \ |
| 22 "PPP_ContentDecryptor_Private;0.1" | 22 "PPP_ContentDecryptor_Private;0.1" |
| 23 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ | 23 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ |
| 24 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 | 24 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 |
| 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 (CDM), 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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 52 * other methods on this interface. The session ID must be provided to the | 52 * other methods on this interface. The session ID must be provided to the |
| 53 * browser by the CDM via <code>KeyMessage()</code> on the | 53 * browser by the CDM via <code>KeyMessage()</code> on the |
| 54 * <code>PPB_ContentDecryptor_Private</code> interface. | 54 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 55 * | 55 * |
| 56 * @param[in] key_system A <code>PP_Var</code> of type | 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. | 57 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 58 * | 58 * |
| 59 * @param[in] init_data A <code>PP_Var</code> of type | 59 * @param[in] init_data A <code>PP_Var</code> of type |
| 60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| 61 * initialization data. | 61 * initialization data. |
| 62 * |
| 63 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM |
| 64 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the |
| 65 * CDM, the call result/stuatus can always be reported asynchronously through |
| 66 * the <code>PPB_ContentDecryptor_Private</code> interface. |
| 62 */ | 67 */ |
| 63 PP_Bool (*GenerateKeyRequest)(PP_Instance instance, | 68 PP_Bool (*GenerateKeyRequest)(PP_Instance instance, |
| 64 struct PP_Var key_system, | 69 struct PP_Var key_system, |
| 65 struct PP_Var init_data); | 70 struct PP_Var init_data); |
| 66 /** | 71 /** |
| 67 * Provides a key or license to the decryptor for decrypting media data. | 72 * Provides a key or license to the decryptor for decrypting media data. |
| 68 * | 73 * |
| 69 * When the CDM needs more information to complete addition of the key it | 74 * When the CDM needs more information to complete addition of the key it |
| 70 * will call <code>KeyMessage()</code> on the | 75 * will call <code>KeyMessage()</code> on the |
| 71 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser | 76 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser |
| 72 * passes to the application. When the key is ready to use, the CDM | 77 * passes to the application. When the key is ready to use, the CDM |
| 73 * must call call <code>KeyAdded()</code> on the | 78 * must call call <code>KeyAdded()</code> on the |
| 74 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser | 79 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
| 75 * must notify the web application. | 80 * must notify the web application. |
| 76 * | 81 * |
| 77 * @param[in] session_id A <code>PP_Var</code> of type | 82 * @param[in] session_id A <code>PP_Var</code> of type |
| 78 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 83 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 79 * | 84 * |
| 80 * @param[in] key A <code>PP_Var</code> of type | 85 * @param[in] key A <code>PP_Var</code> of type |
| 81 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, | 86 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, |
| 82 * or other message for the given session ID. | 87 * or other message for the given session ID. |
| 83 * | 88 * |
| 84 * @param[in] init_data A <code>PP_Var</code> of type | 89 * @param[in] init_data A <code>PP_Var</code> of type |
| 85 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 90 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| 86 * initialization data. | 91 * initialization data. |
| 92 * |
| 93 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM |
| 94 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the |
| 95 * CDM, the call result/stuatus can always be reported asynchronously through |
| 96 * the <code>PPB_ContentDecryptor_Private</code> interface. |
| 87 */ | 97 */ |
| 88 PP_Bool (*AddKey)(PP_Instance instance, | 98 PP_Bool (*AddKey)(PP_Instance instance, |
| 89 struct PP_Var session_id, | 99 struct PP_Var session_id, |
| 90 struct PP_Var key, | 100 struct PP_Var key, |
| 91 struct PP_Var init_data); | 101 struct PP_Var init_data); |
| 92 /** | 102 /** |
| 93 * Cancels a pending key request for the specified session ID. | 103 * Cancels a pending key request for the specified session ID. |
| 94 * | 104 * |
| 95 * @param[in] session_id A <code>PP_Var</code> of type | 105 * @param[in] session_id A <code>PP_Var</code> of type |
| 96 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 106 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 107 * |
| 108 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM |
| 109 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the |
| 110 * CDM, the call result/stuatus can always be reported asynchronously through |
| 111 * the <code>PPB_ContentDecryptor_Private</code> interface. |
| 97 */ | 112 */ |
| 98 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); | 113 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); |
| 99 /** | 114 /** |
| 100 * Decrypts the block and returns the unencrypted block via | 115 * Decrypts the block and returns the unencrypted block via |
| 101 * <code>DeliverBlock()</code> on the | 116 * <code>DeliverBlock()</code> on the |
| 102 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block | 117 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
| 103 * contains encoded data. | 118 * contains encoded data. |
| 104 * | 119 * |
| 105 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 120 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 106 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 121 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 107 * block. | 122 * block. |
| 108 * | 123 * |
| 109 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 124 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
| 110 * contains all auxiliary information needed for decryption of the | 125 * contains all auxiliary information needed for decryption of the |
| 111 * <code>encrypted_block</code>. | 126 * <code>encrypted_block</code>. |
| 127 * |
| 128 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM |
| 129 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the |
| 130 * CDM, the call result/stuatus can always be reported asynchronously through |
| 131 * the <code>PPB_ContentDecryptor_Private</code> interface. |
| 112 */ | 132 */ |
| 113 PP_Bool (*Decrypt)( | 133 PP_Bool (*Decrypt)( |
| 114 PP_Instance instance, | 134 PP_Instance instance, |
| 115 PP_Resource encrypted_block, | 135 PP_Resource encrypted_block, |
| 116 const struct PP_EncryptedBlockInfo* encrypted_block_info); | 136 const struct PP_EncryptedBlockInfo* encrypted_block_info); |
| 117 /** | 137 /** |
| 118 * Decrypts the block, decodes it, and returns the unencrypted uncompressed | 138 * Decrypts the block, decodes it, and returns the unencrypted uncompressed |
| 119 * (decoded) media to the browser via the | 139 * (decoded) media to the browser via the |
| 120 * <code>PPB_ContentDecryptor_Private</code> interface. | 140 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 121 * | 141 * |
| 122 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, | 142 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, |
| 123 * and decrypted and decoded audio samples are sent to | 143 * and decrypted and decoded audio samples are sent to |
| 124 * <code>DeliverSamples()</code>. | 144 * <code>DeliverSamples()</code>. |
| 125 * | 145 * |
| 126 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 146 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 127 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 147 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 128 * block. | 148 * block. |
| 129 * | 149 * |
| 130 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 150 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
| 131 * contains all auxiliary information needed for decryption of the | 151 * contains all auxiliary information needed for decryption of the |
| 132 * <code>encrypted_block</code>. | 152 * <code>encrypted_block</code>. |
| 153 * |
| 154 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM |
| 155 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the |
| 156 * CDM, the call result/stuatus can always be reported asynchronously through |
| 157 * the <code>PPB_ContentDecryptor_Private</code> interface. |
| 133 */ | 158 */ |
| 134 PP_Bool (*DecryptAndDecode)( | 159 PP_Bool (*DecryptAndDecode)( |
| 135 PP_Instance instance, | 160 PP_Instance instance, |
| 136 PP_Resource encrypted_block, | 161 PP_Resource encrypted_block, |
| 137 const struct PP_EncryptedBlockInfo* encrypted_block_info); | 162 const struct PP_EncryptedBlockInfo* encrypted_block_info); |
| 138 }; | 163 }; |
| 139 | 164 |
| 140 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private; | 165 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private; |
| 141 /** | 166 /** |
| 142 * @} | 167 * @} |
| 143 */ | 168 */ |
| 144 | 169 |
| 145 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ | 170 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ |
| 146 | 171 |
| OLD | NEW |