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 #define GST_VIDEO_BYTE1_MASK_32 "0xFF000000"
29 #define GST_VIDEO_BYTE2_MASK_32 "0x00FF0000"
30 #define GST_VIDEO_BYTE3_MASK_32 "0x0000FF00"
31 #define GST_VIDEO_BYTE4_MASK_32 "0x000000FF"
33 #define GST_VIDEO_BYTE1_MASK_24 "0x00FF0000"
34 #define GST_VIDEO_BYTE2_MASK_24 "0x0000FF00"
35 #define GST_VIDEO_BYTE3_MASK_24 "0x000000FF"
37 #define GST_VIDEO_BYTE1_MASK_32_INT 0xFF000000
38 #define GST_VIDEO_BYTE2_MASK_32_INT 0x00FF0000
39 #define GST_VIDEO_BYTE3_MASK_32_INT 0x0000FF00
40 #define GST_VIDEO_BYTE4_MASK_32_INT 0x000000FF
42 #define GST_VIDEO_BYTE1_MASK_24_INT 0x00FF0000
43 #define GST_VIDEO_BYTE2_MASK_24_INT 0x0000FF00
44 #define GST_VIDEO_BYTE3_MASK_24_INT 0x000000FF
46 #define GST_VIDEO_RED_MASK_16 "0xf800"
47 #define GST_VIDEO_GREEN_MASK_16 "0x07e0"
48 #define GST_VIDEO_BLUE_MASK_16 "0x001f"
50 #define GST_VIDEO_RED_MASK_15 "0x7c00"
51 #define GST_VIDEO_GREEN_MASK_15 "0x03e0"
52 #define GST_VIDEO_BLUE_MASK_15 "0x001f"
54 #define GST_VIDEO_RED_MASK_16_INT 0xf800
55 #define GST_VIDEO_GREEN_MASK_16_INT 0x07e0
56 #define GST_VIDEO_BLUE_MASK_16_INT 0x001f
58 #define GST_VIDEO_RED_MASK_15_INT 0x7c00
59 #define GST_VIDEO_GREEN_MASK_15_INT 0x03e0
60 #define GST_VIDEO_BLUE_MASK_15_INT 0x001f
62 #define GST_VIDEO_SIZE_RANGE "(int) [ 1, max ]"
63 #define GST_VIDEO_FPS_RANGE "(fraction) [ 0, max ]"
65 /* consider the next 2 protected */
66 #define __GST_VIDEO_CAPS_MAKE_32A(R, G, B, A) \
69 "depth = (int) 32, " \
70 "endianness = (int) BIG_ENDIAN, " \
71 "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", " \
72 "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", " \
73 "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", " \
74 "alpha_mask = (int) " GST_VIDEO_BYTE ## A ## _MASK_32 ", " \
75 "width = " GST_VIDEO_SIZE_RANGE ", " \
76 "height = " GST_VIDEO_SIZE_RANGE ", " \
77 "framerate = " GST_VIDEO_FPS_RANGE
79 #define __GST_VIDEO_CAPS_MAKE_32(R, G, B) \
82 "depth = (int) 24, " \
83 "endianness = (int) BIG_ENDIAN, " \
84 "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_32 ", " \
85 "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_32 ", " \
86 "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_32 ", " \
87 "width = " GST_VIDEO_SIZE_RANGE ", " \
88 "height = " GST_VIDEO_SIZE_RANGE ", " \
89 "framerate = " GST_VIDEO_FPS_RANGE
91 #define __GST_VIDEO_CAPS_MAKE_24(R, G, B) \
94 "depth = (int) 24, " \
95 "endianness = (int) BIG_ENDIAN, " \
96 "red_mask = (int) " GST_VIDEO_BYTE ## R ## _MASK_24 ", " \
97 "green_mask = (int) " GST_VIDEO_BYTE ## G ## _MASK_24 ", " \
98 "blue_mask = (int) " GST_VIDEO_BYTE ## B ## _MASK_24 ", " \
99 "width = " GST_VIDEO_SIZE_RANGE ", " \
100 "height = " GST_VIDEO_SIZE_RANGE ", " \
101 "framerate = " GST_VIDEO_FPS_RANGE
106 #define GST_VIDEO_CAPS_RGB \
107 __GST_VIDEO_CAPS_MAKE_24 (1, 2, 3)
109 #define GST_VIDEO_CAPS_BGR \
110 __GST_VIDEO_CAPS_MAKE_24 (3, 2, 1)
114 #define GST_VIDEO_CAPS_RGBx \
115 __GST_VIDEO_CAPS_MAKE_32 (1, 2, 3)
117 #define GST_VIDEO_CAPS_xRGB \
118 __GST_VIDEO_CAPS_MAKE_32 (2, 3, 4)
120 #define GST_VIDEO_CAPS_BGRx \
121 __GST_VIDEO_CAPS_MAKE_32 (3, 2, 1)
123 #define GST_VIDEO_CAPS_xBGR \
124 __GST_VIDEO_CAPS_MAKE_32 (4, 3, 2)
128 #define GST_VIDEO_CAPS_RGBA \
129 __GST_VIDEO_CAPS_MAKE_32A (1, 2, 3, 4)
131 #define GST_VIDEO_CAPS_ARGB \
132 __GST_VIDEO_CAPS_MAKE_32A (2, 3, 4, 1)
134 #define GST_VIDEO_CAPS_BGRA \
135 __GST_VIDEO_CAPS_MAKE_32A (3, 2, 1, 4)
137 #define GST_VIDEO_CAPS_ABGR \
138 __GST_VIDEO_CAPS_MAKE_32A (4, 3, 2, 1)
140 /* note: the macro name uses the order on BE systems */
141 #if G_BYTE_ORDER == G_BIG_ENDIAN
142 #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
144 #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
147 #define GST_VIDEO_CAPS_xRGB_HOST_ENDIAN \
149 #define GST_VIDEO_CAPS_BGRx_HOST_ENDIAN \
155 #define GST_VIDEO_CAPS_RGB_16 \
156 "video/x-raw-rgb, " \
158 "depth = (int) 16, " \
159 "endianness = (int) BYTE_ORDER, " \
160 "red_mask = (int) " GST_VIDEO_RED_MASK_16 ", " \
161 "green_mask = (int) " GST_VIDEO_GREEN_MASK_16 ", " \
162 "blue_mask = (int) " GST_VIDEO_BLUE_MASK_16 ", " \
163 "width = " GST_VIDEO_SIZE_RANGE ", " \
164 "height = " GST_VIDEO_SIZE_RANGE ", " \
165 "framerate = " GST_VIDEO_FPS_RANGE
167 #define GST_VIDEO_CAPS_RGB_15 \
168 "video/x-raw-rgb, " \
170 "depth = (int) 15, " \
171 "endianness = (int) BYTE_ORDER, " \
172 "red_mask = (int) " GST_VIDEO_RED_MASK_15 ", " \
173 "green_mask = (int) " GST_VIDEO_GREEN_MASK_15 ", " \
174 "blue_mask = (int) " GST_VIDEO_BLUE_MASK_15 ", " \
175 "width = " GST_VIDEO_SIZE_RANGE ", " \
176 "height = " GST_VIDEO_SIZE_RANGE ", " \
177 "framerate = " GST_VIDEO_FPS_RANGE
179 #define GST_VIDEO_CAPS_YUV(fourcc) \
180 "video/x-raw-yuv, " \
181 "format = (fourcc) " fourcc ", " \
182 "width = " GST_VIDEO_SIZE_RANGE ", " \
183 "height = " GST_VIDEO_SIZE_RANGE ", " \
184 "framerate = " GST_VIDEO_FPS_RANGE
187 const GValue *gst_video_frame_rate (GstPad *pad);
188 gboolean gst_video_get_size (GstPad *pad,
194 #endif /* __GST_VIDEO_H__ */