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 /** | |
7 * This file defines the <code>PPB_ContentDecryptor_Private</code> | |
8 * interface. | |
9 */ | |
10 label Chrome { | |
11 M23 = 0.1 | |
12 }; | |
13 | |
14 /** | |
15 * <code>PPB_ContentDecryptor_Private</code> structure contains the function | |
16 * pointers the browser MUST implement to support plugins implementing the | |
17 * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides | |
18 * browser side support for v0.1 of the proposed Encrypted Media Extensions: | |
ddorwin
2012/08/11 22:08:57
... support for the CDM for...
Tom Finegan
2012/08/13 16:27:17
Done.
| |
19 * http://goo.gl/rbdnR | |
20 */ | |
21 interface PPB_ContentDecryptor_Private { | |
22 | |
23 /** | |
24 * The decryptor requires a key that has not been provided. | |
25 * | |
26 * Sent when the decryptor encounters encrypted content, but it does not have | |
27 * the key required to decrypt the data. The plugin will call this method in | |
28 * response to a call to <code>Decrypt()</code> on the | |
29 * <code>PPP_ContentDecryptor_Private<code> interface, In response, the | |
ddorwin
2012/08/11 22:08:57
s/,/./
Tom Finegan
2012/08/13 16:27:17
Done.
| |
30 * browser should provide a key to the decryptor plugin by calling | |
31 * <code>AddKey()</code> on the <code>PPP_ContentDecryptor_Private<code> | |
32 * interface. The key could be provided by the browser, or from the | |
ddorwin
2012/08/11 22:08:57
I think this last sentence is unnecessary.
Tom Finegan
2012/08/13 16:27:17
Removed.
| |
33 * application via a call to <code>addkey()</code> on the media element. | |
34 * | |
35 * @param[in] key_system A <code>PP_Var</code> of type | |
36 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
37 * | |
38 * @param[in] session_id A <code>PP_Var</code> of type | |
39 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
40 * | |
41 * @param[in] init_data A <code>PP_Var</code> of type | |
42 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific | |
ddorwin
2012/08/11 22:08:57
s/content/container/ ?
Tom Finegan
2012/08/13 16:27:17
Done.
| |
43 * initialization data. | |
44 */ | |
45 void NeedKey( | |
46 [in] PP_Instance instance, | |
47 [in] PP_Var key_system, | |
48 [in] PP_Var session_id, | |
49 [in] PP_Var init_data); | |
50 | |
51 /** | |
52 * A key has been added as the result of a call to the <code>AddKey()</code> | |
53 * method on the <code>PPP_ContentDecryptor_Private</code> interface. | |
54 * | |
55 * Note: the above describes the most simple case. Depending on the key | |
ddorwin
2012/08/11 22:08:57
s/the/The/
Tom Finegan
2012/08/13 16:27:17
Done.
| |
56 * system, a series of <code>KeyMessage()</code> calls with the application | |
57 * providing more data via additional calls to <code>AddKey()</code> could be | |
58 * required. <code>KeyAdded()</code> is sent once the sequence is completed. | |
59 * | |
60 * @param[in] key_system A <code>PP_Var</code> of type | |
61 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
62 * | |
63 * @param[in] session_id A <code>PP_Var</code> of type | |
64 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
65 */ | |
66 void KeyAdded( | |
67 [in] PP_Instance instance, | |
68 [in] PP_Var key_system, | |
69 [in] PP_Var session_id); | |
70 | |
71 /** | |
72 * A message or request has been generated by or for key_system, and needs to | |
73 * be sent to a key server. | |
74 * | |
75 * For example, in response to successful key request generation resulting | |
76 * from a call to the <code>GenerateKeyRequest()</code> method on the | |
77 * <code>PPP_ContentDecryptor_Private</code> interface, the decryptor will | |
78 * send a key message with the session ID. | |
79 * | |
80 * Note that <code>KeyMessage()</code> can be used for purposes other than | |
81 * responses to <code>GenerateKeyRequest()</code> calls. Of note is the text | |
82 * in the comment for <code>KeyAdded()</code>, which describes a sequence of | |
83 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to | |
84 * prepare for decryption. | |
85 * | |
86 * @param[in] key_system A <code>PP_Var</code> of type | |
87 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
88 * | |
89 * @param[in] session_id A <code>PP_Var</code> of type | |
90 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
91 * | |
92 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
93 * <code>PPB_Buffer_Dev</code> resource that contains the message. | |
94 * | |
95 * @param[in] default_url A <code>PP_Var</code> of type | |
96 * <code>PP_VARTYPE_STRING</code> containing the default URL for key system. | |
ddorwin
2012/08/11 22:08:57
s/key system/the message/
Tom Finegan
2012/08/13 16:27:17
Done.
| |
97 */ | |
98 void KeyMessage( | |
99 [in] PP_Instance instance, | |
100 [in] PP_Var key_system, | |
101 [in] PP_Var session_id, | |
102 [in] PP_Resource message, | |
103 [in] PP_Var default_url); | |
104 | |
105 /** | |
106 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, | |
107 * or within the plugin implementing the interface. | |
108 * | |
109 * @param[in] key_system A <code>PP_Var</code> of type | |
110 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
111 * | |
112 * @param[in] session_id A <code>PP_Var</code> of type | |
113 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
114 * | |
115 * @param[in] media_error A media stack error code. | |
ddorwin
2012/08/11 22:08:57
error_code A MediaKeyError.
Tom Finegan
2012/08/13 16:27:17
Done.
| |
116 * | |
117 * @param[in] system_error A system error code. | |
ddorwin
2012/08/11 22:08:57
system_code
Tom Finegan
2012/08/13 16:27:17
Done.
| |
118 */ | |
119 void KeyError( | |
120 [in] PP_Instance instance, | |
121 [in] PP_Var key_system, | |
122 [in] PP_Var session_id, | |
123 [in] int32_t media_error, | |
124 [in] int32_t system_error); | |
125 | |
126 /** | |
127 * Called after the <code>Decrypt()</code> method on the | |
128 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
129 * deliver decrypted_block to the browser. | |
130 * | |
131 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a | |
132 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data | |
133 * block. | |
134 * | |
135 * @param[in] request_id A unique value the user agent can use to associate | |
136 * decrypted_block with a decrypt call. | |
137 */ | |
138 void DeliverBlock( | |
139 [in] PP_Instance instance, | |
140 [in] PP_Resource decrypted_block, | |
141 [in] uint64_t request_id); | |
ddorwin
2012/08/11 22:08:57
We usually prefer signed ints. Is there a reason i
Tom Finegan
2012/08/13 16:27:17
Taken directly from a suggestion in an offline dis
| |
142 | |
143 /** | |
144 * Called after the <code>DecryptAndDecode()</code> method on the | |
145 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
146 * deliver a decrypted and decoded video frame to the browser. | |
147 * | |
148 * @param[in] decrypted_frame A <code>PP_Resource</code> corresponding to a | |
149 * <code>PPB_Buffer_Dev</code> resource that contains a video frame. | |
150 * | |
151 * @param[in] request_id A unique value the user agent can use to associate | |
152 * decrypted_frame with a decrypt call. | |
153 */ | |
154 void DeliverFrame( | |
ddorwin
2012/08/11 22:08:57
Thoughts on whether to include "Video" in the name
Tom Finegan
2012/08/13 16:27:17
I would be fine w/DeliverVideoFrame or just Delive
ddorwin
2012/08/13 17:43:50
I think the signature would be different for more
| |
155 [in] PP_Instance instance, | |
156 [in] PP_Resource decrypted_frame, | |
ddorwin
2012/08/11 22:08:57
Are we going to meed more information than this?
T
Tom Finegan
2012/08/13 16:27:17
Probably not when returning the uncompressed data-
| |
157 [in] uint64_t request_id); | |
158 | |
159 /** | |
160 * Called after the <code>DecryptAndDecode()</code> method on the | |
161 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
162 * deliver a buffer of decrypted and decoded audio samples to the browser. | |
163 * | |
164 * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a | |
165 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer | |
166 * of decoded audio samples. | |
167 * | |
168 * @param[in] request_id A unique value the user agent can use to associate | |
169 * decrypted_samples with a decrypt call. | |
170 */ | |
171 void DeliverSamples( | |
172 [in] PP_Instance instance, | |
173 [in] PP_Resource decrypted_samples, | |
174 [in] uint64_t request_id); | |
175 }; | |
OLD | NEW |