OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef PPAPI_C_DEV_PP_VIDEO_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PP_VIDEO_DEV_H_ |
6 #define PPAPI_C_DEV_PP_VIDEO_DEV_H_ | 6 #define PPAPI_C_DEV_PP_VIDEO_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_macros.h" | |
10 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
11 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
12 | 13 |
13 enum PP_VideoKey_Dev { | 14 enum PP_VideoKey_Dev { |
14 PP_VIDEOKEY_NONE = 0, | 15 PP_VIDEOKEY_NONE = 0, |
15 // Value is type of PP_VideoCodecId. | 16 // Value is type of PP_VideoCodecId. |
16 PP_VIDEOKEY_CODECID, | 17 PP_VIDEOKEY_CODECID, |
17 // Value is type of PP_VideoOperation. | 18 // Value is type of PP_VideoOperation. |
18 PP_VIDEOKEY_OPERATION, | 19 PP_VIDEOKEY_OPERATION, |
19 // Value is type of PP_VideoCodecProfile. | 20 // Value is type of PP_VideoCodecProfile. |
(...skipping 12 matching lines...) Expand all Loading... | |
32 PP_VIDEOKEY_FRAMEINFOFLAG, | 33 PP_VIDEOKEY_FRAMEINFOFLAG, |
33 | 34 |
34 // Subset for H.264 features, value of 1 means supported. This is needed in | 35 // Subset for H.264 features, value of 1 means supported. This is needed in |
35 // case decoder has partial support for certain profile. | 36 // case decoder has partial support for certain profile. |
36 PP_VIDEOKEY_H264FEATURE_FMO = 0x100, | 37 PP_VIDEOKEY_H264FEATURE_FMO = 0x100, |
37 PP_VIDEOKEY_H264FEATURE_ASO, | 38 PP_VIDEOKEY_H264FEATURE_ASO, |
38 PP_VIDEOKEY_H264FEATURE_INTERLACE, | 39 PP_VIDEOKEY_H264FEATURE_INTERLACE, |
39 PP_VIDEOKEY_H264FEATURE_CABAC, | 40 PP_VIDEOKEY_H264FEATURE_CABAC, |
40 PP_VIDEOKEY_H264FEATURE_WEIGHTEDPREDICTION | 41 PP_VIDEOKEY_H264FEATURE_WEIGHTEDPREDICTION |
41 }; | 42 }; |
43 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoKey_Dev, 4); | |
42 | 44 |
43 enum PP_VideoDecoderEvent_Dev { | 45 enum PP_VideoDecoderEvent_Dev { |
44 PP_VIDEODECODEREVENT_NONE = 0, | 46 PP_VIDEODECODEREVENT_NONE = 0, |
45 // Signaling that an error has been hit. | 47 // Signaling that an error has been hit. |
46 PP_VIDEODECODEREVENT_ERROR, | 48 PP_VIDEODECODEREVENT_ERROR, |
47 // Signaling new width/height of video frame | 49 // Signaling new width/height of video frame |
48 PP_VIDEODECODEREVENT_NEWDIMENSION, | 50 PP_VIDEODECODEREVENT_NEWDIMENSION, |
49 // Signaling new cropping rectangle | 51 // Signaling new cropping rectangle |
50 PP_VIDEODECODEREVENT_NEWCROP | 52 PP_VIDEODECODEREVENT_NEWCROP |
51 }; | 53 }; |
54 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecoderEvent_Dev, 4); | |
52 | 55 |
53 enum PP_VideoDecodeError_Dev { | 56 enum PP_VideoDecodeError_Dev { |
54 PP_VIDEODECODEERROR_NONE = 0, | 57 PP_VIDEODECODEERROR_NONE = 0, |
55 PP_VIDEODECODEERROR_NOTSUPPORTED, | 58 PP_VIDEODECODEERROR_NOTSUPPORTED, |
56 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES, | 59 PP_VIDEODECODEERROR_INSUFFICIENTRESOURCES, |
57 PP_VIDEODECODEERROR_UNDEFINED, | 60 PP_VIDEODECODEERROR_UNDEFINED, |
58 PP_VIDEODECODEERROR_BADINPUT, | 61 PP_VIDEODECODEERROR_BADINPUT, |
59 PP_VIDEODECODEERROR_HARDWARE | 62 PP_VIDEODECODEERROR_HARDWARE |
60 }; | 63 }; |
64 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoDecodeError_Dev, 4); | |
61 | 65 |
62 enum PP_VideoCodecId_Dev { | 66 enum PP_VideoCodecId_Dev { |
63 PP_VIDEODECODECID_NONE = 0, | 67 PP_VIDEODECODECID_NONE = 0, |
64 PP_VIDEODECODECID_H264, | 68 PP_VIDEODECODECID_H264, |
65 PP_VIDEODECODECID_VC1, | 69 PP_VIDEODECODECID_VC1, |
66 PP_VIDEODECODECID_MPEG2, | 70 PP_VIDEODECODECID_MPEG2, |
67 PP_VIDEODECODECID_VP8 | 71 PP_VIDEODECODECID_VP8 |
68 }; | 72 }; |
73 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoCodecId_Dev, 4); | |
69 | 74 |
70 enum PP_VideoOperation_Dev { | 75 enum PP_VideoOperation_Dev { |
71 PP_VIDEOOPERATION_NONE = 0, | 76 PP_VIDEOOPERATION_NONE = 0, |
72 PP_VIDEOOPERATION_DECODE, | 77 PP_VIDEOOPERATION_DECODE, |
73 PP_VIDEOOPERATION_ENCODE | 78 PP_VIDEOOPERATION_ENCODE |
74 }; | 79 }; |
80 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoOperation_Dev, 4); | |
75 | 81 |
76 enum PP_VideoCodecProfile_Dev { | 82 enum PP_VideoCodecProfile_Dev { |
77 PP_VIDEOCODECPROFILE_NONE = 0, | 83 PP_VIDEOCODECPROFILE_NONE = 0, |
78 PP_VIDEOCODECPROFILE_H264_BASELINE, | 84 PP_VIDEOCODECPROFILE_H264_BASELINE, |
79 PP_VIDEOCODECPROFILE_H264_MAIN, | 85 PP_VIDEOCODECPROFILE_H264_MAIN, |
80 PP_VIDEOCODECPROFILE_H264_EXTENDED, | 86 PP_VIDEOCODECPROFILE_H264_EXTENDED, |
81 PP_VIDEOCODECPROFILE_H264_HIGH, | 87 PP_VIDEOCODECPROFILE_H264_HIGH, |
82 PP_VIDEOCODECPROFILE_H264_SCALABLEBASELINE, | 88 PP_VIDEOCODECPROFILE_H264_SCALABLEBASELINE, |
83 PP_VIDEOCODECPROFILE_H264_SCALABLEHIGH, | 89 PP_VIDEOCODECPROFILE_H264_SCALABLEHIGH, |
84 PP_VIDEOCODECPROFILE_H264_STEREOHIGH, | 90 PP_VIDEOCODECPROFILE_H264_STEREOHIGH, |
85 PP_VIDEOCODECPROFILE_H264_MULTIVIEWHIGH, | 91 PP_VIDEOCODECPROFILE_H264_MULTIVIEWHIGH, |
86 | 92 |
87 PP_VIDEOCODECPROFILE_VC1_SIMPLE = 0x40, | 93 PP_VIDEOCODECPROFILE_VC1_SIMPLE = 0x40, |
88 PP_VIDEOCODECPROFILE_VC1_MAIN, | 94 PP_VIDEOCODECPROFILE_VC1_MAIN, |
89 PP_VIDEOCODECPROFILE_VC1_ADVANCED, | 95 PP_VIDEOCODECPROFILE_VC1_ADVANCED, |
90 | 96 |
91 PP_VIDEOCODECPROFILE_MPEG2_SIMPLE = 0x80, | 97 PP_VIDEOCODECPROFILE_MPEG2_SIMPLE = 0x80, |
92 PP_VIDEOCODECPROFILE_MPEG2_MAIN, | 98 PP_VIDEOCODECPROFILE_MPEG2_MAIN, |
93 PP_VIDEOCODECPROFILE_MPEG2_SNR, | 99 PP_VIDEOCODECPROFILE_MPEG2_SNR, |
94 PP_VIDEOCODECPROFILE_MPEG2_SPATIAL, | 100 PP_VIDEOCODECPROFILE_MPEG2_SPATIAL, |
95 PP_VIDEOCODECPROFILE_MPEG2_HIGH | 101 PP_VIDEOCODECPROFILE_MPEG2_HIGH |
96 }; | 102 }; |
103 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoCodecProfile_Dev, 4); | |
97 | 104 |
98 enum PP_VideoCodecLevel_Dev { | 105 enum PP_VideoCodecLevel_Dev { |
99 PP_VIDEOCODECLEVEL_NONE = 0, | 106 PP_VIDEOCODECLEVEL_NONE = 0, |
100 PP_VIDEOCODECLEVEL_H264_10, | 107 PP_VIDEOCODECLEVEL_H264_10, |
101 PP_VIDEOCODECLEVEL_H264_1B, | 108 PP_VIDEOCODECLEVEL_H264_1B, |
102 PP_VIDEOCODECLEVEL_H264_11, | 109 PP_VIDEOCODECLEVEL_H264_11, |
103 PP_VIDEOCODECLEVEL_H264_12, | 110 PP_VIDEOCODECLEVEL_H264_12, |
104 PP_VIDEOCODECLEVEL_H264_13, | 111 PP_VIDEOCODECLEVEL_H264_13, |
105 PP_VIDEOCODECLEVEL_H264_20, | 112 PP_VIDEOCODECLEVEL_H264_20, |
106 PP_VIDEOCODECLEVEL_H264_21, | 113 PP_VIDEOCODECLEVEL_H264_21, |
(...skipping 14 matching lines...) Expand all Loading... | |
121 PP_VIDEOCODECLEVEL_VC1_L1, | 128 PP_VIDEOCODECLEVEL_VC1_L1, |
122 PP_VIDEOCODECLEVEL_VC1_L2, | 129 PP_VIDEOCODECLEVEL_VC1_L2, |
123 PP_VIDEOCODECLEVEL_VC1_L3, | 130 PP_VIDEOCODECLEVEL_VC1_L3, |
124 PP_VIDEOCODECLEVEL_VC1_L4, | 131 PP_VIDEOCODECLEVEL_VC1_L4, |
125 | 132 |
126 PP_VIDEOCODECLEVEL_MPEG2_LOW = 0x80, | 133 PP_VIDEOCODECLEVEL_MPEG2_LOW = 0x80, |
127 PP_VIDEOCODECLEVEL_MPEG2_MAIN, | 134 PP_VIDEOCODECLEVEL_MPEG2_MAIN, |
128 PP_VIDEOCODECLEVEL_MPEG2_HIGH1440, | 135 PP_VIDEOCODECLEVEL_MPEG2_HIGH1440, |
129 PP_VIDEOCODECLEVEL_MPEG2_HIGH | 136 PP_VIDEOCODECLEVEL_MPEG2_HIGH |
130 }; | 137 }; |
138 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoCodecLevel_Dev, 4); | |
131 | 139 |
132 enum PP_VideoPayloadFormat_Dev { | 140 enum PP_VideoPayloadFormat_Dev { |
133 PP_VIDEOPAYLOADFORMAT_NONE = 0, | 141 PP_VIDEOPAYLOADFORMAT_NONE = 0, |
134 PP_VIDEOPAYLOADFORMAT_BYTESTREAM, | 142 PP_VIDEOPAYLOADFORMAT_BYTESTREAM, |
135 PP_VIDEOPAYLOADFORMAT_RTPPAYLOAD | 143 PP_VIDEOPAYLOADFORMAT_RTPPAYLOAD |
136 }; | 144 }; |
145 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoPayloadFormat_Dev, 4); | |
137 | 146 |
138 enum PP_VideoFrameColorType_Dev { | 147 enum PP_VideoFrameColorType_Dev { |
139 PP_VIDEOFRAMECOLORTYPE_NONE = 0, | 148 PP_VIDEOFRAMECOLORTYPE_NONE = 0, |
140 PP_VIDEOFRAMECOLORTYPE_RGB565, | 149 PP_VIDEOFRAMECOLORTYPE_RGB565, |
141 PP_VIDEOFRAMECOLORTYPE_ARGB8888, | 150 PP_VIDEOFRAMECOLORTYPE_ARGB8888, |
142 PP_VIDEOFRAMECOLORTYPE_YUV, | 151 PP_VIDEOFRAMECOLORTYPE_YUV, |
143 PP_VIDEOFRAMECOLORTYPE_Monochrome, | 152 PP_VIDEOFRAMECOLORTYPE_Monochrome, |
144 PP_VIDEOFRAMECOLORTYPE_YUV420PLANAR, | 153 PP_VIDEOFRAMECOLORTYPE_YUV420PLANAR, |
145 PP_VIDEOFRAMECOLORTYPE_YUV422PLANAR, | 154 PP_VIDEOFRAMECOLORTYPE_YUV422PLANAR, |
146 PP_VIDEOFRAMECOLORTYPE_YUV444PLANAR | 155 PP_VIDEOFRAMECOLORTYPE_YUV444PLANAR |
147 }; | 156 }; |
157 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoFrameColorType_Dev, 4); | |
148 | 158 |
149 enum PP_VideoFrameSurfaceType_Dev { | 159 enum PP_VideoFrameSurfaceType_Dev { |
150 PP_VIDEOFRAMESURFACETYPE_NONE = 0, | 160 PP_VIDEOFRAMESURFACETYPE_NONE = 0, |
151 PP_VIDEOFRAMESURFACETYPE_SYSTEMMEMORY, | 161 PP_VIDEOFRAMESURFACETYPE_SYSTEMMEMORY, |
152 PP_VIDEOFRAMESURFACETYPE_GLTEXTURE, | 162 PP_VIDEOFRAMESURFACETYPE_GLTEXTURE, |
153 PP_VIDEOFRAMESURFACETYPE_PIXMAP | 163 PP_VIDEOFRAMESURFACETYPE_PIXMAP |
154 }; | 164 }; |
165 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoFrameSurfaceType_Dev, 4); | |
155 | 166 |
156 enum PP_VideoFrameInfoFlag_Dev { | 167 enum PP_VideoFrameInfoFlag_Dev { |
157 PP_VIDEOFRAMEINFOFLAG_NONE = 0, | 168 PP_VIDEOFRAMEINFOFLAG_NONE = 0, |
158 // Indicate this is the end of stream. Used by both plugin and browser. | 169 // Indicate this is the end of stream. Used by both plugin and browser. |
159 PP_VIDEOFRAMEINFOFLAG_EOS = 1 << 0, | 170 PP_VIDEOFRAMEINFOFLAG_EOS = 1 << 0, |
160 // Decode the frame only, don't return decoded frame. Used by plugin. | 171 // Decode the frame only, don't return decoded frame. Used by plugin. |
161 PP_VIDEOFRAMEINFOFLAG_NOEMIT = 1 << 1, | 172 PP_VIDEOFRAMEINFOFLAG_NOEMIT = 1 << 1, |
162 // Indicate this is an anchor frame. Used by plugin. | 173 // Indicate this is an anchor frame. Used by plugin. |
163 PP_VIDEOFRAMEINFOFLAG_SYNCFRAME = 1 << 2, | 174 PP_VIDEOFRAMEINFOFLAG_SYNCFRAME = 1 << 2, |
164 // Indicate the decoded frame has data corruption. Used by browser. | 175 // Indicate the decoded frame has data corruption. Used by browser. |
165 PP_VIDEOFRAMEINFOFLAG_DATACORRUPT = 1 << 3 | 176 PP_VIDEOFRAMEINFOFLAG_DATACORRUPT = 1 << 3 |
166 }; | 177 }; |
178 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoFrameInfoFlag_Dev, 4); | |
167 | 179 |
168 enum PP_VideoFrameBufferConst_Dev { | 180 enum PP_VideoFrameBufferConst_Dev { |
169 // YUV formats | 181 // YUV formats |
170 PP_VIDEOFRAMEBUFFER_YPLANE = 0, | 182 PP_VIDEOFRAMEBUFFER_YPLANE = 0, |
171 PP_VIDEOFRAMEBUFFER_UPLANE = 1, | 183 PP_VIDEOFRAMEBUFFER_UPLANE = 1, |
172 PP_VIDEOFRAMEBUFFER_VPLANE = 2, | 184 PP_VIDEOFRAMEBUFFER_VPLANE = 2, |
173 PP_VIDEOFRAMEBUFFER_NUMBERYUVPLANES = 3, | 185 PP_VIDEOFRAMEBUFFER_NUMBERYUVPLANES = 3, |
174 | 186 |
175 // RGBA formats | 187 // RGBA formats |
176 PP_VIDEOFRAMEBUFFER_RGBAPLANE = 0, | 188 PP_VIDEOFRAMEBUFFER_RGBAPLANE = 0, |
177 PP_VIDEOFRAMEBUFFER_NUMBERRGBAPLANES = 1, | 189 PP_VIDEOFRAMEBUFFER_NUMBERRGBAPLANES = 1, |
178 | 190 |
179 PP_VIDEOFRAMEBUFFER_MAXNUMBERPLANES = 4 | 191 PP_VIDEOFRAMEBUFFER_MAXNUMBERPLANES = 4 |
180 }; | 192 }; |
193 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_VideoFrameBufferConst_Dev, 4); | |
181 | 194 |
182 typedef int64_t PP_VideoDecodeData_Dev; | 195 typedef int64_t PP_VideoDecodeData_Dev; |
196 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoDecodeData_Dev, 8); | |
183 | 197 |
184 // Array of key/value pairs describing video configuration. | 198 // Array of key/value pairs describing video configuration. |
185 // It could include any keys from PP_VideoKey. Its last element shall be | 199 // It could include any keys from PP_VideoKey. Its last element shall be |
186 // PP_VIDEOKEY_NONE with no corresponding value. | 200 // PP_VIDEOKEY_NONE with no corresponding value. |
187 // An example: | 201 // An example: |
188 // { | 202 // { |
189 // PP_VIDEOKEY_CODECID, PP_VIDEODECODECID_H264, | 203 // PP_VIDEOKEY_CODECID, PP_VIDEODECODECID_H264, |
190 // PP_VIDEOKEY_OPERATION, PP_VIDEOOPERATION_DECODE, | 204 // PP_VIDEOKEY_OPERATION, PP_VIDEOOPERATION_DECODE, |
191 // PP_VIDEOKEY_CODECPROFILE, PP_VIDEOCODECPROFILE_H264_HIGH, | 205 // PP_VIDEOKEY_CODECPROFILE, PP_VIDEOCODECPROFILE_H264_HIGH, |
192 // PP_VIDEOKEY_CODECLEVEL, PP_VIDEOCODECLEVEL_H264_41, | 206 // PP_VIDEOKEY_CODECLEVEL, PP_VIDEOCODECLEVEL_H264_41, |
193 // PP_VIDEOKEY_ACCELERATION, 1 | 207 // PP_VIDEOKEY_ACCELERATION, 1 |
194 // PP_VIDEOKEY_NONE, | 208 // PP_VIDEOKEY_NONE, |
195 // }; | 209 // }; |
196 typedef int32_t* PP_VideoConfig_Dev; | 210 typedef int32_t* PP_VideoConfig_Dev; |
197 typedef int32_t PP_VideoConfigElement_Dev; | 211 typedef int32_t PP_VideoConfigElement_Dev; |
212 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VideoConfigElement_Dev, 4); | |
198 | 213 |
199 // The data structure for compressed data buffer. | 214 // The data structure for compressed data buffer. |
200 struct PP_VideoCompressedDataBuffer_Dev { | 215 struct PP_VideoCompressedDataBuffer_Dev { |
201 // The buffer is created through PPB_Buffer API. | 216 // The buffer is created through PPB_Buffer API. |
202 // TODO(wjia): would uint8_t* be good, too? | 217 // TODO(wjia): would uint8_t* be good, too? |
203 PP_Resource buffer; | 218 PP_Resource buffer; |
219 | |
204 // number of bytes with real data in the buffer. | 220 // number of bytes with real data in the buffer. |
205 int32_t filled_size; | 221 int32_t filled_size; |
206 | 222 |
223 // Bit mask of PP_VideoFrameInfoFlag. | |
224 uint32_t flags; | |
225 | |
207 // Time stamp of the frame in microsecond. | 226 // Time stamp of the frame in microsecond. |
208 uint64_t time_stamp_us; | 227 uint64_t time_stamp_us; |
209 | |
210 // Bit mask of PP_VideoFrameInfoFlag. | |
211 uint32_t flags; | |
212 }; | 228 }; |
229 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_VideoCompressedDataBuffer_Dev, 24); | |
213 | 230 |
214 struct PP_VideoFrameBuffer_Dev { | 231 struct PP_VideoFrameBuffer_Dev { |
215 union { | 232 union { |
216 struct { | 233 struct { |
217 int32_t planes; | |
218 struct { | 234 struct { |
219 int32_t width; | 235 int32_t width; |
220 int32_t height; | 236 int32_t height; |
221 int32_t stride; | 237 int32_t stride; |
222 | 238 |
239 // Padding to ensure the PP_Resource is 8-byte aligned relative to the | |
240 // start of the struct. This helps ensure PP_VideoFrameBuffer_Dev has | |
241 // consistent size and alignment across compilers. | |
242 int32_t padding; | |
243 | |
223 // TODO(wjia): uint8* would be better for some cases. | 244 // TODO(wjia): uint8* would be better for some cases. |
224 PP_Resource buffer; | 245 PP_Resource buffer; |
225 } data_plane[PP_VIDEOFRAMEBUFFER_MAXNUMBERPLANES]; | 246 } data_plane[PP_VIDEOFRAMEBUFFER_MAXNUMBERPLANES]; |
247 | |
248 int32_t planes; | |
249 | |
250 // This padding makes sure the sys_mem struct's size is a multiple of 8 | |
251 // bytes, ensuring that handle is always 8-byte aligned relative to the | |
252 // start of the PP_VideoFrameBuffer_Dev struct. | |
253 int32_t padding; | |
226 } sys_mem; | 254 } sys_mem; |
227 | 255 |
228 // Handle for pixmap, gl texture, etc. | 256 // Handle for pixmap, gl texture, etc. |
229 void* handle; | 257 void* handle; |
230 } buffer; | 258 } buffer; |
231 | 259 |
232 // Storage for decoder to save some private data. It could be useful when | 260 // Storage for decoder to save some private data. It could be useful when |
233 // plugin returns frame buffer to decoder. | 261 // plugin returns frame buffer to decoder. |
234 void* private_handle; | 262 void* private_handle; |
263 | |
264 // In some 32-bit platforms (NaCl and Win32), this struct is 8-byte aligned | |
darin (slow to review)
2010/12/13 08:24:57
Is this comment out-dated now that PP_Resource has
| |
265 // due to the PP_Resource above. That causes the compiler to pad it an extra | |
266 // 4 bytes on the end. In other 32-bit platforms, there is no such pad. This | |
267 // padding ensures that the size is consistent on 32-bit platforms (and it | |
268 // is still consistent on 64-bit platforms, just bigger than it would be | |
269 // without the padding). | |
270 int32_t padding; | |
235 }; | 271 }; |
236 | 272 |
237 struct PP_VideoUncompressedDataBuffer_Dev { | 273 struct PP_VideoUncompressedDataBuffer_Dev { |
238 PP_VideoConfig_Dev format; | 274 PP_VideoConfig_Dev format; |
239 struct PP_VideoFrameBuffer_Dev buffer; | 275 |
276 // Bit mask of PP_VideoFrameInfoFlag. | |
277 uint32_t flags; | |
240 | 278 |
241 // Time stamp of the frame in microsecond. | 279 // Time stamp of the frame in microsecond. |
242 uint64_t time_stamp_us; | 280 uint64_t time_stamp_us; |
243 | 281 |
244 // Bit mask of PP_VideoFrameInfoFlag. | 282 struct PP_VideoFrameBuffer_Dev buffer; |
245 uint32_t flags; | |
246 | 283 |
247 // Output from decoder, indicating the decoded frame has error pixels. This | 284 // Output from decoder, indicating the decoded frame has error pixels. This |
248 // could be resulted from corrupted input bit stream and error concealment | 285 // could be resulted from corrupted input bit stream and error concealment |
249 // in decoding. PP_TRUE indicates error. | 286 // in decoding. PP_TRUE indicates error. |
250 // TODO(wjia): add more info about error pixels, such as error MB map, etc. | 287 // TODO(wjia): add more info about error pixels, such as error MB map, etc. |
251 PP_Bool error; | 288 PP_Bool error; |
289 | |
290 // In some 32-bit platforms (NaCl and Win32), this struct is 8-byte aligned | |
291 // due to the uint64_t and buffer above. That causes the compiler to pad it | |
292 // an extra 4 bytes on the end. In other 32-bit platforms, there is no such | |
293 // pad. This padding ensures that the size is consistent on 32-bit platforms | |
294 // (and it is still consistent on 64-bit platforms, just bigger than it would | |
295 // be without the padding). | |
296 int32_t padding; | |
252 }; | 297 }; |
253 | 298 |
254 // Plugin callback for decoder to deliver decoded frame buffers. | 299 // Plugin callback for decoder to deliver decoded frame buffers. |
255 // |format| in |buffer| specifies the format of decoded frame, with | 300 // |format| in |buffer| specifies the format of decoded frame, with |
256 // PP_VIDEOKEY_COLORTYPE and PP_VIDEOKEY_SURFACETYPE required. | 301 // PP_VIDEOKEY_COLORTYPE and PP_VIDEOKEY_SURFACETYPE required. |
257 typedef void (*PP_VideoDecodeOutputCallback_Func_Dev)( | 302 typedef void (*PP_VideoDecodeOutputCallback_Func_Dev)( |
258 PP_Instance instance, | 303 PP_Instance instance, |
259 struct PP_VideoUncompressedDataBuffer_Dev* buffer); | 304 struct PP_VideoUncompressedDataBuffer_Dev* buffer); |
260 | 305 |
261 // Plugin callback for decoder to return input data buffers. | 306 // Plugin callback for decoder to return input data buffers. |
(...skipping 20 matching lines...) Expand all Loading... | |
282 // Requested decoder configuration and callback from plugin. | 327 // Requested decoder configuration and callback from plugin. |
283 struct PP_VideoDecoderConfig_Dev { | 328 struct PP_VideoDecoderConfig_Dev { |
284 PP_VideoConfig_Dev input_format; | 329 PP_VideoConfig_Dev input_format; |
285 PP_VideoConfig_Dev output_format; | 330 PP_VideoConfig_Dev output_format; |
286 PP_VideoDecodeOutputCallback_Func_Dev output_callback; | 331 PP_VideoDecodeOutputCallback_Func_Dev output_callback; |
287 PP_VideoDecodeInputCallback_Func_Dev input_callback; | 332 PP_VideoDecodeInputCallback_Func_Dev input_callback; |
288 PP_VideoDecodeEventHandler_Func_Dev event_handler; | 333 PP_VideoDecodeEventHandler_Func_Dev event_handler; |
289 }; | 334 }; |
290 | 335 |
291 #endif // PPAPI_C_DEV_PP_VIDEO_DEV_H_ | 336 #endif // PPAPI_C_DEV_PP_VIDEO_DEV_H_ |
OLD | NEW |