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_Dev</code> | |
dmichael (off chromium)
2012/08/08 22:24:02
I talked to Brett about it, and we agreed that thi
Tom Finegan
2012/08/09 22:45:17
Done.
| |
8 * interface. | |
9 */ | |
10 label Chrome { | |
11 M23 = 0.1 | |
12 }; | |
13 | |
14 /** | |
15 * <code>PPB_ContentDecryptor_Dev</code> structure contains the function | |
16 * pointers the browser MUST implement to support plugins implementing the | |
17 * <code>PPP_ContentDecryptor_Dev</code> interface. This interface provides | |
18 * browser side support for v0.1 of the proposed Encrypted Media Extensions: | |
19 * http://goo.gl/rbdnR | |
dmichael (off chromium)
2012/08/08 22:24:02
Also please note that this is a special interface,
Tom Finegan
2012/08/09 22:45:17
Done.
| |
20 */ | |
21 interface PPB_ContentDecryptor_Dev { | |
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 | |
29 * <code>PPP_ContentDecryptor_Dev<code> interface, In response, the browser | |
30 * must provide a key to the decryptor by calling <code>AddKey()</code> on | |
dmichael (off chromium)
2012/08/08 22:24:02
How does it do that? The way I was reading the spe
Tom Finegan
2012/08/09 22:45:17
Changed browser to application.
| |
31 * the <code>PPP_ContentDecryptor_Dev<code> interface. | |
32 * | |
33 * @param[in] key_system A <code>PP_Var</code> of type | |
34 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
35 * | |
36 * @param[in] session_id A <code>PP_Var</code> of type | |
37 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
38 * | |
39 * @param[in] init_data A <code>PP_Var</code> of type | |
40 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing content specific | |
41 * initialization data. | |
42 */ | |
43 void NeedKey( | |
44 [in] PP_Instance instance, | |
45 [in] PP_Var key_system, | |
46 [in] PP_Var session_id, | |
47 [in] PP_Var init_data); | |
48 | |
49 /** | |
50 * A key has been added as the result of a call to the <code>AddKey()</code> | |
51 * method on the <code>PPP_ContentDecryptor_Dev</code> interface, and | |
52 * decryption of content can proceed. | |
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] session_id A <code>PP_Var</code> of type | |
58 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
59 */ | |
60 void KeyAdded( | |
61 [in] PP_Instance instance, | |
62 [in] PP_Var key_system, | |
63 [in] PP_Var session_id); | |
64 | |
65 /** | |
66 * A message or request has been generated by or for key_system, and needs to | |
67 * be sent to a key server. | |
68 * | |
69 * For example, in response to successful key request generation resulting | |
70 * from a call to the <code>GenerateKeyRequest()</code> method on the | |
71 * <code>PPP_ContentDecryptor_Dev</code> interface, the decryptor will send | |
72 * a key message with the session ID. | |
73 * | |
74 * Note that <code>KeyMessage()</code> can be used for purposes other than | |
75 * responses to <code>GenerateKeyRequest()</code> calls. | |
76 * | |
77 * @param[in] key_system A <code>PP_Var</code> of type | |
78 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
79 * | |
80 * @param[in] session_id A <code>PP_Var</code> of type | |
81 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
82 * | |
83 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
84 * <code>PPB_Buffer_Dev</code> resource that contains the message. | |
85 * | |
86 * @param[in] session_id A <code>PP_Var</code> of type | |
87 * <code>PP_VARTYPE_STRING</code> containing the default URL for key system. | |
88 */ | |
89 void KeyMessage( | |
90 [in] PP_Instance instance, | |
91 [in] PP_Var key_system, | |
92 [in] PP_Var session_id, | |
93 [in] PP_Resource message, | |
94 [in] PP_Var default_url); | |
95 | |
96 /** | |
97 * An error occurred in a <code>PPP_ContentDecryptor_Dev</code> method, | |
98 * or within the plugin implementing the interface, and decryption cannot | |
99 * continue. | |
100 * | |
101 * @param[in] key_system A <code>PP_Var</code> of type | |
102 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | |
103 * | |
104 * @param[in] session_id A <code>PP_Var</code> of type | |
105 * <code>PP_VARTYPE_STRING</code> containing the session ID. | |
106 * | |
107 * @param[in] media_error A media stack error code. | |
108 * | |
109 * @param[in] system_error A system error code. | |
110 */ | |
111 void KeyError( | |
112 [in] PP_Instance instance, | |
113 [in] PP_Var key_system, | |
114 [in] PP_Var session_id, | |
115 [in] int32_t media_error, | |
116 [in] int32_t system_error); | |
117 | |
118 /** | |
119 * Called after the <code>Decrypt</code> method on the | |
120 * <code>PPP_ContentDecryptor_Dev</code> interface completes to | |
121 * deliver decrypted_block to the browser. | |
122 * | |
123 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
124 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted data | |
125 * block. | |
126 * | |
127 * @param[in] request_id A unique value the user agent can use to associate | |
128 * decrypted_block with a decrypt call. | |
129 */ | |
130 void DeliverBlock( | |
131 [in] PP_Instance instance, | |
132 [in] PP_Resource decrypted_block, | |
133 [in] uint64_t request_id); | |
134 | |
135 /** | |
136 * Called after the <code>DecryptAndDecode</code> method on the | |
137 * <code>PPP_ContentDecryptor_Dev</code> interface completes to | |
138 * deliver decrypted_frame to the browser. | |
139 * | |
140 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
141 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted video | |
142 * frame. | |
143 * | |
144 * @param[in] request_id A unique value the user agent can use to associate | |
145 * decrypted_frame with a decrypt call. | |
146 */ | |
147 void DeliverFrame( | |
148 [in] PP_Instance instance, | |
149 [in] PP_Resource decrypted_frame, | |
150 [in] uint64_t request_id); | |
151 | |
152 /** | |
153 * Called after the <code>DecryptAndDecode</code> method on the | |
154 * <code>PPP_ContentDecryptor_Dev</code> interface completes to | |
155 * deliver decrypted_samples to the browser. | |
156 * | |
157 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
158 * <code>PPB_Buffer_Dev</code> resource that contains a decrypted buffer | |
159 * of audio samples. | |
160 * | |
161 * @param[in] request_id A unique value the user agent can use to associate | |
162 * decrypted_samples with a decrypt call. | |
163 */ | |
164 void DeliverSamples( | |
165 [in] PP_Instance instance, | |
166 [in] PP_Resource decrypted_samples, | |
167 [in] uint64_t request_id); | |
168 }; | |
OLD | NEW |