Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: ppapi/c/dev/ppp_content_decryptor_dev.h

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add PPB Content Decryptor proxy interface methods. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_decryptor_dev.idl modified Mon Aug 6 11:15:43 2012. */
7
8 #ifndef PPAPI_C_DEV_PPP_CONTENT_DECRYPTOR_DEV_H_
9 #define PPAPI_C_DEV_PPP_CONTENT_DECRYPTOR_DEV_H_
10
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_stdint.h"
16 #include "ppapi/c/pp_var.h"
17
18 #define PPP_CONTENTDECRYPTOR_DEV_INTERFACE_0_1 "PPP_ContentDecryptor(Dev);0.1"
19 #define PPP_CONTENTDECRYPTOR_DEV_INTERFACE \
20 PPP_CONTENTDECRYPTOR_DEV_INTERFACE_0_1
21
22 /**
23 * @file
24 * This file defines the <code>PPP_ContentDecryptor_Dev</code>
25 * interface.
26 */
27
28
29 /**
30 * @addtogroup Interfaces
31 * @{
32 */
33 /**
34 * <code>PPP_ContentDecryptor_Dev</code> structure contains the function
35 * pointers the decryption plugin MUST implement to provide services needed by
36 * the media stack.
37 */
38 struct PPP_ContentDecryptor_Dev_0_1 {
39 /**
40 * Generates a key request. key_system specifies the key or licensing system
41 * from which to request the key when the plugin provides access to multiple
42 * systems. init_data is a data buffer containing initialization data from
43 * the media data that is required for use of the plugin's key system(s).
44 * Note: <code>GenerateKeyRequest</code> is responsible for creating the
45 * session ID.
46 *
47 * @param[in] key_system A <code>PP_Var</code> of type
48 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
49 *
50 * @param[in] init_data A <code>PP_Var</code> of type
51 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific
52 * initialization data.
53 */
54 PP_Bool (*GenerateKeyRequest)(PP_Instance instance,
55 struct PP_Var key_system,
56 struct PP_Var init_data);
57 /**
58 * Provides a key or license to use for decrypting media data for session_id.
59 *
60 * @param[in] session_id A <code>PP_Var</code> of type
61 * <code>PP_VARTYPE_STRING</code> containing the session ID.
62 *
63 * @param[in] key A <code>PP_Var</code> of type
64 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key for the
65 * given session ID.
66 */
67 PP_Bool (*AddKey)(PP_Instance instance,
68 struct PP_Var session_id,
69 struct PP_Var key);
70 /**
71 * Cancels a pending key request for session_id.
72 *
73 * @param[in] session_id A <code>PP_Var</code> of type
74 * <code>PP_VARTYPE_STRING</code> containing the session ID.
75 */
76 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id);
77 /**
78 * Decrypts the block and returns the unencrypted block via
79 * <code>DeliverBlock</code> on the <code>PPB_ContentDecryptor_Dev</code>
80 * interface. In the case of media, the block contains encoded data.
81 *
82 * @param[in] resource A <code>PP_Resource</code> corresponding to a
83 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
84 * block.
85 *
86 * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to
87 * match returned decrypted data to a callback sent from the media stack.
88 */
89 PP_Bool (*Decrypt)(PP_Instance instance,
90 PP_Resource encrypted_block,
91 uint64_t request_id);
92 /**
93 * Decrypts the block then decodes it and returns the unencrypted raw
94 * (decoded) frame.
95 *
96 * @param[in] resource A <code>PP_Resource</code> corresponding to a
97 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
98 * block.
99 *
100 * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to
101 * match returned decrypted data to a callback sent from the media stack.
102 */
103 PP_Bool (*DecryptAndDecode)(PP_Instance instance,
104 PP_Resource encrypted_block,
105 uint64_t request_id);
106 };
107
108 typedef struct PPP_ContentDecryptor_Dev_0_1 PPP_ContentDecryptor_Dev;
109 /**
110 * @}
111 */
112
113 #endif /* PPAPI_C_DEV_PPP_CONTENT_DECRYPTOR_DEV_H_ */
114
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698