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 the CDM for v0.1 of the proposed Encrypted Media | |
19 * Extensions: http://goo.gl/rbdnR | |
dmichael (off chromium)
2012/08/14 03:31:37
Please note (preferrably early in the comment) tha
Tom Finegan
2012/08/14 16:39:40
Done; added missing note to this file, and put it
| |
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 | |
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. | |
dmichael (off chromium)
2012/08/14 03:31:37
I still think it's important that the browser migh
Tom Finegan
2012/08/14 16:39:40
Done.
| |
33 * | |
34 * @param[in] key_system A <code>PP_Var</code> of type | |
35 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
36 * | |
37 * @param[in] session_id A <code>PP_Var</code> of type | |
38 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
39 * | |
40 * @param[in] init_data A <code>PP_Var</code> of type | |
41 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | |
dmichael (off chromium)
2012/08/14 03:31:37
nit: "container specific"->"container-specific"
Tom Finegan
2012/08/14 16:39:40
Done.
| |
42 * initialization data. | |
43 */ | |
44 void NeedKey( | |
dmichael (off chromium)
2012/08/14 03:31:37
I actually think RequestKey would be more appropri
Tom Finegan
2012/08/14 16:39:40
NeedKey is from the spec.
| |
45 [in] PP_Instance instance, | |
46 [in] PP_Var key_system, | |
47 [in] PP_Var session_id, | |
48 [in] PP_Var init_data); | |
49 | |
50 /** | |
51 * A key has been added as the result of a call to the <code>AddKey()</code> | |
52 * method on the <code>PPP_ContentDecryptor_Private</code> interface. | |
53 * | |
54 * Note: The above describes the most simple case. Depending on the key | |
55 * system, a series of <code>KeyMessage()</code> calls with the application | |
56 * providing more data via additional calls to <code>AddKey()</code> could be | |
dmichael (off chromium)
2012/08/14 03:31:37
I find this wording a bit confusing... can you ma
Tom Finegan
2012/08/14 16:39:40
Done.
| |
57 * required. <code>KeyAdded()</code> is sent once the sequence is completed. | |
dmichael (off chromium)
2012/08/14 03:31:37
as above, "The CDM invokes <code>KeyAdded()</code>
Tom Finegan
2012/08/14 16:39:40
Done.
| |
58 * | |
59 * @param[in] key_system A <code>PP_Var</code> of type | |
60 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
61 * | |
62 * @param[in] session_id A <code>PP_Var</code> of type | |
63 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
64 */ | |
65 void KeyAdded( | |
66 [in] PP_Instance instance, | |
67 [in] PP_Var key_system, | |
68 [in] PP_Var session_id); | |
69 | |
70 /** | |
71 * A message or request has been generated by or for key_system, and needs to | |
72 * be sent to a key server. | |
73 * | |
74 * For example, in response to successful key request generation resulting | |
75 * from a call to the <code>GenerateKeyRequest()</code> method on the | |
76 * <code>PPP_ContentDecryptor_Private</code> interface, the decryptor will | |
dmichael (off chromium)
2012/08/14 03:31:37
Maybe it would be clearer to say something like:
"
Tom Finegan
2012/08/14 16:39:40
Done.
| |
77 * send a key message with the session ID. | |
78 * | |
79 * Note that <code>KeyMessage()</code> can be used for purposes other than | |
80 * responses to <code>GenerateKeyRequest()</code> calls. Of note is the text | |
dmichael (off chromium)
2012/08/14 03:31:37
"Of note is" -> "See also"
Tom Finegan
2012/08/14 16:39:40
Done.
| |
81 * in the comment for <code>KeyAdded()</code>, which describes a sequence of | |
82 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to | |
83 * prepare for decryption. | |
84 * | |
85 * @param[in] key_system A <code>PP_Var</code> of type | |
86 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
87 * | |
88 * @param[in] session_id A <code>PP_Var</code> of type | |
89 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
90 * | |
91 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
92 * <code>PPB_Buffer_Dev</code> resource that contains the message. | |
93 * | |
94 * @param[in] default_url A <code>PP_Var</code> of type | |
95 * <code>PP_VARTYPE_STRING</code> containing the default URL for the message. | |
96 */ | |
97 void KeyMessage( | |
dmichael (off chromium)
2012/08/14 03:31:37
This is another method name that's a bit opaque to
Tom Finegan
2012/08/14 16:39:40
From spec.
| |
98 [in] PP_Instance instance, | |
99 [in] PP_Var key_system, | |
100 [in] PP_Var session_id, | |
101 [in] PP_Resource message, | |
102 [in] PP_Var default_url); | |
103 | |
104 /** | |
105 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, | |
106 * or within the plugin implementing the interface. | |
107 * | |
108 * @param[in] key_system A <code>PP_Var</code> of type | |
109 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
110 * | |
111 * @param[in] session_id A <code>PP_Var</code> of type | |
112 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
113 * | |
114 * @param[in] media_error A MediaKeyError. | |
115 * | |
116 * @param[in] system_error A system error code. | |
117 */ | |
118 void KeyError( | |
119 [in] PP_Instance instance, | |
120 [in] PP_Var key_system, | |
121 [in] PP_Var session_id, | |
122 [in] int32_t media_error, | |
123 [in] int32_t system_code); | |
124 | |
125 /** | |
126 * Called after the <code>Decrypt()</code> method on the | |
127 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
128 * deliver decrypted_block to the browser. | |
dmichael (off chromium)
2012/08/14 03:31:37
As I mentioned before, we usually say what the bro
Tom Finegan
2012/08/14 16:39:40
All I can really add here is that the block is sen
| |
129 * | |
130 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a | |
131 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data | |
132 * block. | |
133 * | |
134 * @param[in] request_id A unique value the browser can use to associate | |
135 * decrypted_block with a decrypt call. | |
136 */ | |
137 void DeliverBlock( | |
138 [in] PP_Instance instance, | |
139 [in] PP_Resource decrypted_block, | |
140 [in] int32_t request_id); | |
141 | |
142 /** | |
143 * Called after the <code>DecryptAndDecode()</code> method on the | |
144 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
145 * deliver a decrypted and decoded video frame to the browser. | |
dmichael (off chromium)
2012/08/14 03:31:37
same as above; what does the browser do?
Tom Finegan
2012/08/14 16:39:40
Done.
| |
146 * | |
147 * @param[in] decrypted_frame A <code>PP_Resource</code> corresponding to a | |
148 * <code>PPB_Buffer_Dev</code> resource that contains a video frame. | |
149 * | |
150 * @param[in] request_id A unique value the browser can use to associate | |
151 * decrypted_frame with a decrypt call. | |
152 */ | |
153 void DeliverFrame( | |
154 [in] PP_Instance instance, | |
155 [in] PP_Resource decrypted_frame, | |
156 [in] int32_t request_id); | |
157 | |
158 /** | |
159 * Called after the <code>DecryptAndDecode()</code> method on the | |
160 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
161 * deliver a buffer of decrypted and decoded audio samples to the browser. | |
dmichael (off chromium)
2012/08/14 03:31:37
ditto
Tom Finegan
2012/08/14 16:39:40
Done.
| |
162 * | |
163 * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a | |
164 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer | |
165 * of decoded audio samples. | |
166 * | |
167 * @param[in] request_id A unique value the browser can use to associate | |
168 * decrypted_samples with a decrypt call. | |
169 */ | |
170 void DeliverSamples( | |
171 [in] PP_Instance instance, | |
172 [in] PP_Resource decrypted_samples, | |
173 [in] int32_t request_id); | |
174 }; | |
OLD | NEW |