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. Note: This is a special interface, only to be used for Content | |
9 * Decryption Modules (CDM), not normal plugins. | |
ddorwin
2012/08/14 17:39:58
singular acronym with plural expansion bugs me, bu
Tom Finegan
2012/08/14 18:09:32
Moved down to the comment block above the interfac
| |
10 */ | |
11 label Chrome { | |
12 M23 = 0.1 | |
13 }; | |
14 | |
15 /** | |
16 * <code>PPB_ContentDecryptor_Private</code> structure contains the function | |
17 * pointers the browser must implement to support plugins implementing the | |
18 * <code>PPP_ContentDecryptor_Private</code> interface. This interface provides | |
19 * browser side support for the CDM for v0.1 of the proposed Encrypted Media | |
20 * Extensions: http://goo.gl/rbdnR | |
21 */ | |
22 interface PPB_ContentDecryptor_Private { | |
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 the <code>Decrypt()</code> method on the | |
29 * <code>PPP_ContentDecryptor_Private<code> interface. | |
30 * | |
31 * For an internally implemented key system, the browser must provide a key to | |
ddorwin
2012/08/14 17:39:58
What is "internally implemented key system"?
Tom Finegan
2012/08/14 18:09:32
Internally/externally stuff removed...
| |
32 * the decryptor plugin by calling <code>AddKey()</code> on the | |
ddorwin
2012/08/14 17:39:58
I would replace these two paragraphs with somethin
Tom Finegan
2012/08/14 18:09:32
Removed EME flow stuff-- spec is still being updat
| |
33 * <code>PPP_ContentDecryptor_Private<code> interface. | |
34 * | |
35 * For an external key system, the browser must notify the application that | |
36 * a key is needed by firing a <code>MediaKeyNeededEvent</code> at the | |
37 * <code>HTMLMediaElement</code>. In response the application must call | |
38 * <code>addKey()</code> on the <code>HTMLMediaElement</code> which results | |
39 * in the browser passing the application's key to <code>AddKey()</code> on | |
40 * the <code>PPP_ContentDecryptor_Private<code> interface. | |
41 * | |
42 * @param[in] key_system A <code>PP_Var</code> of type | |
43 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
44 * | |
45 * @param[in] session_id A <code>PP_Var</code> of type | |
46 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
47 * | |
48 * @param[in] init_data A <code>PP_Var</code> of type | |
49 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container-specific | |
50 * initialization data. | |
51 */ | |
52 void NeedKey( | |
53 [in] PP_Instance instance, | |
54 [in] PP_Var key_system, | |
55 [in] PP_Var session_id, | |
56 [in] PP_Var init_data); | |
57 | |
58 /** | |
59 * A key has been added as the result of a call to the <code>AddKey()</code> | |
60 * method on the <code>PPP_ContentDecryptor_Private</code> interface. | |
61 * | |
62 * Note: The above describes the most simple case. Depending on the key | |
63 * system, a series of <code>KeyMessage()</code> calls from the CDM will be | |
64 * sent to the browser, and then on to the application by firing a | |
65 * <code>MediaKeyMessageEvent</code> at the <code>HTMLMediaElement</code>. | |
ddorwin
2012/08/14 17:39:58
Same, I don't think we need to go into the details
Tom Finegan
2012/08/14 18:09:32
Done.
| |
66 * In response, the application must then provide more data via additional | |
67 * calls to the <code>addKey()</code> method on the | |
68 * <code>HTMLMediaElement</code>, which the browser must pass to the CDM via | |
69 * calls to <code>AddKey()</code> on the | |
70 * <code>PPP_ContentDecryptor_Private</code> interface. | |
71 * The CDM must call <code>KeyAdded()</code> when the sequence is completed, | |
72 * and, for external key systems, the browser must fire a | |
73 * <code>MediaKeyCompleteEvent</code> at the <code>HTMLMediaElement</code>. | |
74 * | |
75 * @param[in] key_system A <code>PP_Var</code> of type | |
76 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
77 * | |
78 * @param[in] session_id A <code>PP_Var</code> of type | |
79 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
80 */ | |
81 void KeyAdded( | |
82 [in] PP_Instance instance, | |
83 [in] PP_Var key_system, | |
84 [in] PP_Var session_id); | |
85 | |
86 /** | |
87 * A message or request has been generated for key_system in the CDM, and, | |
88 * when the key system is external, must be sent to the application. | |
ddorwin
2012/08/14 17:39:58
Remove ", when the key system is external,"
Tom Finegan
2012/08/14 18:09:32
Done.
| |
89 * | |
90 * For example, when the browser invokes <code>GenerateKeyRequest()</code> | |
91 * on the <code>PPP_ContentDecryptor_Private</code> interface, the decryptor | |
ddorwin
2012/08/14 17:39:58
s/decryptor/plugin/ ?
Tom Finegan
2012/08/14 18:09:32
Done.
| |
92 * must send a key message with the session ID. | |
ddorwin
2012/08/14 17:39:58
must send a key message containing the key request
Tom Finegan
2012/08/14 18:09:32
Done.
| |
93 * | |
94 * Note that <code>KeyMessage()</code> can be used for purposes other than | |
95 * responses to <code>GenerateKeyRequest()</code> calls. See also the text | |
96 * in the comment for <code>KeyAdded()</code>, which describes a sequence of | |
97 * <code>AddKey()</code> and <code>KeyMessage()</code> calls required to | |
98 * prepare for decryption. | |
99 * | |
100 * @param[in] key_system A <code>PP_Var</code> of type | |
101 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
102 * | |
103 * @param[in] session_id A <code>PP_Var</code> of type | |
104 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
105 * | |
106 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
107 * <code>PPB_Buffer_Dev</code> resource that contains the message. | |
108 * | |
109 * @param[in] default_url A <code>PP_Var</code> of type | |
110 * <code>PP_VARTYPE_STRING</code> containing the default URL for the message. | |
111 */ | |
112 void KeyMessage( | |
113 [in] PP_Instance instance, | |
114 [in] PP_Var key_system, | |
115 [in] PP_Var session_id, | |
116 [in] PP_Resource message, | |
117 [in] PP_Var default_url); | |
118 | |
119 /** | |
120 * An error occurred in a <code>PPP_ContentDecryptor_Private</code> method, | |
121 * or within the plugin implementing the interface. | |
122 * | |
123 * @param[in] key_system A <code>PP_Var</code> of type | |
124 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
125 * | |
126 * @param[in] session_id A <code>PP_Var</code> of type | |
127 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
128 * | |
129 * @param[in] media_error A MediaKeyError. | |
130 * | |
131 * @param[in] system_error A system error code. | |
132 */ | |
133 void KeyError( | |
134 [in] PP_Instance instance, | |
135 [in] PP_Var key_system, | |
136 [in] PP_Var session_id, | |
137 [in] int32_t media_error, | |
138 [in] int32_t system_code); | |
139 | |
140 /** | |
141 * Called after the <code>Decrypt()</code> method on the | |
142 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
143 * deliver decrypted_block to the browser for decoding and rendering. | |
144 * | |
145 * @param[in] decrypted_block A <code>PP_Resource</code> corresponding to a | |
146 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data | |
147 * block. | |
148 * | |
149 * @param[in] request_id A unique value the browser can use to associate | |
150 * decrypted_block with a decrypt call. | |
151 */ | |
152 void DeliverBlock( | |
153 [in] PP_Instance instance, | |
154 [in] PP_Resource decrypted_block, | |
155 [in] int32_t request_id); | |
156 | |
157 /** | |
158 * Called after the <code>DecryptAndDecode()</code> method on the | |
159 * <code>PPP_ContentDecryptor_Private</code> interface completes to deliver | |
160 * a decrypted and decoded video frame to the browser for rendering. | |
161 * | |
162 * @param[in] decrypted_frame A <code>PP_Resource</code> corresponding to a | |
163 * <code>PPB_Buffer_Dev</code> resource that contains a video frame. | |
164 * | |
165 * @param[in] request_id A unique value the browser can use to associate | |
166 * decrypted_frame with a decrypt call. | |
167 */ | |
168 void DeliverFrame( | |
169 [in] PP_Instance instance, | |
170 [in] PP_Resource decrypted_frame, | |
171 [in] int32_t request_id); | |
172 | |
173 /** | |
174 * Called after the <code>DecryptAndDecode()</code> method on the | |
175 * <code>PPP_ContentDecryptor_Private</code> interface completes to | |
176 * deliver a buffer of decrypted and decoded audio samples to the browser for | |
177 * rendering. | |
178 * | |
179 * @param[in] decrypted_samples A <code>PP_Resource</code> corresponding to a | |
180 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer | |
181 * of decoded audio samples. | |
182 * | |
183 * @param[in] request_id A unique value the browser can use to associate | |
184 * decrypted_samples with a decrypt call. | |
185 */ | |
186 void DeliverSamples( | |
187 [in] PP_Instance instance, | |
188 [in] PP_Resource decrypted_samples, | |
189 [in] int32_t request_id); | |
190 }; | |
OLD | NEW |