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: | |
19 * http://goo.gl/rbdnR | |
xhwang
2012/08/10 16:41:30
I am not sure if we should use short URL in this f
Tom Finegan
2012/08/10 17:13:06
Originally I was using the full URL, but generator
| |
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 a decrypt method on the | |
xhwang
2012/08/10 16:41:30
s/decrypt/<code>Decrypt()<code>
Tom Finegan
2012/08/10 17:13:06
Done.
| |
29 * <code>PPP_ContentDecryptor_Private<code> interface, In response, the | |
30 * application must provide a key to the decryptor plugin by calling | |
31 * <code>AddKey()</code> on the <code>PPP_ContentDecryptor_Private<code> | |
xhwang
2012/08/10 16:41:30
The application cannot call the PPP interface dire
Tom Finegan
2012/08/10 17:13:06
Done.
| |
32 * interface. | |
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 content specific | |
42 * initialization data. | |
43 */ | |
44 void NeedKey( | |
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, and | |
53 * decryption of content can proceed. | |
xhwang
2012/08/10 16:41:30
Remove "and decryption of content can proceed"? Th
Tom Finegan
2012/08/10 17:13:06
Done.
| |
54 * | |
55 * Note: the above describes the most simple case. Depending on the key | |
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 * and the decryptor plugin is ready to begin decryption of data. | |
xhwang
2012/08/10 16:41:30
ditto about the last sentence.
Tom Finegan
2012/08/10 17:13:06
Done.
| |
60 * | |
61 * @param[in] key_system A <code>PP_Var</code> of type | |
62 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
63 * | |
64 * @param[in] session_id A <code>PP_Var</code> of type | |
65 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
66 */ | |
67 void KeyAdded( | |
68 [in] PP_Instance instance, | |
69 [in] PP_Var key_system, | |
70 [in] PP_Var session_id); | |
71 | |
72 /** | |
73 * A message or request has been generated by or for key_system, and needs to | |
74 * be sent to a key server. | |
75 * | |
76 * For example, in response to successful key request generation resulting | |
77 * from a call to the <code>GenerateKeyRequest()</code> method on the | |
78 * <code>PPP_ContentDecryptor_Private</code> interface, the decryptor will | |
79 * send a key message with the session ID. | |
80 * | |
81 * Note that <code>KeyMessage()</code> can be used for purposes other than | |
82 * responses to <code>GenerateKeyRequest()</code> calls. Of note is the text | |
83 * in the comment for <code>KeyAdded()</code>, which describes a sequence of | |
84 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to | |
85 * prepare for decryption. | |
86 * | |
87 * @param[in] key_system A <code>PP_Var</code> of type | |
88 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
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 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
94 * <code>PPB_Buffer_Dev</code> resource that contains the message. | |
95 * | |
96 * @param[in] session_id A <code>PP_Var</code> of type | |
xhwang
2012/08/10 16:41:30
s/session_id/default_url
Tom Finegan
2012/08/10 17:13:06
Done.
| |
97 * <code>PP_VARTYPE_STRING</code> containing the default URL for key system. | |
98 */ | |
99 void KeyMessage( | |
100 [in] PP_Instance instance, | |
101 [in] PP_Var key_system, | |
102 [in] PP_Var session_id, | |
103 [in] PP_Resource message, | |
104 [in] PP_Var default_url); | |
105 | |
106 /** | |
107 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, | |
108 * or within the plugin implementing the interface. | |
109 * | |
110 * @param[in] key_system A <code>PP_Var</code> of type | |
111 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
112 * | |
113 * @param[in] session_id A <code>PP_Var</code> of type | |
114 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
115 * | |
116 * @param[in] media_error A media stack error code. | |
117 * | |
118 * @param[in] system_error A system error code. | |
119 */ | |
120 void KeyError( | |
121 [in] PP_Instance instance, | |
122 [in] PP_Var key_system, | |
123 [in] PP_Var session_id, | |
124 [in] int32_t media_error, | |
125 [in] int32_t system_error); | |
126 | |
127 /** | |
128 * Called after the <code>Decrypt()</code> method on the | |
129 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
130 * deliver decrypted_block to the browser. | |
131 * | |
132 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
xhwang
2012/08/10 16:41:30
s/resource/decrypted_block
Tom Finegan
2012/08/10 17:13:06
Done.
| |
133 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data | |
134 * block. | |
135 * | |
136 * @param[in] request_id A unique value the user agent can use to associate | |
137 * decrypted_block with a decrypt call. | |
138 */ | |
139 void DeliverBlock( | |
140 [in] PP_Instance instance, | |
141 [in] PP_Resource decrypted_block, | |
142 [in] uint64_t request_id); | |
143 | |
144 /** | |
145 * Called after the <code>DecryptAndDecode</code> method on the | |
xhwang
2012/08/10 16:41:30
s/DecryptAndDecode/DecryptAndDecode()
Tom Finegan
2012/08/10 17:13:06
Done.
| |
146 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
147 * deliver decrypted_frame to the browser. | |
148 * | |
149 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
xhwang
2012/08/10 16:41:30
s/resource/decrypted_frame
Tom Finegan
2012/08/10 17:13:06
Done.
| |
150 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted video | |
151 * frame. | |
152 * | |
153 * @param[in] request_id A unique value the user agent can use to associate | |
154 * decrypted_frame with a decrypt call. | |
155 */ | |
156 void DeliverFrame( | |
157 [in] PP_Instance instance, | |
158 [in] PP_Resource decrypted_frame, | |
159 [in] uint64_t request_id); | |
160 | |
161 /** | |
162 * Called after the <code>DecryptAndDecode()</code> method on the | |
163 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
164 * deliver decrypted_samples to the browser. | |
xhwang
2012/08/10 16:41:30
Should we mention this is for audio and DeliverFra
Tom Finegan
2012/08/10 17:13:06
Done.
| |
165 * | |
166 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
xhwang
2012/08/10 16:41:30
s/resource/decrypted_samples
Tom Finegan
2012/08/10 17:13:06
Done.
| |
167 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer | |
168 * of audio samples. | |
169 * | |
170 * @param[in] request_id A unique value the user agent can use to associate | |
171 * decrypted_samples with a decrypt call. | |
172 */ | |
173 void DeliverSamples( | |
174 [in] PP_Instance instance, | |
175 [in] PP_Resource decrypted_samples, | |
176 [in] uint64_t request_id); | |
177 }; | |
OLD | NEW |