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

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: Fix PP_Resource/HostResource usage (hopefully), and update comments. 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 Wed Aug 8 11:53:37 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. This interface provides the plugin side support for v0.1 of
37 * the proposed Encrypted Media Extensions: http://goo.gl/rbdnR
38 */
39 struct PPP_ContentDecryptor_Dev_0_1 {
40 /**
41 * Generates a key request. key_system specifies the key or licensing system
42 * from which to request the key when the plugin provides access to multiple
43 * systems. init_data is a data buffer containing initialization data from
44 * the media data that is required for use of the plugin's key system(s).
45 * Note: <code>GenerateKeyRequest</code> is responsible for creating the
46 * session ID.
47 *
48 * @param[in] key_system A <code>PP_Var</code> of type
49 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
50 *
51 * @param[in] init_data A <code>PP_Var</code> of type
52 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific
53 * initialization data.
54 */
55 PP_Bool (*GenerateKeyRequest)(PP_Instance instance,
56 struct PP_Var key_system,
57 struct PP_Var init_data);
58 /**
59 * Provides a key or license to use for decrypting media data for session_id.
60 *
61 * @param[in] session_id A <code>PP_Var</code> of type
62 * <code>PP_VARTYPE_STRING</code> containing the session ID.
63 *
64 * @param[in] key A <code>PP_Var</code> of type
65 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key for the
66 * given session ID.
67 */
68 PP_Bool (*AddKey)(PP_Instance instance,
69 struct PP_Var session_id,
70 struct PP_Var key);
71 /**
72 * Cancels a pending key request for session_id.
73 *
74 * @param[in] session_id A <code>PP_Var</code> of type
75 * <code>PP_VARTYPE_STRING</code> containing the session ID.
76 */
77 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id);
78 /**
79 * Decrypts the block and returns the unencrypted block via
80 * <code>DeliverBlock</code> on the <code>PPB_ContentDecryptor_Dev</code>
81 * interface. In the case of media, the block contains encoded data.
82 *
83 * @param[in] resource A <code>PP_Resource</code> corresponding to a
84 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
85 * block.
86 *
87 * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to
88 * match returned decrypted data to a callback sent from the media stack.
89 */
90 PP_Bool (*Decrypt)(PP_Instance instance,
91 PP_Resource encrypted_block,
92 uint64_t request_id);
93 /**
94 * Decrypts the block then decodes it and returns the unencrypted raw
95 * (decoded) frame.
96 *
97 * @param[in] resource A <code>PP_Resource</code> corresponding to a
98 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
99 * block.
100 *
101 * @param[in] request_id A value used in <code>ppapi::PluginInstance</code> to
102 * match returned decrypted data to a callback sent from the media stack.
103 */
104 PP_Bool (*DecryptAndDecode)(PP_Instance instance,
105 PP_Resource encrypted_block,
106 uint64_t request_id);
107 };
108
109 typedef struct PPP_ContentDecryptor_Dev_0_1 PPP_ContentDecryptor_Dev;
110 /**
111 * @}
112 */
113
114 #endif /* PPAPI_C_DEV_PPP_CONTENT_DECRYPTOR_DEV_H_ */
115
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698