| 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 /** | 6 /** |
| 7 * This file defines the <code>PPP_ContentDecryptor_Private</code> | 7 * This file defines the <code>PPP_ContentDecryptor_Private</code> |
| 8 * interface. Note: This is a special interface, only to be used for Content | 8 * interface. Note: This is a special interface, only to be used for Content |
| 9 * Decryption Modules, not normal plugins. | 9 * Decryption Modules, not normal plugins. |
| 10 */ | 10 */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 * other methods on this interface. The session ID must be provided to the | 29 * other methods on this interface. The session ID must be provided to the |
| 30 * browser by the CDM via <code>KeyMessage()</code> on the | 30 * browser by the CDM via <code>KeyMessage()</code> on the |
| 31 * <code>PPB_ContentDecryptor_Private</code> interface. | 31 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 32 * | 32 * |
| 33 * @param[in] key_system A <code>PP_Var</code> of type | 33 * @param[in] key_system A <code>PP_Var</code> of type |
| 34 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | 34 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 35 * | 35 * |
| 36 * @param[in] init_data A <code>PP_Var</code> of type | 36 * @param[in] init_data A <code>PP_Var</code> of type |
| 37 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 37 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| 38 * initialization data. | 38 * initialization data. |
| 39 * | |
| 40 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
| 41 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
| 42 * CDM, the call result/status should be reported through the | |
| 43 * <code>PPB_ContentDecryptor_Private</code> interface. | |
| 44 */ | 39 */ |
| 45 PP_Bool GenerateKeyRequest( | 40 void GenerateKeyRequest( |
| 46 [in] PP_Instance instance, | 41 [in] PP_Instance instance, |
| 47 [in] PP_Var key_system, | 42 [in] PP_Var key_system, |
| 48 [in] PP_Var init_data); | 43 [in] PP_Var init_data); |
| 49 | 44 |
| 50 /** | 45 /** |
| 51 * Provides a key or license to the decryptor for decrypting media data. | 46 * Provides a key or license to the decryptor for decrypting media data. |
| 52 * | 47 * |
| 53 * When the CDM needs more information to complete addition of the key it | 48 * When the CDM needs more information to complete addition of the key it |
| 54 * will call <code>KeyMessage()</code> on the | 49 * will call <code>KeyMessage()</code> on the |
| 55 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser | 50 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser |
| 56 * passes to the application. When the key is ready to use, the CDM | 51 * passes to the application. When the key is ready to use, the CDM |
| 57 * must call call <code>KeyAdded()</code> on the | 52 * must call call <code>KeyAdded()</code> on the |
| 58 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser | 53 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
| 59 * must notify the web application. | 54 * must notify the web application. |
| 60 * | 55 * |
| 61 * @param[in] session_id A <code>PP_Var</code> of type | 56 * @param[in] session_id A <code>PP_Var</code> of type |
| 62 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 57 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 63 * | 58 * |
| 64 * @param[in] key A <code>PP_Var</code> of type | 59 * @param[in] key A <code>PP_Var</code> of type |
| 65 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, | 60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, |
| 66 * or other message for the given session ID. | 61 * or other message for the given session ID. |
| 67 * | 62 * |
| 68 * @param[in] init_data A <code>PP_Var</code> of type | 63 * @param[in] init_data A <code>PP_Var</code> of type |
| 69 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 64 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| 70 * initialization data. | 65 * initialization data. |
| 71 * | |
| 72 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
| 73 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
| 74 * CDM, the call result/status should be reported through the | |
| 75 * <code>PPB_ContentDecryptor_Private</code> interface. | |
| 76 */ | 66 */ |
| 77 PP_Bool AddKey( | 67 void AddKey( |
| 78 [in] PP_Instance instance, | 68 [in] PP_Instance instance, |
| 79 [in] PP_Var session_id, | 69 [in] PP_Var session_id, |
| 80 [in] PP_Var key, | 70 [in] PP_Var key, |
| 81 [in] PP_Var init_data); | 71 [in] PP_Var init_data); |
| 82 | 72 |
| 83 /** | 73 /** |
| 84 * Cancels a pending key request for the specified session ID. | 74 * Cancels a pending key request for the specified session ID. |
| 85 * | 75 * |
| 86 * @param[in] session_id A <code>PP_Var</code> of type | 76 * @param[in] session_id A <code>PP_Var</code> of type |
| 87 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 77 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 88 * | |
| 89 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
| 90 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
| 91 * CDM, the call result/status should be reported through the | |
| 92 * <code>PPB_ContentDecryptor_Private</code> interface. | |
| 93 */ | 78 */ |
| 94 PP_Bool CancelKeyRequest( | 79 void CancelKeyRequest( |
| 95 [in] PP_Instance instance, | 80 [in] PP_Instance instance, |
| 96 [in] PP_Var session_id); | 81 [in] PP_Var session_id); |
| 97 | 82 |
| 98 /** | 83 /** |
| 99 * Decrypts the block and returns the unencrypted block via | 84 * Decrypts the block and returns the unencrypted block via |
| 100 * <code>DeliverBlock()</code> on the | 85 * <code>DeliverBlock()</code> on the |
| 101 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block | 86 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
| 102 * contains encoded data. | 87 * contains encoded data. |
| 103 * | 88 * |
| 104 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 89 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 105 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 90 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 106 * block. | 91 * block. |
| 107 * | 92 * |
| 108 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 93 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
| 109 * contains all auxiliary information needed for decryption of the | 94 * contains all auxiliary information needed for decryption of the |
| 110 * <code>encrypted_block</code>. | 95 * <code>encrypted_block</code>. |
| 111 * | |
| 112 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
| 113 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
| 114 * CDM, the call result/status should be reported through the | |
| 115 * <code>PPB_ContentDecryptor_Private</code> interface. | |
| 116 */ | 96 */ |
| 117 PP_Bool Decrypt( | 97 void Decrypt( |
| 118 [in] PP_Instance instance, | 98 [in] PP_Instance instance, |
| 119 [in] PP_Resource encrypted_block, | 99 [in] PP_Resource encrypted_block, |
| 120 [in] PP_EncryptedBlockInfo encrypted_block_info); | 100 [in] PP_EncryptedBlockInfo encrypted_block_info); |
| 121 | 101 |
| 122 /** | 102 /** |
| 123 * Decrypts the block, decodes it, and returns the unencrypted uncompressed | 103 * Decrypts the block, decodes it, and returns the unencrypted uncompressed |
| 124 * (decoded) media to the browser via the | 104 * (decoded) media to the browser via the |
| 125 * <code>PPB_ContentDecryptor_Private</code> interface. | 105 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 126 * | 106 * |
| 127 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, | 107 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, |
| 128 * and decrypted and decoded audio samples are sent to | 108 * and decrypted and decoded audio samples are sent to |
| 129 * <code>DeliverSamples()</code>. | 109 * <code>DeliverSamples()</code>. |
| 130 * | 110 * |
| 131 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 111 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 132 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 112 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 133 * block. | 113 * block. |
| 134 * | 114 * |
| 135 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 115 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
| 136 * contains all auxiliary information needed for decryption of the | 116 * contains all auxiliary information needed for decryption of the |
| 137 * <code>encrypted_block</code>. | 117 * <code>encrypted_block</code>. |
| 138 * | |
| 139 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
| 140 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
| 141 * CDM, the call result/status should be reported through the | |
| 142 * <code>PPB_ContentDecryptor_Private</code> interface. | |
| 143 */ | 118 */ |
| 144 PP_Bool DecryptAndDecode( | 119 void DecryptAndDecode( |
| 145 [in] PP_Instance instance, | 120 [in] PP_Instance instance, |
| 146 [in] PP_Resource encrypted_block, | 121 [in] PP_Resource encrypted_block, |
| 147 [in] PP_EncryptedBlockInfo encrypted_block_info); | 122 [in] PP_EncryptedBlockInfo encrypted_block_info); |
| 148 }; | 123 }; |
| OLD | NEW |