Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: ppapi/c/private/pp_content_decryptor.h

Issue 11087044: Generalize Pepper CDM API decrypt and decode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Partially address comments Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/pp_content_decryptor.idl modified Wed Oct 3 16:16:49 2012. */ 6 /* From private/pp_content_decryptor.idl modified Wed Oct 10 01:11:02 2012. */
7 7
8 #ifndef PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ 8 #ifndef PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_
9 #define PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ 9 #define PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_
10 10
11 #include "ppapi/c/pp_macros.h" 11 #include "ppapi/c/pp_macros.h"
12 #include "ppapi/c/pp_stdint.h" 12 #include "ppapi/c/pp_stdint.h"
13 13
14 /** 14 /**
15 * @file 15 * @file
16 * The <code>PP_DecryptTrackingInfo</code> struct contains necessary information 16 * The <code>PP_DecryptTrackingInfo</code> struct contains necessary information
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedBlockInfo, 240); 122 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedBlockInfo, 240);
123 /** 123 /**
124 * @} 124 * @}
125 */ 125 */
126 126
127 /** 127 /**
128 * @addtogroup Enums 128 * @addtogroup Enums
129 * @{ 129 * @{
130 */ 130 */
131 /** 131 /**
132 * <code>PP_DecryptedFrameFormat</code> contains video frame formats. 132 * <code>PP_StreamType</code> contains stream type constants.
133 */ 133 */
134 typedef enum { 134 typedef enum {
135 PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0, 135 PP_STREAMTYPE_UNKNOWN = 0,
136 PP_DECRYPTEDFRAMEFORMAT_EMPTY = 1, 136 PP_STREAMTYPE_AUDIO = 1,
137 PP_DECRYPTEDFRAMEFORMAT_YV12 = 2, 137 PP_STREAMTYPE_VIDEO = 2
138 PP_DECRYPTEDFRAMEFORMAT_I420 = 3 138 } PP_StreamType;
139 } PP_DecryptedFrameFormat; 139 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_StreamType, 4);
140 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedFrameFormat, 4);
141
142 /**
143 * <code>PP_VideoCodec</code> contains video codec type constants.
144 */
145 typedef enum {
146 PP_VIDEOCODEC_UNKNOWN = 0,
147 PP_VIDEOCODEC_VP8 = 1
148 } PP_VideoCodec;
149 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoCodec, 4);
150 /** 140 /**
151 * @} 141 * @}
152 */ 142 */
153 143
154 /** 144 /**
155 * @addtogroup Structs 145 * @addtogroup Structs
156 * @{ 146 * @{
157 */ 147 */
158 /** 148 /**
159 * <code>PP_EncryptedVideoFrameInfo</code> contains the information required 149 * <code>PP_EncryptedMediaInfo</code> contains the information required to
160 * to decrypt and decode a video frame. 150 * decrypt and decode media data.
161 * TODO(tomfinegan): Revisit necessity of including format information in this
162 * struct once we decide how to implement video decoder initialization.
163 */ 151 */
164 struct PP_EncryptedVideoFrameInfo { 152 struct PP_EncryptedMediaInfo {
165 /** 153 /**
166 * The decoded video frame format. 154 * Media type of the encrypted data.
167 */ 155 */
168 PP_DecryptedFrameFormat format; 156 PP_StreamType media_type;
169 /** 157 /**
170 * The video frame codec type. 158 * 4-byte padding to make the size of <code>PP_EncryptedMediaInfo</code>
159 * a multiple of 8 bytes, and ensure consistent size on all targets.
171 */ 160 */
172 PP_VideoCodec codec; 161 uint32_t padding;
173 /** 162 /**
174 * Video frame width in pixels. 163 * Information required to decrypt the media.
175 */
176 int32_t width;
177 /**
178 * Video frame height in pixels.
179 */
180 int32_t height;
181 /**
182 * Information required to decrypt the frame.
183 */ 164 */
184 struct PP_EncryptedBlockInfo encryption_info; 165 struct PP_EncryptedBlockInfo encryption_info;
185 }; 166 };
186 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedVideoFrameInfo, 256); 167 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedMediaInfo, 248);
187 /** 168 /**
188 * @} 169 * @}
189 */ 170 */
190 171
191 /** 172 /**
192 * @addtogroup Enums 173 * @addtogroup Enums
193 * @{ 174 * @{
194 */ 175 */
195 /** 176 /**
177 * <code>PP_DecryptedFrameFormat</code> contains video frame formats.
178 */
179 typedef enum {
180 PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0,
181 PP_DECRYPTEDFRAMEFORMAT_EMPTY = 1,
182 PP_DECRYPTEDFRAMEFORMAT_YV12 = 2,
183 PP_DECRYPTEDFRAMEFORMAT_I420 = 3
184 } PP_DecryptedFrameFormat;
185 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedFrameFormat, 4);
186
187 /**
188 * <code>PP_VideoCodec</code> contains video codec type constants.
189 */
190 typedef enum {
191 PP_VIDEOCODEC_UNKNOWN = 0,
192 PP_VIDEOCODEC_VP8 = 1
193 } PP_VideoCodec;
194 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoCodec, 4);
195
196 /**
196 * The <code>PP_DecryptResult</code> enum contains decryption and decoding 197 * The <code>PP_DecryptResult</code> enum contains decryption and decoding
197 * result constants. 198 * result constants.
198 */ 199 */
199 typedef enum { 200 typedef enum {
200 /** The decryption (and/or decoding) operation finished successfully. */ 201 /** The decryption (and/or decoding) operation finished successfully. */
201 PP_DECRYPTRESULT_SUCCESS = 0, 202 PP_DECRYPTRESULT_SUCCESS = 0,
202 /** The decryptor did not have the necessary decryption key. */ 203 /** The decryptor did not have the necessary decryption key. */
203 PP_DECRYPTRESULT_DECRYPT_NOKEY = 1, 204 PP_DECRYPTRESULT_DECRYPT_NOKEY = 1,
204 /** An unexpected error happened during decryption. */ 205 /** An unexpected error happened during decryption. */
205 PP_DECRYPTRESULT_DECRYPT_ERROR = 2, 206 PP_DECRYPTRESULT_DECRYPT_ERROR = 2,
(...skipping 13 matching lines...) Expand all
219 * <code>PP_DecryptedBlockInfo</code> struct contains the decryption result and 220 * <code>PP_DecryptedBlockInfo</code> struct contains the decryption result and
220 * tracking info associated with the decrypted block. 221 * tracking info associated with the decrypted block.
221 */ 222 */
222 struct PP_DecryptedBlockInfo { 223 struct PP_DecryptedBlockInfo {
223 /** 224 /**
224 * Result of the decryption (and/or decoding) operation. 225 * Result of the decryption (and/or decoding) operation.
225 */ 226 */
226 PP_DecryptResult result; 227 PP_DecryptResult result;
227 /** 228 /**
228 * 4-byte padding to make the size of <code>PP_DecryptedBlockInfo</code> 229 * 4-byte padding to make the size of <code>PP_DecryptedBlockInfo</code>
229 * a multiple of 8 bytes and make sure |tracking_info| starts on an 8-byte 230 * a multiple of 8 bytes, and ensure consistent size on all targets.
230 * boundary. The value of this field should not be used.
231 */ 231 */
232 uint32_t padding; 232 uint32_t padding;
233 /** 233 /**
234 * Information needed by the client to track the block to be decrypted. 234 * Information needed by the client to track the block to be decrypted.
235 */ 235 */
236 struct PP_DecryptTrackingInfo tracking_info; 236 struct PP_DecryptTrackingInfo tracking_info;
237 }; 237 };
238 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedBlockInfo, 24); 238 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedBlockInfo, 24);
239 /** 239 /**
240 * @} 240 * @}
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 */ 297 */
298 struct PP_DecryptTrackingInfo tracking_info; 298 struct PP_DecryptTrackingInfo tracking_info;
299 }; 299 };
300 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedFrameInfo, 56); 300 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedFrameInfo, 56);
301 /** 301 /**
302 * @} 302 * @}
303 */ 303 */
304 304
305 #endif /* PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ */ 305 #endif /* PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ */
306 306
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698