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 Fri Aug 10 07:56:58 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. |
| 29 */ |
| 30 |
| 31 |
| 32 /** |
| 33 * @addtogroup Interfaces |
| 34 * @{ |
| 35 */ |
| 36 /** |
| 37 * <code>PPP_ContentDecryptor_Private</code> structure contains the function |
| 38 * pointers the decryption plugin MUST implement to provide services needed by |
| 39 * the media stack. This interface provides the plugin side support for v0.1 of |
| 40 * the proposed Encrypted Media Extensions: http://goo.gl/rbdnR |
| 41 * |
| 42 * Note: This is a special interface, only to be used for Content Decryption |
| 43 * Modules, not normal plugins. |
| 44 */ |
| 45 struct PPP_ContentDecryptor_Private_0_1 { |
| 46 /** |
| 47 * Generates a key request. key_system specifies the key or licensing system |
| 48 * from which to request the key when the plugin provides access to multiple |
| 49 * systems. init_data is a data buffer containing initialization data from |
| 50 * the media data that is required for use of the plugin's key system(s). |
| 51 * |
| 52 * Note: <code>GenerateKeyRequest()</code> is responsible for creating the |
| 53 * session ID used in other methods on this interface. The session ID will be |
| 54 * provided to the user agent via <code>KeyMessage()</code> on the |
| 55 * <code>PPB_ContentDecryptor_Private</code> interface. |
| 56 * |
| 57 * @param[in] key_system A <code>PP_Var</code> of type |
| 58 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
| 59 * |
| 60 * @param[in] init_data A <code>PP_Var</code> of type |
| 61 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific |
| 62 * initialization data. |
| 63 */ |
| 64 PP_Bool (*GenerateKeyRequest)(PP_Instance instance, |
| 65 struct PP_Var key_system, |
| 66 struct PP_Var init_data); |
| 67 /** |
| 68 * Provides a key or license to the decryptor for decrypting media data in the |
| 69 * stream associated with session_id. |
| 70 * |
| 71 * @param[in] session_id A <code>PP_Var</code> of type |
| 72 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 73 * |
| 74 * @param[in] key A <code>PP_Var</code> of type |
| 75 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key for the |
| 76 * given session ID. |
| 77 */ |
| 78 PP_Bool (*AddKey)(PP_Instance instance, |
| 79 struct PP_Var session_id, |
| 80 struct PP_Var key); |
| 81 /** |
| 82 * Cancels a pending key request for the specified session ID. |
| 83 * |
| 84 * @param[in] session_id A <code>PP_Var</code> of type |
| 85 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
| 86 */ |
| 87 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); |
| 88 /** |
| 89 * Decrypts the block and returns the unencrypted block via |
| 90 * <code>DeliverBlock()</code> on the |
| 91 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
| 92 * contains encoded data. |
| 93 * |
| 94 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 95 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 96 * block. |
| 97 * |
| 98 * @param[in] request_id A value used by the user agent to associate data |
| 99 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with |
| 100 * decryption method calls. |
| 101 */ |
| 102 PP_Bool (*Decrypt)(PP_Instance instance, |
| 103 PP_Resource encrypted_block, |
| 104 uint64_t request_id); |
| 105 /** |
| 106 * Decrypts the block, decodes it, and returns the unencrypted raw (decoded) |
| 107 * media to the user agent via the <code>PPB_ContentDecryptor_Private</code> |
| 108 * interface. |
| 109 * |
| 110 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 111 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
| 112 * block. |
| 113 * |
| 114 * @param[in] request_id A value used by the user agent to associate data |
| 115 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with |
| 116 * decryption method calls. |
| 117 */ |
| 118 PP_Bool (*DecryptAndDecode)(PP_Instance instance, |
| 119 PP_Resource encrypted_block, |
| 120 uint64_t request_id); |
| 121 }; |
| 122 |
| 123 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private; |
| 124 /** |
| 125 * @} |
| 126 */ |
| 127 |
| 128 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ |
| 129 |
OLD | NEW |