1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/**
* This file defines the <code>PPP_ContentDecryptor_Private</code>
* interface. Note: This is a special interface, only to be used for Content
* Decryption Modules, not normal plugins.
*/
label Chrome {
M24 = 0.6
};
/**
* <code>PPP_ContentDecryptor_Private</code> structure contains the function
* pointers the decryption plugin must implement to provide services needed by
* the browser. This interface provides the plugin side support for the Content
* Decryption Module (CDM) for v0.1 of the proposed Encrypted Media Extensions:
* http://goo.gl/rbdnR
*/
interface PPP_ContentDecryptor_Private {
/**
* Generates a key request. key_system specifies the key or licensing system
* to use. type contains the MIME type of init_data. init_data is a data
* buffer containing data for use in generating the request.
*
* Note: <code>GenerateKeyRequest()</code> must create the session ID used in
* other methods on this interface. The session ID must be provided to the
* browser by the CDM via <code>KeyMessage()</code> on the
* <code>PPB_ContentDecryptor_Private</code> interface.
*
* @param[in] key_system A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the name of the key system.
*
* @param[in] type A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data.
*
* @param[in] init_data A <code>PP_Var</code> of type
* <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific
* initialization data.
*/
void GenerateKeyRequest(
[in] PP_Instance instance,
[in] PP_Var key_system,
[in] PP_Var type,
[in] PP_Var init_data);
/**
* Provides a key or license to the decryptor for decrypting media data.
*
* When the CDM needs more information to complete addition of the key it
* will call <code>KeyMessage()</code> on the
* <code>PPB_ContentDecryptor_Private</code> interface, which the browser
* passes to the application. When the key is ready to use, the CDM
* must call call <code>KeyAdded()</code> on the
* <code>PPB_ContentDecryptor_Private</code> interface, and the browser
* must notify the web application.
*
* @param[in] session_id A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the session ID.
*
* @param[in] key A <code>PP_Var</code> of type
* <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license,
* or other message for the given session ID.
*
* @param[in] init_data A <code>PP_Var</code> of type
* <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific
* initialization data.
*/
void AddKey(
[in] PP_Instance instance,
[in] PP_Var session_id,
[in] PP_Var key,
[in] PP_Var init_data);
/**
* Cancels a pending key request for the specified session ID.
*
* @param[in] session_id A <code>PP_Var</code> of type
* <code>PP_VARTYPE_STRING</code> containing the session ID.
*/
void CancelKeyRequest(
[in] PP_Instance instance,
[in] PP_Var session_id);
/**
* Decrypts the block and returns the unencrypted block via
* <code>DeliverBlock()</code> on the
* <code>PPB_ContentDecryptor_Private</code> interface. The returned block
* contains encoded data.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_Buffer_Dev</code> resource that contains an encrypted data
* block.
*
* @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that
* contains all auxiliary information needed for decryption of the
* <code>encrypted_block</code>.
*/
void Decrypt(
[in] PP_Instance instance,
[in] PP_Resource encrypted_block,
[in] PP_EncryptedBlockInfo encrypted_block_info);
/**
* Initializes the audio decoder using codec and settings in
* <code>decoder_config</code>, and returns the result of the initialization
* request to the browser using the <code>DecoderInitializeDone()</code> method
* on the <code>PPB_ContentDecryptor_Private</code> interface.
*
* @param[in] decoder_config A <code>PP_AudioDecoderConfig</code> that
* contains audio decoder settings and a request ID. The request ID is passed
* to the <code>DecoderInitializeDone()</code> method on the
* <code>PPB_ContentDecryptor_Private</code> interface to allow clients to
* associate the result with a audio decoder initialization request.
*
* @param[in] codec_extra_data A <code>PP_Resource</code> corresponding to a
* <code>PPB_Buffer_Dev</code> resource containing codec setup data required
* by some codecs. It should be set to 0 when the codec being initialized
* does not require it.
*/
void InitializeAudioDecoder(
[in] PP_Instance instance,
[in] PP_AudioDecoderConfig decoder_config,
[in] PP_Resource codec_extra_data);
/**
* Initializes the video decoder using codec and settings in
* <code>decoder_config</code>, and returns the result of the initialization
* request to the browser using the <code>DecoderInitializeDone()</code>
* method on the <code>PPB_ContentDecryptor_Private</code> interface.
*
* @param[in] decoder_config A <code>PP_VideoDecoderConfig</code> that
* contains video decoder settings and a request ID. The request ID is passed
* to the <code>DecoderInitializeDone()</code> method on the
* <code>PPB_ContentDecryptor_Private</code> interface to allow clients to
* associate the result with a video decoder initialization request.
*
* @param[in] codec_extra_data A <code>PP_Resource</code> corresponding to a
* <code>PPB_Buffer_Dev</code> resource containing codec setup data required
* by some codecs. It should be set to 0 when the codec being initialized
* does not require it.
*/
void InitializeVideoDecoder(
[in] PP_Instance instance,
[in] PP_VideoDecoderConfig decoder_config,
[in] PP_Resource codec_extra_data);
/**
* De-initializes the decoder for the <code>PP_DecryptorStreamType</code>
* specified by <code>decoder_type</code> and sets it to an uninitialized
* state. The decoder can be re-initialized after de-initialization completes
* by calling <code>InitializeAudioDecoder</code> or
* <code>InitializeVideoDecoder</code>.
*
* De-initialization completion is reported to the browser using the
* <code>DecoderDeinitializeDone()</code> method on the
* <code>PPB_ContentDecryptor_Private</code> interface.
*
* @param[in] decoder_type A <code>PP_DecryptorStreamType</code> that
* specifies the decoder to de-initialize.
*
* @param[in] request_id A request ID that allows the browser to associate a
* request to de-initialize a decoder with the corresponding call to the
* <code>DecoderDeinitializeDone()</code> method on the
* <code>PPB_ContentDecryptor_Private</code> interface.
*/
void DeinitializeDecoder(
[in] PP_Instance instance,
[in] PP_DecryptorStreamType decoder_type,
[in] uint32_t request_id);
/**
* Resets the decoder for the <code>PP_DecryptorStreamType</code> specified
* by <code>decoder_type</code> to an initialized clean state. Reset
* completion is reported to the browser using the
* <code>DecoderResetDone()</code> method on the
* <code>PPB_ContentDecryptor_Private</code> interface. This method can be
* used to signal a discontinuity in the encoded data stream, and is safe to
* call multiple times.
*
* @param[in] decoder_type A <code>PP_DecryptorStreamType</code> that
* specifies the decoder to reset.
*
* @param[in] request_id A request ID that allows the browser to associate a
* request to reset the decoder with a corresponding call to the
* <code>DecoderResetDone()</code> method on the
* <code>PPB_ContentDecryptor_Private</code> interface.
*/
void ResetDecoder(
[in] PP_Instance instance,
[in] PP_DecryptorStreamType decoder_type,
[in] uint32_t request_id);
/**
* Decrypts encrypted_buffer, decodes it, and returns the unencrypted
* uncompressed (decoded) data to the browser via the
* <code>DeliverFrame()</code> or <code>DeliverSamples()</code> method on the
* <code>PPB_ContentDecryptor_Private</code> interface.
*
* @param[in] decoder_type A <code>PP_DecryptorStreamType</code> that
* specifies the decoder to use after <code>encrypted_buffer</code> is
* decrypted.
*
* @param[in] encrypted_buffer A <code>PP_Resource</code> corresponding to a
* <code>PPB_Buffer_Dev</code> resource that contains encrypted media data.
*
* @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that
* contains all auxiliary information needed for decryption of the
* <code>encrypted_block</code>.
*/
void DecryptAndDecode(
[in] PP_Instance instance,
[in] PP_DecryptorStreamType decoder_type,
[in] PP_Resource encrypted_buffer,
[in] PP_EncryptedBlockInfo encrypted_block_info);
};
|