Chromium Code Reviews| Index: ppapi/api/private/ppp_content_decryptor_private.idl |
| diff --git a/ppapi/api/private/ppp_content_decryptor_private.idl b/ppapi/api/private/ppp_content_decryptor_private.idl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fc4987c0e71cf5b41e0bb4d2a6d1d12ce41764fd |
| --- /dev/null |
| +++ b/ppapi/api/private/ppp_content_decryptor_private.idl |
| @@ -0,0 +1,119 @@ |
| +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +/** |
| + * This file defines the <code>PPP_ContentDecryptor_Private</code> |
| + * interface. Note: This is a special interface, only to be used for Content |
| + * Decryption Modules (CDM), not normal plugins. |
| + */ |
| +label Chrome { |
| + M23 = 0.1 |
| +}; |
| + |
| +/** |
| + * <code>PPP_ContentDecryptor_Private</code> structure contains the function |
| + * pointers the decryption plugin must implement to provide services needed by |
| + * the browser. This interface provides the plugin side support for the CDM for |
| + * v0.1 of the proposed Encrypted Media Extensions: http://goo.gl/rbdnR |
| + */ |
| +interface PPP_ContentDecryptor_Private { |
| + /** |
| + * Generates a key request. key_system specifies the key or licensing system |
| + * to use. init_data is a data buffer containing data for use in generating |
| + * the request. |
| + * |
| + * Note: <code>GenerateKeyRequest()</code> must create the session ID used in |
| + * other methods on this interface. The session ID must be provided to the |
| + * browser by the CDM via <code>KeyMessage()</code> on the |
| + * <code>PPB_ContentDecryptor_Private</code> interface. |
| + * |
| + * @param[in] key_system A <code>PP_Var</code> of type |
| + * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| + * |
| + * @param[in] init_data A <code>PP_Var</code> of type |
| + * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| + * initialization data. |
| + */ |
| + PP_Bool GenerateKeyRequest( |
| + [in] PP_Instance instance, |
| + [in] PP_Var key_system, |
| + [in] PP_Var init_data); |
| + |
| + /** |
| + * Provides a key or license to the decryptor for decrypting media data. |
| + * |
| + * When the CDM needs more information to complete addition of the key it |
| + * will call <code>KeyMessage()</code> on the |
| + * <code>PPB_ContentDecryptor_Private</code> interface, which the browser |
| + * passes to the application by firing a <code>MediaKeyMessageEvent</code> at |
|
ddorwin
2012/08/14 17:39:58
Remove everything after "application" from this se
Tom Finegan
2012/08/14 18:09:32
Done.
|
| + * the <code>HTMLMediaElement</code>. When the key is ready to use, the CDM |
| + * must call call <code>KeyAdded()</code> on the |
| + * <code>PPB_ContentDecryptor_Private</code> interface, which the browser |
| + * passes to the application by firing a <code>MediaKeyCompleteEvent</code> |
|
ddorwin
2012/08/14 17:39:58
same
Tom Finegan
2012/08/14 18:09:32
Done plus minor tweak to wording.
|
| + * at the <code>HTMLMediaElement</code> |
| + * |
| + * @param[in] session_id A <code>PP_Var</code> of type |
| + * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| + * |
| + * @param[in] key A <code>PP_Var</code> of type |
| + * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, |
| + * or other message for the given session ID. |
| + */ |
| + PP_Bool AddKey( |
| + [in] PP_Instance instance, |
| + [in] PP_Var session_id, |
| + [in] PP_Var key); |
| + |
| + /** |
| + * Cancels a pending key request for the specified session ID. |
| + * |
| + * @param[in] session_id A <code>PP_Var</code> of type |
| + * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| + */ |
| + PP_Bool CancelKeyRequest( |
| + [in] PP_Instance instance, |
| + [in] PP_Var session_id); |
| + |
| + /** |
| + * Decrypts the block and returns the unencrypted block via |
| + * <code>DeliverBlock()</code> on the |
| + * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
| + * contains encoded data. |
| + * |
| + * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| + * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| + * block. |
| + * |
| + * @param[in] request_id A value used by the browser to associate data |
| + * returned via the <code>PPB_ContentDecryptor_Private</code> interface with |
| + * decryption method calls. |
| + */ |
| + PP_Bool Decrypt( |
| + [in] PP_Instance instance, |
| + [in] PP_Resource encrypted_block, |
| + [in] int32_t request_id); |
| + |
| + /** |
| + * Decrypts the block, decodes it, and returns the unencrypted uncompressed |
| + * (decoded) media to the browser via the |
| + * <code>PPB_ContentDecryptor_Private</code> interface. |
| + * |
| + * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, |
| + * and decrypted and decoded audio samples are sent to |
| + * <code>DeliverSamples()</code>. |
| + * |
| + * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| + * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| + * block. |
| + * |
| + * @param[in] request_id A value used by the browser to associate data |
| + * returned via the <code>PPB_ContentDecryptor_Private</code> interface with |
| + * decryption method calls. |
| + */ |
| + PP_Bool DecryptAndDecode( |
| + [in] PP_Instance instance, |
| + [in] PP_Resource encrypted_block, |
| + [in] int32_t request_id); |
| +}; |