2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 * Library <2002> Ronald Bultje <rbultje@ronald.bitfreak.net>
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.
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.
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.
21 #ifndef __GST_VIDEO_H__
22 #define __GST_VIDEO_H__
28 #include <gst/video/video-enumtypes.h>
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_AYUV64: packed 4:4:4 YUV with alpha channel, 16 bits per channel (A0-Y0-U0-V0 ...) (Since: 0.10.33)
74 * @GST_VIDEO_FORMAT_r210: packed 4:4:4 RGB, 10 bits per channel (Since: 0.10.33)
76 * Enum value describing the most common video formats.
79 GST_VIDEO_FORMAT_UNKNOWN,
80 GST_VIDEO_FORMAT_I420,
81 GST_VIDEO_FORMAT_YV12,
82 GST_VIDEO_FORMAT_YUY2,
83 GST_VIDEO_FORMAT_UYVY,
84 GST_VIDEO_FORMAT_AYUV,
85 GST_VIDEO_FORMAT_RGBx,
86 GST_VIDEO_FORMAT_BGRx,
87 GST_VIDEO_FORMAT_xRGB,
88 GST_VIDEO_FORMAT_xBGR,
89 GST_VIDEO_FORMAT_RGBA,
90 GST_VIDEO_FORMAT_BGRA,
91 GST_VIDEO_FORMAT_ARGB,
92 GST_VIDEO_FORMAT_ABGR,
95 GST_VIDEO_FORMAT_Y41B,
96 GST_VIDEO_FORMAT_Y42B,
97 GST_VIDEO_FORMAT_YVYU,
98 GST_VIDEO_FORMAT_Y444,
99 GST_VIDEO_FORMAT_v210,
100 GST_VIDEO_FORMAT_v216,
101 GST_VIDEO_FORMAT_NV12,
102 GST_VIDEO_FORMAT_NV21,
103 GST_VIDEO_FORMAT_GRAY8,
104 GST_VIDEO_FORMAT_GRAY16_BE,
105 GST_VIDEO_FORMAT_GRAY16_LE,
106 GST_VIDEO_FORMAT_v308,
107 GST_VIDEO_FORMAT_Y800,
108 GST_VIDEO_FORMAT_Y16,
109 GST_VIDEO_FORMAT_RGB16,
110 GST_VIDEO_FORMAT_BGR16,
111 GST_VIDEO_FORMAT_RGB15,
112 GST_VIDEO_FORMAT_BGR15,
113 GST_VIDEO_FORMAT_UYVP,
114 GST_VIDEO_FORMAT_A420,
115 GST_VIDEO_FORMAT_RGB8_PALETTED,
116 GST_VIDEO_FORMAT_YUV9,
117 GST_VIDEO_FORMAT_YVU9,
118 GST_VIDEO_FORMAT_IYU1,
119 GST_VIDEO_FORMAT_ARGB64,
120 GST_VIDEO_FORMAT_AYUV64,
121 GST_VIDEO_FORMAT_r210
122 #ifdef GST_EXT_XV_ENHANCEMENT
123 , GST_VIDEO_FORMAT_ST12,
124 GST_VIDEO_FORMAT_SN12,
125 GST_VIDEO_FORMAT_SUYV,
126 GST_VIDEO_FORMAT_SUY2,
127 GST_VIDEO_FORMAT_S420,
128 GST_VIDEO_FORMAT_SYVY
132 #define GST_VIDEO_BYTE1_MASK_32 "0xFF000000"
133 #define GST_VIDEO_BYTE2_MASK_32 "0x00FF0000"
134 #define GST_VIDEO_BYTE3_MASK_32 "0x0000FF00"
135 #define GST_VIDEO_BYTE4_MASK_32 "0x000000FF"
137 #define GST_VIDEO_BYTE1_MASK_24 "0x00FF0000"
138 #define GST_VIDEO_BYTE2_MASK_24 "0x0000FF00"
139 #define GST_VIDEO_BYTE3_MASK_24 "0x000000FF"
141 #define GST_VIDEO_BYTE1_MASK_32_INT 0xFF000000
142 #define GST_VIDEO_BYTE2_MASK_32_INT 0x00FF0000
143 #define GST_VIDEO_BYTE3_MASK_32_INT 0x0000FF00
144 #define GST_VIDEO_BYTE4_MASK_32_INT 0x000000FF
146 #define GST_VIDEO_BYTE1_MASK_24_INT 0x00FF0000
147 #define GST_VIDEO_BYTE2_MASK_24_INT 0x0000FF00
148 #define GST_VIDEO_BYTE3_MASK_24_INT 0x000000FF
150 #define GST_VIDEO_COMP1_MASK_16 "0xf800"
151 #define GST_VIDEO_COMP2_MASK_16 "0x07e0"
152 #define GST_VIDEO_COMP3_MASK_16 "0x001f"
154 #define GST_VIDEO_COMP1_MASK_15 "0x7c00"
155 #define GST_VIDEO_COMP2_MASK_15 "0x03e0"
156 #define GST_VIDEO_COMP3_MASK_15 "0x001f"
158 #define GST_VIDEO_COMP1_MASK_16_INT 0xf800
159 #define GST_VIDEO_COMP2_MASK_16_INT 0x07e0
160 #define GST_VIDEO_COMP3_MASK_16_INT 0x001f
162 #define GST_VIDEO_COMP1_MASK_15_INT 0x7c00
163 #define GST_VIDEO_COMP2_MASK_15_INT 0x03e0
164 #define GST_VIDEO_COMP3_MASK_15_INT 0x001f
166 #ifndef GST_DISABLE_DEPRECATED
167 #define GST_VIDEO_RED_MASK_16 GST_VIDEO_COMP1_MASK_16
168 #define GST_VIDEO_GREEN_MASK_16 GST_VIDEO_COMP2_MASK_16
169 #define GST_VIDEO_BLUE_MASK_16 GST_VIDEO_COMP3_MASK_16
171 #define GST_VIDEO_RED_MASK_15 GST_VIDEO_COMP1_MASK_15
172 #define GST_VIDEO_GREEN_MASK_15 GST_VIDEO_COMP2_MASK_15
173 #define GST_VIDEO_BLUE_MASK_15 GST_VIDEO_COMP3_MASK_15
175 #define GST_VIDEO_RED_MASK_16_INT GST_VIDEO_COMP1_MASK_16_INT
176 #define GST_VIDEO_GREEN_MASK_16_INT GST_VIDEO_COMP2_MASK_16_INT
177 #define GST_VIDEO_BLUE_MASK_16_INT GST_VIDEO_COMP3_MASK_16_INT
179 #define GST_VIDEO_RED_MASK_15_INT GST_VIDEO_COMP1_MASK_15_INT
180 #define GST_VIDEO_GREEN_MASK_15_INT GST_VIDEO_COMP2_MASK_15_INT
181 #define GST_VIDEO_BLUE_MASK_15_INT GST_VIDEO_COMP3_MASK_15_INT
184 #define GST_VIDEO_SIZE_RANGE "(int) [ 1, max ]"
185 #define GST_VIDEO_FPS_RANGE "(fraction) [ 0, max ]"
187 /* consider the next 2 protected */
188 #define __GST_VIDEO_CAPS_MAKE_32A(R, G, B, A) \
189 "video/x-raw-rgb, " \
191 "depth = (int) 32, " \
192 "endianness = (int) BIG_ENDIAN, " \
193 "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", " \
194 "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", " \
195 "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", " \
196 "alpha_mask = (int) " GST_VIDEO_BYTE ## A ## _MASK_32 ", " \
197 "width = " GST_VIDEO_SIZE_RANGE ", " \
198 "height = " GST_VIDEO_SIZE_RANGE ", " \
199 "framerate = " GST_VIDEO_FPS_RANGE
201 #define __GST_VIDEO_CAPS_MAKE_32(R, G, B) \
202 "video/x-raw-rgb, " \
204 "depth = (int) 24, " \
205 "endianness = (int) BIG_ENDIAN, " \
206 "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", " \
207 "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", " \
208 "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", " \
209 "width = " GST_VIDEO_SIZE_RANGE ", " \
210 "height = " GST_VIDEO_SIZE_RANGE ", " \
211 "framerate = " GST_VIDEO_FPS_RANGE
213 #define __GST_VIDEO_CAPS_MAKE_24(R, G, B) \
214 "video/x-raw-rgb, " \
216 "depth = (int) 24, " \
217 "endianness = (int) BIG_ENDIAN, " \
218 "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_24 ", " \
219 "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_24 ", " \
220 "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_24 ", " \
221 "width = " GST_VIDEO_SIZE_RANGE ", " \
222 "height = " GST_VIDEO_SIZE_RANGE ", " \
223 "framerate = " GST_VIDEO_FPS_RANGE
225 #define __GST_VIDEO_CAPS_MAKE_16(R, G, B) \
226 "video/x-raw-rgb, " \
228 "depth = (int) 16, " \
229 "endianness = (int) BYTE_ORDER, " \
230 "red_mask = (int) " GST_VIDEO_COMP ## R ## _MASK_16 ", " \
231 "green_mask = (int) " GST_VIDEO_COMP ## G ## _MASK_16 ", " \
232 "blue_mask = (int) " GST_VIDEO_COMP ## B ## _MASK_16 ", " \
233 "width = " GST_VIDEO_SIZE_RANGE ", " \
234 "height = " GST_VIDEO_SIZE_RANGE ", " \
235 "framerate = " GST_VIDEO_FPS_RANGE
237 #define __GST_VIDEO_CAPS_MAKE_15(R, G, B) \
238 "video/x-raw-rgb, " \
240 "depth = (int) 15, " \
241 "endianness = (int) BYTE_ORDER, " \
242 "red_mask = (int) " GST_VIDEO_COMP ## R ## _MASK_15 ", " \
243 "green_mask = (int) " GST_VIDEO_COMP ## G ## _MASK_15 ", " \
244 "blue_mask = (int) " GST_VIDEO_COMP ## B ## _MASK_15 ", " \
245 "width = " GST_VIDEO_SIZE_RANGE ", " \
246 "height = " GST_VIDEO_SIZE_RANGE ", " \
247 "framerate = " GST_VIDEO_FPS_RANGE
249 #define __GST_VIDEO_CAPS_MAKE_64A(R, G, B, A) \
250 "video/x-raw-rgb, " \
252 "depth = (int) 64, " \
253 "endianness = (int) BIG_ENDIAN, " \
254 "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", " \
255 "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", " \
256 "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", " \
257 "alpha_mask = (int) " GST_VIDEO_BYTE ## A ## _MASK_32 ", " \
258 "width = " GST_VIDEO_SIZE_RANGE ", " \
259 "height = " GST_VIDEO_SIZE_RANGE ", " \
260 "framerate = " GST_VIDEO_FPS_RANGE
265 #define GST_VIDEO_CAPS_RGB \
266 __GST_VIDEO_CAPS_MAKE_24 (1, 2, 3)
268 #define GST_VIDEO_CAPS_BGR \
269 __GST_VIDEO_CAPS_MAKE_24 (3, 2, 1)
273 #define GST_VIDEO_CAPS_RGBx \
274 __GST_VIDEO_CAPS_MAKE_32 (1, 2, 3)
276 #define GST_VIDEO_CAPS_xRGB \
277 __GST_VIDEO_CAPS_MAKE_32 (2, 3, 4)
279 #define GST_VIDEO_CAPS_BGRx \
280 __GST_VIDEO_CAPS_MAKE_32 (3, 2, 1)
282 #define GST_VIDEO_CAPS_xBGR \
283 __GST_VIDEO_CAPS_MAKE_32 (4, 3, 2)
287 #define GST_VIDEO_CAPS_RGBA \
288 __GST_VIDEO_CAPS_MAKE_32A (1, 2, 3, 4)
290 #define GST_VIDEO_CAPS_ARGB \
291 __GST_VIDEO_CAPS_MAKE_32A (2, 3, 4, 1)
293 #define GST_VIDEO_CAPS_BGRA \
294 __GST_VIDEO_CAPS_MAKE_32A (3, 2, 1, 4)
296 #define GST_VIDEO_CAPS_ABGR \
297 __GST_VIDEO_CAPS_MAKE_32A (4, 3, 2, 1)
299 /* note: the macro name uses the order on BE systems */
300 #if G_BYTE_ORDER == G_BIG_ENDIAN
301 #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
303 #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
306 #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
308 #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
314 #define GST_VIDEO_CAPS_RGB_16 \
315 __GST_VIDEO_CAPS_MAKE_16 (1, 2, 3)
317 #define GST_VIDEO_CAPS_BGR_16 \
318 __GST_VIDEO_CAPS_MAKE_16 (3, 2, 1)
320 #define GST_VIDEO_CAPS_RGB_15 \
321 __GST_VIDEO_CAPS_MAKE_15 (1, 2, 3)
323 #define GST_VIDEO_CAPS_BGR_15 \
324 __GST_VIDEO_CAPS_MAKE_15 (3, 2, 1)
327 #define GST_VIDEO_CAPS_r210 \
328 "video/x-raw-rgb, " \
330 "depth = (int) 30, " \
331 "endianness = (int) BIG_ENDIAN, " \
332 "red_mask = (int) 0x3ff00000, " \
333 "green_mask = (int) 0x000ffc00, " \
334 "blue_mask = (int) 0x000003ff, " \
335 "width = " GST_VIDEO_SIZE_RANGE ", " \
336 "height = " GST_VIDEO_SIZE_RANGE ", " \
337 "framerate = " GST_VIDEO_FPS_RANGE
341 #define GST_VIDEO_CAPS_ARGB_64 \
342 __GST_VIDEO_CAPS_MAKE_64A (2, 3, 4, 1)
345 * GST_VIDEO_CAPS_RGB8_PALETTED:
347 * Generic caps string for 8-bit paletted RGB video, for use in pad templates.
351 #define GST_VIDEO_CAPS_RGB8_PALETTED \
352 "video/x-raw-rgb, bpp = (int)8, depth = (int)8, " \
353 "width = " GST_VIDEO_SIZE_RANGE ", " \
354 "height = " GST_VIDEO_SIZE_RANGE ", " \
355 "framerate = " GST_VIDEO_FPS_RANGE
358 * GST_VIDEO_CAPS_YUV:
359 * @fourcc: YUV fourcc format that describes the pixel layout, as string
360 * (e.g. "I420", "YV12", "YUY2", "AYUV", etc.)
362 * Generic caps string for YUV video, for use in pad templates.
364 #define GST_VIDEO_CAPS_YUV(fourcc) \
365 "video/x-raw-yuv, " \
366 "format = (fourcc) " fourcc ", " \
367 "width = " GST_VIDEO_SIZE_RANGE ", " \
368 "height = " GST_VIDEO_SIZE_RANGE ", " \
369 "framerate = " GST_VIDEO_FPS_RANGE
372 * GST_VIDEO_CAPS_GRAY8:
374 * Generic caps string for 8-bit grayscale video, for use in pad templates.
378 #define GST_VIDEO_CAPS_GRAY8 \
379 "video/x-raw-gray, " \
381 "depth = (int) 8, " \
382 "width = " GST_VIDEO_SIZE_RANGE ", " \
383 "height = " GST_VIDEO_SIZE_RANGE ", " \
384 "framerate = " GST_VIDEO_FPS_RANGE
387 * GST_VIDEO_CAPS_GRAY16:
388 * @endianness: endianness as string, ie. either "1234", "4321", "BIG_ENDIAN"
391 * Generic caps string for 16-bit grayscale video, for use in pad templates.
395 #define GST_VIDEO_CAPS_GRAY16(endianness) \
396 "video/x-raw-gray, " \
398 "depth = (int) 16, " \
399 "endianness = (int) " endianness ", " \
400 "width = " GST_VIDEO_SIZE_RANGE ", " \
401 "height = " GST_VIDEO_SIZE_RANGE ", " \
402 "framerate = " GST_VIDEO_FPS_RANGE
407 * GST_VIDEO_BUFFER_TFF:
409 * If the #GstBuffer is interlaced, then the first field in the video frame is
410 * the top field. If unset, the bottom field is first.
414 #define GST_VIDEO_BUFFER_TFF GST_BUFFER_FLAG_MEDIA1
417 * GST_VIDEO_BUFFER_RFF:
419 * If the #GstBuffer is interlaced, then the first field (as defined by the
420 * %GST_VIDEO_BUFFER_TFF flag setting) is repeated.
424 #define GST_VIDEO_BUFFER_RFF GST_BUFFER_FLAG_MEDIA2
427 * GST_VIDEO_BUFFER_ONEFIELD:
429 * If the #GstBuffer is interlaced, then only the first field (as defined by the
430 * %GST_VIDEO_BUFFER_TFF flag setting) is to be displayed.
434 #define GST_VIDEO_BUFFER_ONEFIELD GST_BUFFER_FLAG_MEDIA3
437 * GST_VIDEO_BUFFER_PROGRESSIVE:
439 * If the #GstBuffer is telecined, then the buffer is progressive if the
440 * %GST_VIDEO_BUFFER_PROGRESSIVE flag is set, else it is telecine mixed.
444 #define GST_VIDEO_BUFFER_PROGRESSIVE GST_BUFFER_FLAG_MEDIA4
448 const GValue * gst_video_frame_rate (GstPad * pad);
450 gboolean gst_video_get_size (GstPad * pad,
454 gboolean gst_video_calculate_display_ratio (guint * dar_n,
461 guint display_par_d);
463 gboolean gst_video_format_parse_caps (const GstCaps * caps,
464 GstVideoFormat * format,
468 gboolean gst_video_format_parse_caps_interlaced (GstCaps * caps,
469 gboolean * interlaced);
472 gboolean gst_video_parse_caps_pixel_aspect_ratio (GstCaps * caps,
476 gboolean gst_video_parse_caps_framerate (GstCaps * caps,
480 const char * gst_video_parse_caps_color_matrix (GstCaps * caps);
482 const char * gst_video_parse_caps_chroma_site (GstCaps * caps);
484 GstBuffer * gst_video_parse_caps_palette (GstCaps * caps);
486 /* create caps given format and details */
488 GstCaps * gst_video_format_new_caps (GstVideoFormat format,
489 int width, int height,
492 int par_n, int par_d);
494 GstCaps * gst_video_format_new_caps_interlaced (GstVideoFormat format,
495 int width, int height,
498 int par_n, int par_d,
499 gboolean interlaced);
501 GstCaps * gst_video_format_new_template_caps (GstVideoFormat format);
503 /* format properties */
505 GstVideoFormat gst_video_format_from_fourcc (guint32 fourcc) G_GNUC_CONST;
507 guint32 gst_video_format_to_fourcc (GstVideoFormat format) G_GNUC_CONST;
509 gboolean gst_video_format_is_rgb (GstVideoFormat format) G_GNUC_CONST;
511 gboolean gst_video_format_is_yuv (GstVideoFormat format) G_GNUC_CONST;
513 gboolean gst_video_format_is_gray (GstVideoFormat format) G_GNUC_CONST;
515 gboolean gst_video_format_has_alpha (GstVideoFormat format) G_GNUC_CONST;
518 int gst_video_format_get_component_depth (GstVideoFormat format,
519 int component) G_GNUC_CONST;
521 int gst_video_format_get_row_stride (GstVideoFormat format,
523 int width) G_GNUC_CONST;
525 int gst_video_format_get_pixel_stride (GstVideoFormat format,
526 int component) G_GNUC_CONST;
528 int gst_video_format_get_component_width (GstVideoFormat format,
530 int width) G_GNUC_CONST;
532 int gst_video_format_get_component_height (GstVideoFormat format,
534 int height) G_GNUC_CONST;
536 int gst_video_format_get_component_offset (GstVideoFormat format,
539 int height) G_GNUC_CONST;
541 int gst_video_format_get_size (GstVideoFormat format,
543 int height) G_GNUC_CONST;
545 gboolean gst_video_get_size_from_caps (const GstCaps * caps, gint * size);
547 gboolean gst_video_format_convert (GstVideoFormat format,
552 GstFormat src_format,
554 GstFormat dest_format,
555 gint64 * dest_value);
557 /* video still frame event creation and parsing */
559 GstEvent * gst_video_event_new_still_frame (gboolean in_still);
561 gboolean gst_video_event_parse_still_frame (GstEvent * event, gboolean * in_still);
563 /* video force key unit event creation and parsing */
565 GstEvent * gst_video_event_new_downstream_force_key_unit (GstClockTime timestamp,
566 GstClockTime streamtime,
567 GstClockTime runningtime,
568 gboolean all_headers,
571 gboolean gst_video_event_parse_downstream_force_key_unit (GstEvent * event,
572 GstClockTime * timestamp,
573 GstClockTime * streamtime,
574 GstClockTime * runningtime,
575 gboolean * all_headers,
578 GstEvent * gst_video_event_new_upstream_force_key_unit (GstClockTime running_time,
579 gboolean all_headers,
582 gboolean gst_video_event_parse_upstream_force_key_unit (GstEvent * event,
583 GstClockTime * running_time,
584 gboolean * all_headers,
587 gboolean gst_video_event_is_force_key_unit(GstEvent *event);
589 /* convert/encode video frame from one format to another */
591 typedef void (*GstVideoConvertFrameCallback) (GstBuffer * buf, GError *error, gpointer user_data);
593 void gst_video_convert_frame_async (GstBuffer * buf,
594 const GstCaps * to_caps,
595 GstClockTime timeout,
596 GstVideoConvertFrameCallback callback,
598 GDestroyNotify destroy_notify);
600 GstBuffer * gst_video_convert_frame (GstBuffer * buf,
601 const GstCaps * to_caps,
602 GstClockTime timeout,
607 #endif /* __GST_VIDEO_H__ */