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

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: Update comments in response to comments on 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 private/ppp_content_decryptor_private.idl,
7 * modified Tue Aug 14 09:36:49 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. Note: This is a special interface, only to be used for Content
29 * Decryption Modules (CDM), not normal plugins.
30 */
31
32
33 /**
34 * @addtogroup Interfaces
35 * @{
36 */
37 /**
38 * <code>PPP_ContentDecryptor_Private</code> structure contains the function
39 * pointers the decryption plugin must implement to provide services needed by
40 * the browser. This interface provides the plugin side support for the CDM for
41 * v0.1 of the proposed Encrypted Media Extensions: http://goo.gl/rbdnR
42 */
43 struct PPP_ContentDecryptor_Private_0_1 {
44 /**
45 * Generates a key request. key_system specifies the key or licensing system
46 * to use. init_data is a data buffer containing data for use in generating
47 * the request.
48 *
49 * Note: <code>GenerateKeyRequest()</code> is responsible for creating the
50 * session ID used in other methods on this interface. The session ID must
51 * be provided to the browser by the CDM via <code>KeyMessage()</code> on the
52 * <code>PPB_ContentDecryptor_Private</code> interface.
53 *
54 * @param[in] key_system A <code>PP_Var</code> of type
55 * <code>PP_VARTYPE_STRING</code> containing the name of the key system.
56 *
57 * @param[in] init_data A <code>PP_Var</code> of type
58 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific
59 * initialization data.
60 */
61 PP_Bool (*GenerateKeyRequest)(PP_Instance instance,
62 struct PP_Var key_system,
63 struct PP_Var init_data);
64 /**
65 * Provides a key or license to the decryptor for decrypting media data.
66 *
67 * When the CDM needs more information to complete addition of the key it
68 * will call <code>KeyMessage()</code> on the
69 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser
70 * passes to the application by firing a <code>MediaKeyMessageEvent</code> at
71 * the <code>HTMLMediaElement</code>. When the key is ready to use, the CDM
72 * must call call <code>KeyAdded()</code> on the
73 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser
74 * passes to the application by firing a <code>MediaKeyCompleteEvent</code>
75 * at the <code>HTMLMediaElement</code>
76 *
77 * @param[in] session_id A <code>PP_Var</code> of type
78 * <code>PP_VARTYPE_STRING</code> containing the session ID.
79 *
80 * @param[in] key A <code>PP_Var</code> of type
81 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license,
82 * or other message for the given session ID.
83 */
84 PP_Bool (*AddKey)(PP_Instance instance,
85 struct PP_Var session_id,
86 struct PP_Var key);
87 /**
88 * Cancels a pending key request for the specified session ID.
89 *
90 * @param[in] session_id A <code>PP_Var</code> of type
91 * <code>PP_VARTYPE_STRING</code> containing the session ID.
92 */
93 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id);
94 /**
95 * Decrypts the block and returns the unencrypted block via
96 * <code>DeliverBlock()</code> on the
97 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block
98 * contains encoded data.
99 *
100 * @param[in] resource A <code>PP_Resource</code> corresponding to a
101 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
102 * block.
103 *
104 * @param[in] request_id A value used by the browser to associate data
105 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
106 * decryption method calls.
107 */
108 PP_Bool (*Decrypt)(PP_Instance instance,
109 PP_Resource encrypted_block,
110 int32_t request_id);
111 /**
112 * Decrypts the block, decodes it, and returns the unencrypted uncompressed
113 * (decoded) media to the browser via the
114 * <code>PPB_ContentDecryptor_Private</code> interface.
115 *
116 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>,
117 * and decrypted and decoded audio samples are sent to
118 * <code>DeliverSamples()</code>.
119 *
120 * @param[in] resource A <code>PP_Resource</code> corresponding to a
121 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
122 * block.
123 *
124 * @param[in] request_id A value used by the browser to associate data
125 * returned via the <code>PPB_ContentDecryptor_Private</code> interface with
126 * decryption method calls.
127 */
128 PP_Bool (*DecryptAndDecode)(PP_Instance instance,
129 PP_Resource encrypted_block,
130 int32_t request_id);
131 };
132
133 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private;
134 /**
135 * @}
136 */
137
138 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */
139
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698