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 dev/ppp_content_decryption_module_dev.idl, |
| 7 * modified Thu Jun 14 09:32:18 2012. |
| 8 */ |
| 9 |
| 10 #ifndef PPAPI_C_DEV_PPP_CONTENT_DECRYPTION_MODULE_DEV_H_ |
| 11 #define PPAPI_C_DEV_PPP_CONTENT_DECRYPTION_MODULE_DEV_H_ |
| 12 |
| 13 #include "ppapi/c/pp_bool.h" |
| 14 #include "ppapi/c/pp_completion_callback.h" |
| 15 #include "ppapi/c/pp_instance.h" |
| 16 #include "ppapi/c/pp_macros.h" |
| 17 #include "ppapi/c/pp_resource.h" |
| 18 #include "ppapi/c/pp_stdint.h" |
| 19 #include "ppapi/c/pp_var.h" |
| 20 |
| 21 #define PPP_CONTENTDECRYPTIONMODULE_DEV_INTERFACE_0_1 \ |
| 22 "PPP_ContentDecryptionModule(Dev);0.1" |
| 23 #define PPP_CONTENTDECRYPTIONMODULE_DEV_INTERFACE \ |
| 24 PPP_CONTENTDECRYPTIONMODULE_DEV_INTERFACE_0_1 |
| 25 |
| 26 /** |
| 27 * @file |
| 28 * This file defines the <code>PPP_ContentDecryptionModule_Dev</code> |
| 29 * interface. |
| 30 */ |
| 31 |
| 32 /** |
| 33 * @addtogroup Interfaces |
| 34 * @{ |
| 35 */ |
| 36 |
| 37 /** |
| 38 * <code>PPP_ContentDecryptionModule_Dev</code> structure contains the function |
| 39 * pointers the decryption plugin MUST implement to provide services needed by |
| 40 * the media stack. |
| 41 */ |
| 42 struct PPP_ContentDecryptionModule_Dev_0_1 { |
| 43 /** |
| 44 * Generates a key request. key_system is an optional param that is used |
| 45 * to specify the key or licensing system from which to request the key when |
| 46 * the plugin provides access to multiple systems. init_data is a data |
| 47 * buffer containing initialization data for the key system(s) implemented |
| 48 * by the plugin. response is a data buffer filled only when callback is |
| 49 * notified of success. |
| 50 */ |
| 51 PP_Bool (*GenerateKeyRequest)(PP_Instance instance, |
| 52 struct PP_Var key_system, |
| 53 PP_Resource init_data); |
| 54 |
| 55 /** |
| 56 * Provides a key or license to use for decrypting media data for session_id. |
| 57 */ |
| 58 PP_Bool (*AddKey)(PP_Instance instance, |
| 59 struct PP_Var session_id, |
| 60 PP_Resource key); |
| 61 |
| 62 /** |
| 63 * Cancels a key request for session_id. |
| 64 */ |
| 65 PP_Bool (*CancelKeyRequest)(PP_Instance instance, |
| 66 struct PP_Var session_id); |
| 67 |
| 68 /** |
| 69 * Decrypts the block and returns the unencrypted block. |
| 70 * In the case of media, the block contains encoded data. |
| 71 * decrypted_block is valid only after the callback is notified of success. |
| 72 */ |
| 73 PP_Bool (*Decrypt)(PP_Instance instance, |
| 74 PP_Resource encrypted_block, |
| 75 struct PP_CompletionCallback callback); |
| 76 |
| 77 /** |
| 78 * Decrypts the block then decodes it and returns the raw (decoded) |
| 79 * unencrypted frame. |
| 80 * decoded_frame is valid only after the callback is notified of success. |
| 81 */ |
| 82 PP_Bool (*DecryptAndDecode)(PP_Instance instance, |
| 83 PP_Resource encrypted_block, |
| 84 struct PP_CompletionCallback callback); |
| 85 }; |
| 86 |
| 87 typedef struct PPP_ContentDecryptionModule_Dev_0_1 |
| 88 PPP_ContentDecryptionModule_Dev; |
| 89 |
| 90 /** |
| 91 * @} |
| 92 */ |
| 93 |
| 94 #endif /* PPAPI_C_DEV_PPP_CONTENT_DECRYPTION_MODULE_DEV_H_ */ |
OLD | NEW |