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 Tue Aug 28 09:32:44 2012. | 7 * modified Mon Sep 10 20:05:13 2012. |
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" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 * other methods on this interface. The session ID must be provided to the | 52 * other methods on this interface. The session ID must be provided to the |
53 * browser by the CDM via <code>KeyMessage()</code> on the | 53 * browser by the CDM via <code>KeyMessage()</code> on the |
54 * <code>PPB_ContentDecryptor_Private</code> interface. | 54 * <code>PPB_ContentDecryptor_Private</code> interface. |
55 * | 55 * |
56 * @param[in] key_system A <code>PP_Var</code> of type | 56 * @param[in] key_system A <code>PP_Var</code> of type |
57 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. | 57 * <code>PP_VARTYPE_STRING</code> containing the name of the key system. |
58 * | 58 * |
59 * @param[in] init_data A <code>PP_Var</code> of type | 59 * @param[in] init_data A <code>PP_Var</code> of type |
60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 60 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
61 * initialization data. | 61 * initialization data. |
62 * | |
63 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
64 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
65 * CDM, the call result/status should be reported through the | |
66 * <code>PPB_ContentDecryptor_Private</code> interface. | |
67 */ | 62 */ |
68 PP_Bool (*GenerateKeyRequest)(PP_Instance instance, | 63 void (*GenerateKeyRequest)(PP_Instance instance, |
69 struct PP_Var key_system, | 64 struct PP_Var key_system, |
70 struct PP_Var init_data); | 65 struct PP_Var init_data); |
71 /** | 66 /** |
72 * Provides a key or license to the decryptor for decrypting media data. | 67 * Provides a key or license to the decryptor for decrypting media data. |
73 * | 68 * |
74 * When the CDM needs more information to complete addition of the key it | 69 * When the CDM needs more information to complete addition of the key it |
75 * will call <code>KeyMessage()</code> on the | 70 * will call <code>KeyMessage()</code> on the |
76 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser | 71 * <code>PPB_ContentDecryptor_Private</code> interface, which the browser |
77 * passes to the application. When the key is ready to use, the CDM | 72 * passes to the application. When the key is ready to use, the CDM |
78 * must call call <code>KeyAdded()</code> on the | 73 * must call call <code>KeyAdded()</code> on the |
79 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser | 74 * <code>PPB_ContentDecryptor_Private</code> interface, and the browser |
80 * must notify the web application. | 75 * must notify the web application. |
81 * | 76 * |
82 * @param[in] session_id A <code>PP_Var</code> of type | 77 * @param[in] session_id A <code>PP_Var</code> of type |
83 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 78 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
84 * | 79 * |
85 * @param[in] key A <code>PP_Var</code> of type | 80 * @param[in] key A <code>PP_Var</code> of type |
86 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, | 81 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing the decryption key, license, |
87 * or other message for the given session ID. | 82 * or other message for the given session ID. |
88 * | 83 * |
89 * @param[in] init_data A <code>PP_Var</code> of type | 84 * @param[in] init_data A <code>PP_Var</code> of type |
90 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific | 85 * <code>PP_VARTYPE_ARRAYBUFFER</code> containing container specific |
91 * initialization data. | 86 * initialization data. |
92 * | |
93 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
94 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
95 * CDM, the call result/status should be reported through the | |
96 * <code>PPB_ContentDecryptor_Private</code> interface. | |
97 */ | 87 */ |
98 PP_Bool (*AddKey)(PP_Instance instance, | 88 void (*AddKey)(PP_Instance instance, |
99 struct PP_Var session_id, | 89 struct PP_Var session_id, |
100 struct PP_Var key, | 90 struct PP_Var key, |
101 struct PP_Var init_data); | 91 struct PP_Var init_data); |
102 /** | 92 /** |
103 * Cancels a pending key request for the specified session ID. | 93 * Cancels a pending key request for the specified session ID. |
104 * | 94 * |
105 * @param[in] session_id A <code>PP_Var</code> of type | 95 * @param[in] session_id A <code>PP_Var</code> of type |
106 * <code>PP_VARTYPE_STRING</code> containing the session ID. | 96 * <code>PP_VARTYPE_STRING</code> containing the session ID. |
107 * | |
108 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
109 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
110 * CDM, the call result/status should be reported through the | |
111 * <code>PPB_ContentDecryptor_Private</code> interface. | |
112 */ | 97 */ |
113 PP_Bool (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); | 98 void (*CancelKeyRequest)(PP_Instance instance, struct PP_Var session_id); |
114 /** | 99 /** |
115 * Decrypts the block and returns the unencrypted block via | 100 * Decrypts the block and returns the unencrypted block via |
116 * <code>DeliverBlock()</code> on the | 101 * <code>DeliverBlock()</code> on the |
117 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block | 102 * <code>PPB_ContentDecryptor_Private</code> interface. The returned block |
118 * contains encoded data. | 103 * contains encoded data. |
119 * | 104 * |
120 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 105 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
121 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 106 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
122 * block. | 107 * block. |
123 * | 108 * |
124 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 109 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
125 * contains all auxiliary information needed for decryption of the | 110 * contains all auxiliary information needed for decryption of the |
126 * <code>encrypted_block</code>. | 111 * <code>encrypted_block</code>. |
127 * | |
128 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
129 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
130 * CDM, the call result/status should be reported through the | |
131 * <code>PPB_ContentDecryptor_Private</code> interface. | |
132 */ | 112 */ |
133 PP_Bool (*Decrypt)( | 113 void (*Decrypt)(PP_Instance instance, |
134 PP_Instance instance, | 114 PP_Resource encrypted_block, |
135 PP_Resource encrypted_block, | 115 const struct PP_EncryptedBlockInfo* encrypted_block_info); |
136 const struct PP_EncryptedBlockInfo* encrypted_block_info); | |
137 /** | 116 /** |
138 * Decrypts the block, decodes it, and returns the unencrypted uncompressed | 117 * Decrypts the block, decodes it, and returns the unencrypted uncompressed |
139 * (decoded) media to the browser via the | 118 * (decoded) media to the browser via the |
140 * <code>PPB_ContentDecryptor_Private</code> interface. | 119 * <code>PPB_ContentDecryptor_Private</code> interface. |
141 * | 120 * |
142 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, | 121 * Decrypted and decoded video frames are sent to <code>DeliverFrame()</code>, |
143 * and decrypted and decoded audio samples are sent to | 122 * and decrypted and decoded audio samples are sent to |
144 * <code>DeliverSamples()</code>. | 123 * <code>DeliverSamples()</code>. |
145 * | 124 * |
146 * @param[in] resource A <code>PP_Resource</code> corresponding to a | 125 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
147 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data | 126 * <code>PPB_Buffer_Dev</code> resource that contains an encrypted data |
148 * block. | 127 * block. |
149 * | 128 * |
150 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that | 129 * @param[in] encrypted_block_info A <code>PP_EncryptedBlockInfo</code> that |
151 * contains all auxiliary information needed for decryption of the | 130 * contains all auxiliary information needed for decryption of the |
152 * <code>encrypted_block</code>. | 131 * <code>encrypted_block</code>. |
153 * | |
154 * @return <code>PP_TRUE</code> if this call was forwarded to the CDM | |
155 * successfully, <code>PP_FALSE</code> otherwise. Once the call reaches the | |
156 * CDM, the call result/status should be reported through the | |
157 * <code>PPB_ContentDecryptor_Private</code> interface. | |
158 */ | 132 */ |
159 PP_Bool (*DecryptAndDecode)( | 133 void (*DecryptAndDecode)( |
160 PP_Instance instance, | 134 PP_Instance instance, |
161 PP_Resource encrypted_block, | 135 PP_Resource encrypted_block, |
162 const struct PP_EncryptedBlockInfo* encrypted_block_info); | 136 const struct PP_EncryptedBlockInfo* encrypted_block_info); |
163 }; | 137 }; |
164 | 138 |
165 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private; | 139 typedef struct PPP_ContentDecryptor_Private_0_1 PPP_ContentDecryptor_Private; |
166 /** | 140 /** |
167 * @} | 141 * @} |
168 */ | 142 */ |
169 | 143 |
170 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ | 144 #endif /* PPAPI_C_PRIVATE_PPP_CONTENT_DECRYPTOR_PRIVATE_H_ */ |
171 | 145 |
OLD | NEW |