OLD | NEW |
(Empty) | |
| 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 |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /* From private/ppp_content_decryptor_private.idl, |
| 7 * modified Tue Aug 14 11:06:05 2012. |
| 8 */ |
| 9 |
| 10 #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ |
| 11 #define PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ |
| 12 |
| 13 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "ppapi/c/pp_macros.h" |
| 16 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_stdint.h" |
| 18 #include "ppapi/c/pp_var.h" |
| 19 |
| 20 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 \ |
| 21 "PPP_ContentDecryptor_Private;0.1" |
| 22 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ |
| 23 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_1 |
| 24 |
| 25 /** |
| 26 * @file |
| 27 * This file defines the <code>PPP_ContentDecryptor_Private</code> |
| 28 * interface. Note: This is a special interface, only to be used for Content |
| 29 * Decryption Modules, not normal plugins. |
| 30 */ |
| 31 |
| 32 |
| 33 /** |
| 34 * @addtogroup Interfaces |
| 35 * @{ |
| 36 */ |
| 37 /** |
| 38 * <code>PPP_ContentDecryptor_Private</code> structure contains the function |
| 39 * pointers the decryption plugin must implement to provide services needed by |
| 40 * the browser. This interface provides the plugin side support for the Content |
| 41 * Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions: |
| 42 * http://goo.gl/rbdnR |
| 43 */ |
| 44 struct PPP_ContentDecryptor_Private_0_1 { |
| 45 /** |
| 46 * Generates a key request. key_system specifies the key or licensing system |
| 47 * to use. init_data is a data buffer containing data for use in generating |
| 48 * the request. |
| 49 * |
| 50 * Note: <code>GenerateKeyRequest()</code> must create the session ID used in |
| 51 * other methods on this interface. The session ID must be provided to the |
| 52 * browser by the CDM via <code>KeyMessage()</code> on the |
| 53 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 54 * |
| 55 * @param[in] key_system A <code>PP_Var</code> of type |
| 56 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 57 * |
| 58 * @param[in] init_data A <code>PP_Var</code> of type |
| 59 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
| 60 * initialization data. |
| 61 */ |
| 62 PP_Bool (*GenerateKeyRequest)(PP_Instance instance, |
| 63 struct PP_Var key_system, |
| 64 struct PP_Var init_data); |
| 65 /** |
| 66 * Provides a key or license to the decryptor for decrypting media data. |
| 67 * |
| 68 * When the CDM needs more information to complete addition of the key it |
| 69 * will call <code>KeyMessage()</code> on the |
| 70 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser |
| 71 * passes to the application. When the key is ready to use, the CDM |
| 72 * must call call <code>KeyAdded()</code> on the |
| 73 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
| 74 * must notify the web application. |
| 75 * |
| 76 * @param[in] session_id A <code>PP_Var</code> of type |
| 77 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 78 * |
| 79 * @param[in] key A <code>PP_Var</code> of type |
| 80 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, |
| 81 * or other message for the given session ID. |
| 82 */ |
| 83 PP_Bool (*AddKey)(PP_Instance instance, |
| 84 struct PP_Var session_id, |
| 85 struct PP_Var key); |
| 86 /** |
| 87 * Cancels a pending key request for the specified session ID. |
| 88 * |
| 89 * @param[in] session_id A <code>PP_Var</code> of type |
| 90 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 91 */ |
| 92 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); |
| 93 /** |
| 94 * Decrypts the block and returns the unencrypted block via |
| 95 * <code>DeliverBlock()</code> on the |
| 96 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
| 97 * contains encoded data. |
| 98 * |
| 99 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 100 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 101 * block. |
| 102 * |
| 103 * @param[in] request_id A value used by the browser to associate data |
| 104 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with |
| 105 * decryption method calls. |
| 106 */ |
| 107 PP_Bool (*Decrypt)(PP_Instance instance, |
| 108 PP_Resource encrypted_block, |
| 109 int32_t request_id); |
| 110 /** |
| 111 * Decrypts the block, decodes it, and returns the unencrypted uncompressed |
| 112 * (decoded) media to the browser via the |
| 113 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 114 * |
| 115 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, |
| 116 * and decrypted and decoded audio samples are sent to |
| 117 * <code>DeliverSamples()</code>. |
| 118 * |
| 119 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 120 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 121 * block. |
| 122 * |
| 123 * @param[in] request_id A value used by the browser to associate data |
| 124 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with |
| 125 * decryption method calls. |
| 126 */ |
| 127 PP_Bool (*DecryptAndDecode)(PP_Instance instance, |
| 128 PP_Resource encrypted_block, |
| 129 int32_t request_id); |
| 130 }; |
| 131 |
| 132 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private; |
| 133 /** |
| 134 * @} |
| 135 */ |
| 136 |
| 137 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ |
| 138 |
OLD | NEW |