Chromium Code Reviews| 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 (CDM), not normal plugins. |
|
Tom Finegan
2012/08/22 16:54:31
The acronym definition was moved down to the block
ddorwin
2012/08/22 18:25:54
Tom removed this because of the plural - singular
xhwang
2012/08/24 22:01:59
I didn't notice the one on line 19. No need to add
| |
| 10 */ | 10 */ |
| 11 label Chrome { | 11 label Chrome { |
| 12 M23 = 0.1 | 12 M23 = 0.1 |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * <code>PPP_ContentDecryptor_Private</code> structure contains the function | 16 * <code>PPP_ContentDecryptor_Private</code> structure contains the function |
| 17 * pointers the decryption plugin must implement to provide services needed by | 17 * pointers the decryption plugin must implement to provide services needed by |
| 18 * the browser. This interface provides the plugin side support for the Content | 18 * the browser. This interface provides the plugin side support for the Content |
| 19 * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions: | 19 * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions: |
| 20 * http://goo.gl/rbdnR | 20 * http://goo.gl/rbdnR |
| 21 */ | 21 */ |
| 22 interface PPP_ContentDecryptor_Private { | 22 interface PPP_ContentDecryptor_Private { |
| 23 /** | 23 /** |
| 24 * Generates a key request. key_system specifies the key or licensing system | 24 * Generates a key request. key_system specifies the key or licensing system |
| 25 * to use. init_data is a data buffer containing data for use in generating | 25 * to use. init_data is a data buffer containing data for use in generating |
| 26 * the request. | 26 * the request. |
| 27 * | 27 * |
| 28 * Note: <code>GenerateKeyRequest()</code> must create the session ID used in | 28 * Note: <code>GenerateKeyRequest()</code> must create the session ID used in |
| 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 can be forwarded to the CDM | |
|
ddorwin
2012/08/22 18:25:54
s/can be/was/
xhwang
2012/08/24 22:01:59
Done.
| |
| 41 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the | |
|
Tom Finegan
2012/08/22 16:54:31
I think you meant PP_FALSE here. :)
Also, sentenc
ddorwin
2012/08/22 18:25:54
PP_FALSE
xhwang
2012/08/24 22:01:59
Done.
| |
| 42 * CDM, the call result/stuatus can always be reported asynchronously through | |
|
Tom Finegan
2012/08/22 16:54:31
s/stuatus/status/
s/can always be/is/
Ditto for r
ddorwin
2012/08/22 18:25:54
s/can always be/should be/ ?
xhwang
2012/08/24 22:01:59
Done.
xhwang
2012/08/24 22:01:59
Done.
| |
| 43 * the <code>PPB_ContentDecryptor_Private</code> interface. | |
| 39 */ | 44 */ |
| 40 PP_Bool GenerateKeyRequest( | 45 PP_Bool GenerateKeyRequest( |
| 41 [in] PP_Instance instance, | 46 [in] PP_Instance instance, |
| 42 [in] PP_Var key_system, | 47 [in] PP_Var key_system, |
| 43 [in] PP_Var init_data); | 48 [in] PP_Var init_data); |
| 44 | 49 |
| 45 /** | 50 /** |
| 46 * Provides a key or license to the decryptor for decrypting media data. | 51 * Provides a key or license to the decryptor for decrypting media data. |
| 47 * | 52 * |
| 48 * When the CDM needs more information to complete addition of the key it | 53 * When the CDM needs more information to complete addition of the key it |
| 49 * will call <code>KeyMessage()</code> on the | 54 * will call <code>KeyMessage()</code> on the |
| 50 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser | 55 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser |
| 51 * passes to the application. When the key is ready to use, the CDM | 56 * passes to the application. When the key is ready to use, the CDM |
| 52 * must call call <code>KeyAdded()</code> on the | 57 * must call call <code>KeyAdded()</code> on the |
| 53 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser | 58 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
| 54 * must notify the web application. | 59 * must notify the web application. |
| 55 * | 60 * |
| 56 * @param[in] session_id A <code>PP_Var</code> of type | 61 * @param[in] session_id A <code>PP_Var</code> of type |
| 57 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 62 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 58 * | 63 * |
| 59 * @param[in] key A <code>PP_Var</code> of type | 64 * @param[in] key A <code>PP_Var</code> of type |
| 60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, | 65 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, |
| 61 * or other message for the given session ID. | 66 * or other message for the given session ID. |
| 62 * | 67 * |
| 63 * @param[in] init_data A <code>PP_Var</code> of type | 68 * @param[in] init_data A <code>PP_Var</code> of type |
| 64 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 69 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| 65 * initialization data. | 70 * initialization data. |
| 71 * | |
| 72 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM | |
| 73 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the | |
| 74 * CDM, the call result/stuatus can always be reported asynchronously through | |
|
dmichael (off chromium)
2012/08/23 18:11:29
Here and elsewhere... can we omit asynchronously?
xhwang
2012/08/24 22:01:59
Done.
| |
| 75 * the <code>PPB_ContentDecryptor_Private</code> interface. | |
| 66 */ | 76 */ |
| 67 PP_Bool AddKey( | 77 PP_Bool AddKey( |
| 68 [in] PP_Instance instance, | 78 [in] PP_Instance instance, |
| 69 [in] PP_Var session_id, | 79 [in] PP_Var session_id, |
| 70 [in] PP_Var key, | 80 [in] PP_Var key, |
| 71 [in] PP_Var init_data); | 81 [in] PP_Var init_data); |
| 72 | 82 |
| 73 /** | 83 /** |
| 74 * Cancels a pending key request for the specified session ID. | 84 * Cancels a pending key request for the specified session ID. |
| 75 * | 85 * |
| 76 * @param[in] session_id A <code>PP_Var</code> of type | 86 * @param[in] session_id A <code>PP_Var</code> of type |
| 77 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 87 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 88 * | |
| 89 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM | |
| 90 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the | |
| 91 * CDM, the call result/stuatus can always be reported asynchronously through | |
| 92 * the <code>PPB_ContentDecryptor_Private</code> interface. | |
| 78 */ | 93 */ |
| 79 PP_Bool CancelKeyRequest( | 94 PP_Bool CancelKeyRequest( |
| 80 [in] PP_Instance instance, | 95 [in] PP_Instance instance, |
| 81 [in] PP_Var session_id); | 96 [in] PP_Var session_id); |
| 82 | 97 |
| 83 /** | 98 /** |
| 84 * Decrypts the block and returns the unencrypted block via | 99 * Decrypts the block and returns the unencrypted block via |
| 85 * <code>DeliverBlock()</code> on the | 100 * <code>DeliverBlock()</code> on the |
| 86 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block | 101 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
| 87 * contains encoded data. | 102 * contains encoded data. |
| 88 * | 103 * |
| 89 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 104 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 90 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 105 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 91 * block. | 106 * block. |
| 92 * | 107 * |
| 93 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 108 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
| 94 * contains all auxiliary information needed for decryption of the | 109 * contains all auxiliary information needed for decryption of the |
| 95 * <code>encrypted_block</code>. | 110 * <code>encrypted_block</code>. |
| 111 * | |
| 112 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM | |
| 113 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the | |
| 114 * CDM, the call result/stuatus can always be reported asynchronously through | |
| 115 * the <code>PPB_ContentDecryptor_Private</code> interface. | |
| 96 */ | 116 */ |
| 97 PP_Bool Decrypt( | 117 PP_Bool Decrypt( |
| 98 [in] PP_Instance instance, | 118 [in] PP_Instance instance, |
| 99 [in] PP_Resource encrypted_block, | 119 [in] PP_Resource encrypted_block, |
| 100 [in] PP_EncryptedBlockInfo encrypted_block_info); | 120 [in] PP_EncryptedBlockInfo encrypted_block_info); |
| 101 | 121 |
| 102 /** | 122 /** |
| 103 * Decrypts the block, decodes it, and returns the unencrypted uncompressed | 123 * Decrypts the block, decodes it, and returns the unencrypted uncompressed |
| 104 * (decoded) media to the browser via the | 124 * (decoded) media to the browser via the |
| 105 * <code>PPB_ContentDecryptor_Private</code> interface. | 125 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 106 * | 126 * |
| 107 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, | 127 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, |
| 108 * and decrypted and decoded audio samples are sent to | 128 * and decrypted and decoded audio samples are sent to |
| 109 * <code>DeliverSamples()</code>. | 129 * <code>DeliverSamples()</code>. |
| 110 * | 130 * |
| 111 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 131 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 112 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 132 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 113 * block. | 133 * block. |
| 114 * | 134 * |
| 115 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 135 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
| 116 * contains all auxiliary information needed for decryption of the | 136 * contains all auxiliary information needed for decryption of the |
| 117 * <code>encrypted_block</code>. | 137 * <code>encrypted_block</code>. |
| 138 * | |
| 139 * @return <code>PP_TRUE</code> if this call can be forwarded to the CDM | |
| 140 * successfully. <code>PP_TRUE</code> otherwise. Once the call reaches the | |
| 141 * CDM, the call result/stuatus can always be reported asynchronously through | |
| 142 * the <code>PPB_ContentDecryptor_Private</code> interface. | |
| 118 */ | 143 */ |
| 119 PP_Bool DecryptAndDecode( | 144 PP_Bool DecryptAndDecode( |
| 120 [in] PP_Instance instance, | 145 [in] PP_Instance instance, |
| 121 [in] PP_Resource encrypted_block, | 146 [in] PP_Resource encrypted_block, |
| 122 [in] PP_EncryptedBlockInfo encrypted_block_info); | 147 [in] PP_EncryptedBlockInfo encrypted_block_info); |
| 123 }; | 148 }; |
| OLD | NEW |