OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From private/ppp_content_decryptor_private.idl, | 6 /* From private/ppp_content_decryptor_private.idl, |
7 * modified Mon Aug 25 14:02:40 2014. | 7 * modified Fri Dec 19 15:58:46 2014. |
8 */ | 8 */ |
9 | 9 |
10 #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ | 10 #ifndef PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ |
11 #define PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ | 11 #define PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ |
12 | 12 |
13 #include "ppapi/c/pp_bool.h" | 13 #include "ppapi/c/pp_bool.h" |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
17 #include "ppapi/c/pp_stdint.h" | 17 #include "ppapi/c/pp_stdint.h" |
18 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
19 #include "ppapi/c/private/pp_content_decryptor.h" | 19 #include "ppapi/c/private/pp_content_decryptor.h" |
20 | 20 |
21 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_12 \ | 21 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_13 \ |
22 "PPP_ContentDecryptor_Private;0.12" | 22 "PPP_ContentDecryptor_Private;0.13" |
23 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ | 23 #define PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE \ |
24 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_12 | 24 PPP_CONTENTDECRYPTOR_PRIVATE_INTERFACE_0_13 |
25 | 25 |
26 /** | 26 /** |
27 * @file | 27 * @file |
28 * This file defines the <code>PPP_ContentDecryptor_Private</code> | 28 * This file defines the <code>PPP_ContentDecryptor_Private</code> |
29 * interface. Note: This is a special interface, only to be used for Content | 29 * interface. Note: This is a special interface, only to be used for Content |
30 * Decryption Modules, not normal plugins. | 30 * Decryption Modules, not normal plugins. |
31 */ | 31 */ |
32 | 32 |
33 | 33 |
34 /** | 34 /** |
35 * @addtogroup Interfaces | 35 * @addtogroup Interfaces |
36 * @{ | 36 * @{ |
37 */ | 37 */ |
38 /** | 38 /** |
39 * <code>PPP_ContentDecryptor_Private</code> structure contains the function | 39 * <code>PPP_ContentDecryptor_Private</code> structure contains the function |
40 * pointers the decryption plugin must implement to provide services needed by | 40 * pointers the decryption plugin must implement to provide services needed by |
41 * the browser. This interface provides the plugin side support for the Content | 41 * the browser. This interface provides the plugin side support for the Content |
42 * Decryption Module (CDM) for Encrypted Media Extensions: | 42 * Decryption Module (CDM) for Encrypted Media Extensions: |
43 * http://www.w3.org/TR/encrypted-media/ | 43 * http://www.w3.org/TR/encrypted-media/ |
44 */ | 44 */ |
45 struct PPP_ContentDecryptor_Private_0_12 { | 45 struct PPP_ContentDecryptor_Private_0_13 { |
46 /** | 46 /** |
47 * Initialize for the specified key system. | 47 * Initialize for the specified key system. |
48 * | 48 * |
49 * @param[in] key_system A <code>PP_Var</code> of type | 49 * @param[in] key_system A <code>PP_Var</code> of type |
50 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | 50 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
51 */ | 51 */ |
52 void (*Initialize)(PP_Instance instance, struct PP_Var key_system); | 52 void (*Initialize)(PP_Instance instance, struct PP_Var key_system); |
53 /** | 53 /** |
54 * Provides a server certificate to be used to encrypt messages to the | 54 * Provides a server certificate to be used to encrypt messages to the |
55 * license server. | 55 * license server. |
56 * | 56 * |
57 * @param[in] promise_id A reference for the promise that gets resolved or | 57 * @param[in] promise_id A reference for the promise that gets resolved or |
58 * rejected depending upon the success or failure of setting the certificate. | 58 * rejected depending upon the success or failure of setting the certificate. |
59 * | 59 * |
60 * @param[in] server_certificate A <code>PP_Var</code> of type | 60 * @param[in] server_certificate A <code>PP_Var</code> of type |
61 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the certificate to be used. | 61 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the certificate to be used. |
62 */ | 62 */ |
63 void (*SetServerCertificate)(PP_Instance instance, | 63 void (*SetServerCertificate)(PP_Instance instance, |
64 uint32_t promise_id, | 64 uint32_t promise_id, |
65 struct PP_Var server_certificate); | 65 struct PP_Var server_certificate); |
66 /** | 66 /** |
67 * Creates a session. <code>init_data_type</code> contains the MIME type of | 67 * Creates a session and subsequently generates a request for a license. |
| 68 * <code>init_data_type</code> contains the MIME type of |
68 * <code>init_data</code>. <code>init_data</code> is a data buffer | 69 * <code>init_data</code>. <code>init_data</code> is a data buffer |
69 * containing data for use in generating the request. | 70 * containing data for use in generating the request. |
70 * | 71 * |
71 * Note: <code>CreateSession()</code> must create a web session ID and provide | 72 * Note: <code>CreateSessionAndGenerateRequest()</code> must create a web |
72 * it to the browser via <code>SessionCreated()</code> on the | 73 * session ID and provide it to the browser via <code>SessionCreated()</code> |
73 * <code>PPB_ContentDecryptor_Private</code> interface. | 74 * on the <code>PPB_ContentDecryptor_Private</code> interface. |
74 * | 75 * |
75 * @param[in] promise_id A reference for the promise that gets resolved or | 76 * @param[in] promise_id A reference for the promise that gets resolved or |
76 * rejected depending upon the success or failure when creating the session. | 77 * rejected depending upon the success or failure when creating the session. |
77 * | 78 * |
| 79 * @param[in] session_type A <code>PP_SessionType</code> that indicates the |
| 80 * type of session to be created. |
| 81 * |
78 * @param[in] init_data_type A <code>PP_Var</code> of type | 82 * @param[in] init_data_type A <code>PP_Var</code> of type |
79 * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. | 83 * <code>PP_VARTYPE_STRING</code> containing the MIME type for init_data. |
80 * | 84 * |
81 * @param[in] init_data A <code>PP_Var</code> of type | 85 * @param[in] init_data A <code>PP_Var</code> of type |
82 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 86 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
83 * initialization data. | 87 * initialization data. |
84 * | |
85 * @param[in] session_type A <code>PP_SessionType</code> that indicates the | |
86 * type of session to be created. | |
87 */ | 88 */ |
88 void (*CreateSession)(PP_Instance instance, | 89 void (*CreateSessionAndGenerateRequest)(PP_Instance instance, |
89 uint32_t promise_id, | 90 uint32_t promise_id, |
90 struct PP_Var init_data_type, | 91 PP_SessionType session_type, |
91 struct PP_Var init_data, | 92 struct PP_Var init_data_type, |
92 PP_SessionType session_type); | 93 struct PP_Var init_data); |
93 /** | 94 /** |
94 * Loads a session whose web session ID is <code>web_session_id</code>. | 95 * Loads a session whose web session ID is <code>web_session_id</code>. |
95 * | 96 * |
96 * Note: After the session is successfully loaded, the CDM must call | 97 * Note: After the session is successfully loaded, the CDM must call |
97 * <code>SessionCreated()</code> with <code>web_session_id</code> on the | 98 * <code>SessionCreated()</code> with <code>web_session_id</code> on the |
98 * <code>PPB_ContentDecryptor_Private</code> interface. | 99 * <code>PPB_ContentDecryptor_Private</code> interface. |
99 * | 100 * |
100 * @param[in] promise_id A reference for the promise that gets resolved or | 101 * @param[in] promise_id A reference for the promise that gets resolved or |
101 * rejected depending upon the success or failure of loading the session. | 102 * rejected depending upon the success or failure of loading the session. |
102 * | 103 * |
| 104 * @param[in] session_type A <code>PP_SessionType</code> that indicates the |
| 105 * type of session to be loaded. |
| 106 * |
103 * @param[in] web_session_id A <code>PP_Var</code> of type | 107 * @param[in] web_session_id A <code>PP_Var</code> of type |
104 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session | 108 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session |
105 * to load. | 109 * to load. |
106 */ | 110 */ |
107 void (*LoadSession)(PP_Instance instance, | 111 void (*LoadSession)(PP_Instance instance, |
108 uint32_t promise_id, | 112 uint32_t promise_id, |
| 113 PP_SessionType session_type, |
109 struct PP_Var web_session_id); | 114 struct PP_Var web_session_id); |
110 /** | 115 /** |
111 * Provides a license or other message to the decryptor. | 116 * Provides a license or other message to the decryptor. |
112 * | 117 * |
113 * When the CDM needs more information, it must call | 118 * When the CDM needs more information, it must call |
114 * <code>SessionMessage()</code> on the | 119 * <code>SessionMessage()</code> on the |
115 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser | 120 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
116 * must notify the web application. When the CDM has finished processing | 121 * must notify the web application. When the CDM has finished processing |
117 * <code>response</code> and needs no more information, it must call | 122 * <code>response</code> and needs no more information, it must call |
118 * <code>SessionReady()</code> on the | 123 * <code>SessionReady()</code> on the |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 * | 162 * |
158 * @param[in] web_session_id A <code>PP_Var</code> of type | 163 * @param[in] web_session_id A <code>PP_Var</code> of type |
159 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session | 164 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session |
160 * to be removed. | 165 * to be removed. |
161 * | 166 * |
162 */ | 167 */ |
163 void (*RemoveSession)(PP_Instance instance, | 168 void (*RemoveSession)(PP_Instance instance, |
164 uint32_t promise_id, | 169 uint32_t promise_id, |
165 struct PP_Var web_session_id); | 170 struct PP_Var web_session_id); |
166 /** | 171 /** |
167 * Get the key IDs for keys in the session that the CDM knows are currently | |
168 * usable to decrypt media data. | |
169 * | |
170 * @param[in] promise_id A reference for the promise that gets resolved or | |
171 * rejected depending upon the success or failure of obtaining the key IDs. | |
172 * | |
173 * @param[in] web_session_id A <code>PP_Var</code> of type | |
174 * <code>PP_VARTYPE_STRING</code> containing the web session ID of the session | |
175 * to be queried. | |
176 * | |
177 */ | |
178 void (*GetUsableKeyIds)(PP_Instance instance, | |
179 uint32_t promise_id, | |
180 struct PP_Var web_session_id); | |
181 /** | |
182 * Decrypts the block and returns the unencrypted block via | 172 * Decrypts the block and returns the unencrypted block via |
183 * <code>DeliverBlock()</code> on the | 173 * <code>DeliverBlock()</code> on the |
184 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block | 174 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
185 * contains encoded data. | 175 * contains encoded data. |
186 * | 176 * |
187 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 177 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
188 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 178 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
189 * block. | 179 * block. |
190 * | 180 * |
191 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 181 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 * contains all auxiliary information needed for decryption of the | 287 * contains all auxiliary information needed for decryption of the |
298 * <code>encrypted_block</code>. | 288 * <code>encrypted_block</code>. |
299 */ | 289 */ |
300 void (*DecryptAndDecode)( | 290 void (*DecryptAndDecode)( |
301 PP_Instance instance, | 291 PP_Instance instance, |
302 PP_DecryptorStreamType decoder_type, | 292 PP_DecryptorStreamType decoder_type, |
303 PP_Resource encrypted_buffer, | 293 PP_Resource encrypted_buffer, |
304 const struct PP_EncryptedBlockInfo* encrypted_block_info); | 294 const struct PP_EncryptedBlockInfo* encrypted_block_info); |
305 }; | 295 }; |
306 | 296 |
307 typedef struct PPP_ContentDecryptor_Private_0_12 PPP_ContentDecryptor_Private; | 297 typedef struct PPP_ContentDecryptor_Private_0_13 PPP_ContentDecryptor_Private; |
308 /** | 298 /** |
309 * @} | 299 * @} |
310 */ | 300 */ |
311 | 301 |
312 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ | 302 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ |
313 | 303 |
OLD | NEW |