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

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: 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 Tue Oct 09 22:37:49 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 make sure |encryption_info| starts on an 8-byte
160 * boundary. The value of this field should not be used.
171 */ 161 */
172 PP_VideoCodec codec; 162 uint32_t padding;
173 /** 163 /**
174 * Video frame width in pixels. 164 * 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 */ 165 */
184 struct PP_EncryptedBlockInfo encryption_info; 166 struct PP_EncryptedBlockInfo encryption_info;
185 }; 167 };
186 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedVideoFrameInfo, 256); 168 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_EncryptedMediaInfo, 248);
187 /** 169 /**
188 * @} 170 * @}
189 */ 171 */
190 172
191 /** 173 /**
192 * @addtogroup Enums 174 * @addtogroup Enums
193 * @{ 175 * @{
194 */ 176 */
195 /** 177 /**
178 * <code>PP_DecryptedFrameFormat</code> contains video frame formats.
179 */
180 typedef enum {
181 PP_DECRYPTEDFRAMEFORMAT_UNKNOWN = 0,
182 PP_DECRYPTEDFRAMEFORMAT_EMPTY = 1,
183 PP_DECRYPTEDFRAMEFORMAT_YV12 = 2,
184 PP_DECRYPTEDFRAMEFORMAT_I420 = 3
185 } PP_DecryptedFrameFormat;
186 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_DecryptedFrameFormat, 4);
187
188 /**
189 * <code>PP_VideoCodec</code> contains video codec type constants.
190 */
191 typedef enum {
192 PP_VIDEOCODEC_UNKNOWN = 0,
193 PP_VIDEOCODEC_VP8 = 1
194 } PP_VideoCodec;
195 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoCodec, 4);
196
197 /**
196 * The <code>PP_DecryptResult</code> enum contains decryption and decoding 198 * The <code>PP_DecryptResult</code> enum contains decryption and decoding
197 * result constants. 199 * result constants.
198 */ 200 */
199 typedef enum { 201 typedef enum {
200 /** The decryption (and/or decoding) operation finished successfully. */ 202 /** The decryption (and/or decoding) operation finished successfully. */
201 PP_DECRYPTRESULT_SUCCESS = 0, 203 PP_DECRYPTRESULT_SUCCESS = 0,
202 /** The decryptor did not have the necessary decryption key. */ 204 /** The decryptor did not have the necessary decryption key. */
203 PP_DECRYPTRESULT_DECRYPT_NOKEY = 1, 205 PP_DECRYPTRESULT_DECRYPT_NOKEY = 1,
204 /** An unexpected error happened during decryption. */ 206 /** An unexpected error happened during decryption. */
205 PP_DECRYPTRESULT_DECRYPT_ERROR = 2, 207 PP_DECRYPTRESULT_DECRYPT_ERROR = 2,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 */ 299 */
298 struct PP_DecryptTrackingInfo tracking_info; 300 struct PP_DecryptTrackingInfo tracking_info;
299 }; 301 };
300 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedFrameInfo, 56); 302 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_DecryptedFrameInfo, 56);
301 /** 303 /**
302 * @} 304 * @}
303 */ 305 */
304 306
305 #endif /* PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ */ 307 #endif /* PPAPI_C_PRIVATE_PP_CONTENT_DECRYPTOR_H_ */
306 308
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698