2adf387ffa38589ec9fe0f4257e02788b9973b06
[platform/upstream/gstreamer.git] / gst-libs / gst / video / video.h
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  * Library       <2002> Ronald Bultje <rbultje@ronald.bitfreak.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GST_VIDEO_H__
22 #define __GST_VIDEO_H__
23
24 #include <gst/gst.h>
25
26 G_BEGIN_DECLS
27
28 #include <gst/video/video-enumtypes.h>
29
30 /**
31  * GstVideoFormat:
32  * @GST_VIDEO_FORMAT_UNKNOWN: Unknown or unset video format id
33  * @GST_VIDEO_FORMAT_I420: planar 4:2:0 YUV
34  * @GST_VIDEO_FORMAT_YV12: planar 4:2:0 YVU (like I420 but UV planes swapped)
35  * @GST_VIDEO_FORMAT_YUY2: packed 4:2:2 YUV (Y0-U0-Y1-V0 Y2-U2-Y3-V2 Y4 ...)
36  * @GST_VIDEO_FORMAT_UYVY: packed 4:2:2 YUV (U0-Y0-V0-Y1 U2-Y2-V2-Y3 U4 ...) 
37  * @GST_VIDEO_FORMAT_AYUV: packed 4:4:4 YUV with alpha channel (A0-Y0-U0-V0 ...)
38  * @GST_VIDEO_FORMAT_RGBx: sparse rgb packed into 32 bit, space last
39  * @GST_VIDEO_FORMAT_BGRx: sparse reverse rgb packed into 32 bit, space last
40  * @GST_VIDEO_FORMAT_xRGB: sparse rgb packed into 32 bit, space first
41  * @GST_VIDEO_FORMAT_xBGR: sparse reverse rgb packed into 32 bit, space first
42  * @GST_VIDEO_FORMAT_RGBA: rgb with alpha channel last
43  * @GST_VIDEO_FORMAT_BGRA: reverse rgb with alpha channel last
44  * @GST_VIDEO_FORMAT_ARGB: rgb with alpha channel first
45  * @GST_VIDEO_FORMAT_ABGR: reverse rgb with alpha channel first
46  * @GST_VIDEO_FORMAT_RGB: rgb
47  * @GST_VIDEO_FORMAT_BGR: reverse rgb
48  * @GST_VIDEO_FORMAT_Y41B: planar 4:1:1 YUV (Since: 0.10.18)
49  * @GST_VIDEO_FORMAT_Y42B: planar 4:2:2 YUV (Since: 0.10.18)
50  * @GST_VIDEO_FORMAT_YVYU: packed 4:2:2 YUV (Y0-V0-Y1-U0 Y2-V2-Y3-U2 Y4 ...) (Since: 0.10.23)
51  * @GST_VIDEO_FORMAT_Y444: planar 4:4:4 YUV (Since: 0.10.24)
52  * @GST_VIDEO_FORMAT_v210: packed 4:2:2 10-bit YUV, complex format (Since: 0.10.24)
53  * @GST_VIDEO_FORMAT_v216: packed 4:2:2 16-bit YUV, Y0-U0-Y1-V1 order (Since: 0.10.24)
54  * @GST_VIDEO_FORMAT_NV12: planar 4:2:0 YUV with interleaved UV plane (Since: 0.10.26)
55  * @GST_VIDEO_FORMAT_NV21: planar 4:2:0 YUV with interleaved VU plane (Since: 0.10.26)
56  * @GST_VIDEO_FORMAT_GRAY8: 8-bit grayscale (Since: 0.10.29)
57  * @GST_VIDEO_FORMAT_GRAY16_BE: 16-bit grayscale, most significant byte first (Since: 0.10.29)
58  * @GST_VIDEO_FORMAT_GRAY16_LE: 16-bit grayscale, least significant byte first (Since: 0.10.29)
59  * @GST_VIDEO_FORMAT_v308: packed 4:4:4 YUV (Since: 0.10.29)
60  * @GST_VIDEO_FORMAT_Y800: same as GST_VIDEO_FORMAT_GRAY8 (Since: 0.10.30)
61  * @GST_VIDEO_FORMAT_Y16: same as GST_VIDEO_FORMAT_GRAY16_LE (Since: 0.10.30)
62  * @GST_VIDEO_FORMAT_RGB16: rgb 5-6-5 bits per component (Since: 0.10.30)
63  * @GST_VIDEO_FORMAT_BGR16: reverse rgb 5-6-5 bits per component (Since: 0.10.30)
64  * @GST_VIDEO_FORMAT_RGB15: rgb 5-5-5 bits per component (Since: 0.10.30)
65  * @GST_VIDEO_FORMAT_BGR15: reverse rgb 5-5-5 bits per component (Since: 0.10.30)
66  * @GST_VIDEO_FORMAT_UYVP: packed 10-bit 4:2:2 YUV (U0-Y0-V0-Y1 U2-Y2-V2-Y3 U4 ...) (Since: 0.10.31)
67  * @GST_VIDEO_FORMAT_A420: planar 4:4:2:0 AYUV (Since: 0.10.31)
68  * @GST_VIDEO_FORMAT_RGB8_PALETTED: 8-bit paletted RGB (Since: 0.10.32)
69  * @GST_VIDEO_FORMAT_YUV9: planar 4:1:0 YUV (Since: 0.10.32)
70  * @GST_VIDEO_FORMAT_YVU9: planar 4:1:0 YUV (like YUV9 but UV planes swapped) (Since: 0.10.32)
71  * @GST_VIDEO_FORMAT_IYU1: packed 4:1:1 YUV (Cb-Y0-Y1-Cr-Y2-Y3 ...) (Since: 0.10.32)
72  * @GST_VIDEO_FORMAT_ARGB64: rgb with alpha channel first, 16 bits per channel (Since: 0.10.33)
73  * @GST_VIDEO_FORMAT_AY64: packed 4:4:4 YUV with alpha channel, 16 bits per channel (A0-Y0-U0-V0 ...) (Since: 0.10.33)
74  *
75  * Enum value describing the most common video formats.
76  */
77 typedef enum {
78   GST_VIDEO_FORMAT_UNKNOWN,
79   GST_VIDEO_FORMAT_I420,
80   GST_VIDEO_FORMAT_YV12,
81   GST_VIDEO_FORMAT_YUY2,
82   GST_VIDEO_FORMAT_UYVY,
83   GST_VIDEO_FORMAT_AYUV,
84   GST_VIDEO_FORMAT_RGBx,
85   GST_VIDEO_FORMAT_BGRx,
86   GST_VIDEO_FORMAT_xRGB,
87   GST_VIDEO_FORMAT_xBGR,
88   GST_VIDEO_FORMAT_RGBA,
89   GST_VIDEO_FORMAT_BGRA,
90   GST_VIDEO_FORMAT_ARGB,
91   GST_VIDEO_FORMAT_ABGR,
92   GST_VIDEO_FORMAT_RGB,
93   GST_VIDEO_FORMAT_BGR,
94   GST_VIDEO_FORMAT_Y41B,
95   GST_VIDEO_FORMAT_Y42B,
96   GST_VIDEO_FORMAT_YVYU,
97   GST_VIDEO_FORMAT_Y444,
98   GST_VIDEO_FORMAT_v210,
99   GST_VIDEO_FORMAT_v216,
100   GST_VIDEO_FORMAT_NV12,
101   GST_VIDEO_FORMAT_NV21,
102   GST_VIDEO_FORMAT_GRAY8,
103   GST_VIDEO_FORMAT_GRAY16_BE,
104   GST_VIDEO_FORMAT_GRAY16_LE,
105   GST_VIDEO_FORMAT_v308,
106   GST_VIDEO_FORMAT_Y800,
107   GST_VIDEO_FORMAT_Y16,
108   GST_VIDEO_FORMAT_RGB16,
109   GST_VIDEO_FORMAT_BGR16,
110   GST_VIDEO_FORMAT_RGB15,
111   GST_VIDEO_FORMAT_BGR15,
112   GST_VIDEO_FORMAT_UYVP,
113   GST_VIDEO_FORMAT_A420,
114   GST_VIDEO_FORMAT_RGB8_PALETTED,
115   GST_VIDEO_FORMAT_YUV9,
116   GST_VIDEO_FORMAT_YVU9,
117   GST_VIDEO_FORMAT_IYU1,
118   GST_VIDEO_FORMAT_ARGB64,
119   GST_VIDEO_FORMAT_AYUV64
120 } GstVideoFormat;
121
122 #define GST_VIDEO_BYTE1_MASK_32  "0xFF000000"
123 #define GST_VIDEO_BYTE2_MASK_32  "0x00FF0000"
124 #define GST_VIDEO_BYTE3_MASK_32  "0x0000FF00"
125 #define GST_VIDEO_BYTE4_MASK_32  "0x000000FF"
126
127 #define GST_VIDEO_BYTE1_MASK_24  "0x00FF0000"
128 #define GST_VIDEO_BYTE2_MASK_24  "0x0000FF00"
129 #define GST_VIDEO_BYTE3_MASK_24  "0x000000FF"
130
131 #define GST_VIDEO_BYTE1_MASK_32_INT  0xFF000000
132 #define GST_VIDEO_BYTE2_MASK_32_INT  0x00FF0000
133 #define GST_VIDEO_BYTE3_MASK_32_INT  0x0000FF00
134 #define GST_VIDEO_BYTE4_MASK_32_INT  0x000000FF
135
136 #define GST_VIDEO_BYTE1_MASK_24_INT  0x00FF0000
137 #define GST_VIDEO_BYTE2_MASK_24_INT  0x0000FF00
138 #define GST_VIDEO_BYTE3_MASK_24_INT  0x000000FF
139
140 #define GST_VIDEO_COMP1_MASK_16 "0xf800"
141 #define GST_VIDEO_COMP2_MASK_16 "0x07e0"
142 #define GST_VIDEO_COMP3_MASK_16 "0x001f"
143
144 #define GST_VIDEO_COMP1_MASK_15 "0x7c00"
145 #define GST_VIDEO_COMP2_MASK_15 "0x03e0"
146 #define GST_VIDEO_COMP3_MASK_15 "0x001f"
147
148 #define GST_VIDEO_COMP1_MASK_16_INT 0xf800
149 #define GST_VIDEO_COMP2_MASK_16_INT 0x07e0
150 #define GST_VIDEO_COMP3_MASK_16_INT 0x001f
151
152 #define GST_VIDEO_COMP1_MASK_15_INT 0x7c00
153 #define GST_VIDEO_COMP2_MASK_15_INT 0x03e0
154 #define GST_VIDEO_COMP3_MASK_15_INT 0x001f
155
156 #ifndef GST_DISABLE_DEPRECATED
157 #define GST_VIDEO_RED_MASK_16 GST_VIDEO_COMP1_MASK_16
158 #define GST_VIDEO_GREEN_MASK_16 GST_VIDEO_COMP2_MASK_16
159 #define GST_VIDEO_BLUE_MASK_16 GST_VIDEO_COMP3_MASK_16
160
161 #define GST_VIDEO_RED_MASK_15 GST_VIDEO_COMP1_MASK_15
162 #define GST_VIDEO_GREEN_MASK_15 GST_VIDEO_COMP2_MASK_15
163 #define GST_VIDEO_BLUE_MASK_15 GST_VIDEO_COMP3_MASK_15
164
165 #define GST_VIDEO_RED_MASK_16_INT GST_VIDEO_COMP1_MASK_16_INT
166 #define GST_VIDEO_GREEN_MASK_16_INT GST_VIDEO_COMP2_MASK_16_INT
167 #define GST_VIDEO_BLUE_MASK_16_INT GST_VIDEO_COMP3_MASK_16_INT
168
169 #define GST_VIDEO_RED_MASK_15_INT GST_VIDEO_COMP1_MASK_15_INT
170 #define GST_VIDEO_GREEN_MASK_15_INT GST_VIDEO_COMP2_MASK_15_INT
171 #define GST_VIDEO_BLUE_MASK_15_INT GST_VIDEO_COMP3_MASK_15_INT
172 #endif
173
174 #define GST_VIDEO_SIZE_RANGE "(int) [ 1, max ]"
175 #define GST_VIDEO_FPS_RANGE "(fraction) [ 0, max ]"
176
177 /* consider the next 2 protected */
178 #define __GST_VIDEO_CAPS_MAKE_32A(R, G, B, A)                           \
179     "video/x-raw-rgb, "                                                 \
180     "bpp = (int) 32, "                                                  \
181     "depth = (int) 32, "                                                \
182     "endianness = (int) BIG_ENDIAN, "                                   \
183     "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", "            \
184     "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", "          \
185     "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", "           \
186     "alpha_mask = (int) " GST_VIDEO_BYTE ## A ## _MASK_32 ", "          \
187     "width = " GST_VIDEO_SIZE_RANGE ", "                                \
188     "height = " GST_VIDEO_SIZE_RANGE ", "                               \
189     "framerate = " GST_VIDEO_FPS_RANGE
190
191 #define __GST_VIDEO_CAPS_MAKE_32(R, G, B)                               \
192     "video/x-raw-rgb, "                                                 \
193     "bpp = (int) 32, "                                                  \
194     "depth = (int) 24, "                                                \
195     "endianness = (int) BIG_ENDIAN, "                                   \
196     "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", "            \
197     "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", "          \
198     "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", "           \
199     "width = " GST_VIDEO_SIZE_RANGE ", "                                \
200     "height = " GST_VIDEO_SIZE_RANGE ", "                               \
201     "framerate = " GST_VIDEO_FPS_RANGE
202
203 #define __GST_VIDEO_CAPS_MAKE_24(R, G, B)                               \
204     "video/x-raw-rgb, "                                                 \
205     "bpp = (int) 24, "                                                  \
206     "depth = (int) 24, "                                                \
207     "endianness = (int) BIG_ENDIAN, "                                   \
208     "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_24 ", "            \
209     "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_24 ", "          \
210     "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_24 ", "           \
211     "width = " GST_VIDEO_SIZE_RANGE ", "                                \
212     "height = " GST_VIDEO_SIZE_RANGE ", "                               \
213     "framerate = " GST_VIDEO_FPS_RANGE
214
215 #define __GST_VIDEO_CAPS_MAKE_16(R, G, B)                               \
216     "video/x-raw-rgb, "                                                 \
217     "bpp = (int) 16, "                                                  \
218     "depth = (int) 16, "                                                \
219     "endianness = (int) BYTE_ORDER, "                                   \
220     "red_mask = (int) " GST_VIDEO_COMP ## R ## _MASK_16 ", "            \
221     "green_mask = (int) " GST_VIDEO_COMP ## G ## _MASK_16 ", "          \
222     "blue_mask = (int) " GST_VIDEO_COMP ## B ## _MASK_16 ", "           \
223     "width = " GST_VIDEO_SIZE_RANGE ", "                                \
224     "height = " GST_VIDEO_SIZE_RANGE ", "                               \
225     "framerate = " GST_VIDEO_FPS_RANGE
226
227 #define __GST_VIDEO_CAPS_MAKE_15(R, G, B)                               \
228     "video/x-raw-rgb, "                                                 \
229     "bpp = (int) 16, "                                                  \
230     "depth = (int) 15, "                                                \
231     "endianness = (int) BYTE_ORDER, "                                   \
232     "red_mask = (int) " GST_VIDEO_COMP ## R ## _MASK_15 ", "            \
233     "green_mask = (int) " GST_VIDEO_COMP ## G ## _MASK_15 ", "          \
234     "blue_mask = (int) " GST_VIDEO_COMP ## B ## _MASK_15 ", "           \
235     "width = " GST_VIDEO_SIZE_RANGE ", "                                \
236     "height = " GST_VIDEO_SIZE_RANGE ", "                               \
237     "framerate = " GST_VIDEO_FPS_RANGE
238
239 #define __GST_VIDEO_CAPS_MAKE_64A(R, G, B, A)                           \
240     "video/x-raw-rgb, "                                                 \
241     "bpp = (int) 64, "                                                  \
242     "depth = (int) 64, "                                                \
243     "endianness = (int) BIG_ENDIAN, "                                   \
244     "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", "            \
245     "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", "          \
246     "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", "           \
247     "alpha_mask = (int) " GST_VIDEO_BYTE ## A ## _MASK_32 ", "          \
248     "width = " GST_VIDEO_SIZE_RANGE ", "                                \
249     "height = " GST_VIDEO_SIZE_RANGE ", "                               \
250     "framerate = " GST_VIDEO_FPS_RANGE
251
252
253 /* 24 bit */
254
255 #define GST_VIDEO_CAPS_RGB \
256     __GST_VIDEO_CAPS_MAKE_24 (1, 2, 3)
257
258 #define GST_VIDEO_CAPS_BGR \
259     __GST_VIDEO_CAPS_MAKE_24 (3, 2, 1)
260
261 /* 32 bit */
262
263 #define GST_VIDEO_CAPS_RGBx \
264     __GST_VIDEO_CAPS_MAKE_32 (1, 2, 3)
265   
266 #define GST_VIDEO_CAPS_xRGB \
267     __GST_VIDEO_CAPS_MAKE_32 (2, 3, 4)
268   
269 #define GST_VIDEO_CAPS_BGRx \
270     __GST_VIDEO_CAPS_MAKE_32 (3, 2, 1)
271   
272 #define GST_VIDEO_CAPS_xBGR \
273     __GST_VIDEO_CAPS_MAKE_32 (4, 3, 2)
274
275 /* 32 bit alpha */
276
277 #define GST_VIDEO_CAPS_RGBA \
278     __GST_VIDEO_CAPS_MAKE_32A (1, 2, 3, 4)
279   
280 #define GST_VIDEO_CAPS_ARGB \
281     __GST_VIDEO_CAPS_MAKE_32A (2, 3, 4, 1)
282   
283 #define GST_VIDEO_CAPS_BGRA \
284     __GST_VIDEO_CAPS_MAKE_32A (3, 2, 1, 4)
285   
286 #define GST_VIDEO_CAPS_ABGR \
287     __GST_VIDEO_CAPS_MAKE_32A (4, 3, 2, 1)
288
289 /* note: the macro name uses the order on BE systems */
290 #if G_BYTE_ORDER == G_BIG_ENDIAN
291   #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
292       GST_VIDEO_CAPS_xRGB
293   #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
294       GST_VIDEO_CAPS_BGRx
295 #else
296   #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
297       GST_VIDEO_CAPS_BGRx
298   #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
299       GST_VIDEO_CAPS_xRGB
300 #endif
301       
302 /* 15/16 bit */
303   
304 #define GST_VIDEO_CAPS_RGB_16 \
305     __GST_VIDEO_CAPS_MAKE_16 (1, 2, 3)
306
307 #define GST_VIDEO_CAPS_BGR_16 \
308     __GST_VIDEO_CAPS_MAKE_16 (3, 2, 1)
309
310 #define GST_VIDEO_CAPS_RGB_15 \
311     __GST_VIDEO_CAPS_MAKE_15 (1, 2, 3)
312
313 #define GST_VIDEO_CAPS_BGR_15 \
314     __GST_VIDEO_CAPS_MAKE_15 (3, 2, 1)
315
316 /* 64 bit alpha */
317
318 #define GST_VIDEO_CAPS_ARGB_64 \
319     __GST_VIDEO_CAPS_MAKE_64A (2, 3, 4, 1)
320
321 /**
322  * GST_VIDEO_CAPS_RGB8_PALETTED:
323  *
324  * Generic caps string for 8-bit paletted RGB video, for use in pad templates.
325  *
326  * Since: 0.10.32
327  */
328 #define GST_VIDEO_CAPS_RGB8_PALETTED \
329   "video/x-raw-rgb, bpp = (int)8, depth = (int)8, "                     \
330       "width = "GST_VIDEO_SIZE_RANGE" , "                               \
331       "height = " GST_VIDEO_SIZE_RANGE ", "                             \
332       "framerate = "GST_VIDEO_FPS_RANGE
333
334 /**
335  * GST_VIDEO_CAPS_YUV:
336  * @fourcc: YUV fourcc format that describes the pixel layout, as string
337  *     (e.g. "I420", "YV12", "YUY2", "AYUV", etc.)
338  *
339  * Generic caps string for YUV video, for use in pad templates.
340  */
341 #define GST_VIDEO_CAPS_YUV(fourcc)                                      \
342         "video/x-raw-yuv, "                                             \
343         "format = (fourcc) " fourcc ", "                                \
344         "width = " GST_VIDEO_SIZE_RANGE ", "                            \
345         "height = " GST_VIDEO_SIZE_RANGE ", "                           \
346         "framerate = " GST_VIDEO_FPS_RANGE
347
348 /**
349  * GST_VIDEO_CAPS_GRAY8:
350  *
351  * Generic caps string for 8-bit grayscale video, for use in pad templates.
352  *
353  * Since: 0.10.29
354  */
355 #define GST_VIDEO_CAPS_GRAY8                                            \
356         "video/x-raw-gray, "                                            \
357         "bpp = (int) 8, "                                               \
358         "depth = (int) 8, "                                             \
359         "width = " GST_VIDEO_SIZE_RANGE ", "                            \
360         "height = " GST_VIDEO_SIZE_RANGE ", "                           \
361         "framerate = " GST_VIDEO_FPS_RANGE
362
363 /**
364  * GST_VIDEO_CAPS_GRAY16:
365  * @endianness: endianness as string, ie. either "1234", "4321", "BIG_ENDIAN"
366  *     or "LITTLE_ENDIAN"
367  *
368  * Generic caps string for 16-bit grayscale video, for use in pad templates.
369  *
370  * Since: 0.10.29
371  */
372 #define GST_VIDEO_CAPS_GRAY16(endianness)                               \
373         "video/x-raw-gray, "                                            \
374         "bpp = (int) 16, "                                              \
375         "depth = (int) 16, "                                            \
376         "endianness = (int) " endianness ", "                           \
377         "width = " GST_VIDEO_SIZE_RANGE ", "                            \
378         "height = " GST_VIDEO_SIZE_RANGE ", "                           \
379         "framerate = " GST_VIDEO_FPS_RANGE
380
381 /* buffer flags */
382
383 /**
384  * GST_VIDEO_BUFFER_TFF:
385  *
386  * If the #GstBuffer is interlaced, then the first field in the video frame is
387  * the top field.  If unset, the bottom field is first.
388  *
389  * Since: 0.10.23
390  */
391 #define GST_VIDEO_BUFFER_TFF GST_BUFFER_FLAG_MEDIA1
392
393 /**
394  * GST_VIDEO_BUFFER_RFF:
395  *
396  * If the #GstBuffer is interlaced, then the first field (as defined by the
397  * %GST_VIDEO_BUFFER_TFF flag setting) is repeated.
398  *
399  * Since: 0.10.23
400  */
401 #define GST_VIDEO_BUFFER_RFF GST_BUFFER_FLAG_MEDIA2
402
403 /**
404  * GST_VIDEO_BUFFER_ONEFIELD:
405  *
406  * If the #GstBuffer is interlaced, then only the first field (as defined by the
407  * %GST_VIDEO_BUFFER_TFF flag setting) is to be displayed.
408  *
409  * Since: 0.10.23
410  */
411 #define GST_VIDEO_BUFFER_ONEFIELD GST_BUFFER_FLAG_MEDIA3
412
413 /**
414  * GST_VIDEO_BUFFER_PROGRESSIVE:
415  *
416  * If the #GstBuffer is telecined, then the buffer is progressive if the
417  * %GST_VIDEO_BUFFER_PROGRESSIVE flag is set, else it is telecine mixed.
418  *
419  * Since: 0.10.33
420  */
421 #define GST_VIDEO_BUFFER_PROGRESSIVE GST_BUFFER_FLAG_MEDIA4
422
423 /* functions */
424 const GValue *gst_video_frame_rate (GstPad *pad);
425 gboolean gst_video_get_size   (GstPad *pad,
426                                gint   *width,
427                                gint   *height);
428
429 gboolean gst_video_calculate_display_ratio (guint *dar_n, guint *dar_d,
430             guint video_width, guint video_height, 
431             guint video_par_n, guint video_par_d, 
432             guint display_par_n, guint display_par_d);
433
434 gboolean gst_video_format_parse_caps (GstCaps *caps, GstVideoFormat *format,
435     int *width, int *height);
436 gboolean gst_video_format_parse_caps_interlaced (GstCaps *caps, gboolean *interlaced);
437 gboolean gst_video_parse_caps_framerate (GstCaps *caps,
438     int *fps_n, int *fps_d);
439 gboolean gst_video_parse_caps_pixel_aspect_ratio (GstCaps *caps,
440     int *par_n, int *par_d);
441 const char *gst_video_parse_caps_color_matrix (GstCaps * caps);
442 const char *gst_video_parse_caps_chroma_site (GstCaps * caps);
443 GstBuffer *gst_video_parse_caps_palette (GstCaps * caps);
444 GstCaps * gst_video_format_new_caps (GstVideoFormat format,
445     int width, int height, int framerate_n, int framerate_d,
446     int par_n, int par_d);
447 GstCaps * gst_video_format_new_caps_interlaced (GstVideoFormat format,
448     int width, int height, int framerate_n, int framerate_d,
449                                                 int par_n, int par_d, gboolean interlaced);
450 GstVideoFormat gst_video_format_from_fourcc (guint32 fourcc);
451 guint32 gst_video_format_to_fourcc (GstVideoFormat format);
452 gboolean gst_video_format_is_rgb (GstVideoFormat format);
453 gboolean gst_video_format_is_yuv (GstVideoFormat format);
454 gboolean gst_video_format_is_gray (GstVideoFormat format);
455 gboolean gst_video_format_has_alpha (GstVideoFormat format);
456 int gst_video_format_get_component_depth (GstVideoFormat format, int component);
457 int gst_video_format_get_row_stride (GstVideoFormat format, int component,
458     int width);
459 int gst_video_format_get_pixel_stride (GstVideoFormat format, int component);
460 int gst_video_format_get_component_width (GstVideoFormat format, int component,
461     int width);
462 int gst_video_format_get_component_height (GstVideoFormat format, int component,
463     int height);
464 int gst_video_format_get_component_offset (GstVideoFormat format, int component,
465     int width, int height);
466 int gst_video_format_get_size (GstVideoFormat format, int width, int height);
467 gboolean gst_video_format_convert (GstVideoFormat format, int width, int height,
468     int fps_n, int fps_d,
469     GstFormat src_format, gint64 src_value,
470     GstFormat dest_format, gint64 * dest_value);
471
472 GstEvent *gst_video_event_new_still_frame (gboolean in_still);
473 gboolean gst_video_event_parse_still_frame (GstEvent *event, gboolean *in_still);
474
475 GstBuffer *gst_video_convert_frame(GstBuffer *buf, const GstCaps *to_caps,
476                                    GstClockTime timeout, GError **error);
477
478 typedef void (*GstVideoConvertFrameCallback) (GstBuffer *buf, GError *error, gpointer user_data);
479 void gst_video_convert_frame_async(GstBuffer *buf, const GstCaps *to_caps,
480                                    GstClockTime timeout, GstVideoConvertFrameCallback callback,
481                                    gpointer user_data, GDestroyNotify destroy_notify);
482
483 G_END_DECLS
484
485 #endif /* __GST_VIDEO_H__ */