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

Side by Side Diff: ppapi/c/private/ppp_content_decryptor_private.h

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed typo. 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 private/ppp_content_decryptor_private.idl,
7 * modified Mon Aug 13 14:05:31 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 browser. This interface provides the plugin side support for the CDM for
40 * v0.1 of 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 * to use. init_data is a data buffer containing data for use in generating
49 * the request.
50 *
51 * Note: <code>GenerateKeyRequest()</code> is responsible for creating the
52 * session ID used in other methods on this interface. The session ID will be
53 * provided to the browser via <code>KeyMessage()</code> on the
54 * <code>PPB_ContentDecryptor_Private</code> interface.
55 *
56 * @param[in] key_system A <code>PP_Var</code> of type
57 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
58 *
59 * @param[in] init_data A <code>PP_Var</code> of type
60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific
61 * initialization data.
62 */
63 PP_Bool (*GenerateKeyRequest)(PP_Instance instance,
64 struct PP_Var key_system,
65 struct PP_Var init_data);
66 /**
67 * Provides a key or license to the decryptor for decrypting media data.
68 *
69 * @param[in] session_id A <code>PP_Var</code> of type
70 * <code>PP_VARTYPE_STRING</code> containing the session ID.
71 *
72 * @param[in] key A <code>PP_Var</code> of type
73 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license,
74 * or other message for the given session ID.
75 */
76 PP_Bool (*AddKey)(PP_Instance instance,
77 struct PP_Var session_id,
78 struct PP_Var key);
79 /**
80 * Cancels a pending key request for the specified session ID.
81 *
82 * @param[in] session_id A <code>PP_Var</code> of type
83 * <code>PP_VARTYPE_STRING</code> containing the session ID.
84 */
85 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id);
86 /**
87 * Decrypts the block and returns the unencrypted block via
88 * <code>DeliverBlock()</code> on the
89 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block
90 * contains encoded data.
91 *
92 * @param[in] resource A <code>PP_Resource</code> corresponding to a
93 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
94 * block.
95 *
96 * @param[in] request_id A value used by the browser to associate data
97 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
98 * decryption method calls.
99 */
100 PP_Bool (*Decrypt)(PP_Instance instance,
101 PP_Resource encrypted_block,
102 int32_t request_id);
103 /**
104 * Decrypts the block, decodes it, and returns the unencrypted uncompressed
105 * (decoded) media to the browser via the
106 * <code>PPB_ContentDecryptor_Private</code> interface.
107 *
108 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>,
109 * while audio samples are sent to <code>DeliverSamples()</code>.
110 *
111 * @param[in] resource A <code>PP_Resource</code> corresponding to a
112 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
113 * block.
114 *
115 * @param[in] request_id A value used by the browser to associate data
116 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
117 * decryption method calls.
118 */
119 PP_Bool (*DecryptAndDecode)(PP_Instance instance,
120 PP_Resource encrypted_block,
121 int32_t request_id);
122 };
123
124 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private;
125 /**
126 * @}
127 */
128
129 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */
130
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698