| 1 | /* GStreamer |
| 2 | * Copyright (C) <2011> Wim Taymans <wim.taymans@gmail.com> |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public |
| 15 | * License along with this library; if not, write to the |
| 16 | * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __GST_VIDEO_INFO_H__ |
| 21 | #define __GST_VIDEO_INFO_H__ |
| 22 | |
| 23 | #include <gst/gst.h> |
| 24 | #include <gst/video/video-format.h> |
| 25 | #include <gst/video/video-color.h> |
| 26 | |
| 27 | G_BEGIN_DECLS |
| 28 | |
| 29 | #include <gst/video/video-enumtypes.h> |
| 30 | |
| 31 | typedef struct _GstVideoInfo GstVideoInfo; |
| 32 | |
| 33 | /** |
| 34 | * GST_CAPS_FEATURE_FORMAT_INTERLACED: |
| 35 | * |
| 36 | * Name of the caps feature indicating that the stream is interlaced. Currently |
| 37 | * it is only used for video. |
| 38 | * |
| 39 | * Since: 1.16. |
| 40 | */ |
| 41 | #define GST_CAPS_FEATURE_FORMAT_INTERLACED "format:Interlaced" |
| 42 | |
| 43 | /** |
| 44 | * GstVideoInterlaceMode: |
| 45 | * @GST_VIDEO_INTERLACE_MODE_PROGRESSIVE: all frames are progressive |
| 46 | * @GST_VIDEO_INTERLACE_MODE_INTERLEAVED: 2 fields are interleaved in one video |
| 47 | * frame. Extra buffer flags describe the field order. |
| 48 | * @GST_VIDEO_INTERLACE_MODE_MIXED: frames contains both interlaced and |
| 49 | * progressive video, the buffer flags describe the frame and fields. |
| 50 | * @GST_VIDEO_INTERLACE_MODE_FIELDS: 2 fields are stored in one buffer, use the |
| 51 | * frame ID to get access to the required field. For multiview (the |
| 52 | * 'views' property > 1) the fields of view N can be found at frame ID |
| 53 | * (N * 2) and (N * 2) + 1. |
| 54 | * Each field has only half the amount of lines as noted in the |
| 55 | * height property. This mode requires multiple GstVideoMeta metadata |
| 56 | * to describe the fields. |
| 57 | * @GST_VIDEO_INTERLACE_MODE_ALTERNATE: 1 field is stored in one buffer, |
| 58 | * @GST_VIDEO_BUFFER_FLAG_TF or @GST_VIDEO_BUFFER_FLAG_BF indicates if |
| 59 | * the buffer is carrying the top or bottom field, respectively. The top and |
| 60 | * bottom buffers are expected to alternate in the pipeline, with this mode |
| 61 | * (Since: 1.16). |
| 62 | * |
| 63 | * The possible values of the #GstVideoInterlaceMode describing the interlace |
| 64 | * mode of the stream. |
| 65 | */ |
| 66 | typedef enum { |
| 67 | GST_VIDEO_INTERLACE_MODE_PROGRESSIVE = 0, |
| 68 | GST_VIDEO_INTERLACE_MODE_INTERLEAVED, |
| 69 | GST_VIDEO_INTERLACE_MODE_MIXED, |
| 70 | GST_VIDEO_INTERLACE_MODE_FIELDS, |
| 71 | GST_VIDEO_INTERLACE_MODE_ALTERNATE, |
| 72 | } GstVideoInterlaceMode; |
| 73 | |
| 74 | GST_VIDEO_API |
| 75 | const gchar * gst_video_interlace_mode_to_string (GstVideoInterlaceMode mode); |
| 76 | |
| 77 | GST_VIDEO_API |
| 78 | GstVideoInterlaceMode gst_video_interlace_mode_from_string (const gchar * mode); |
| 79 | |
| 80 | /** |
| 81 | * GstVideoMultiviewMode: |
| 82 | * @GST_VIDEO_MULTIVIEW_MODE_NONE: A special value indicating |
| 83 | * no multiview information. Used in GstVideoInfo and other places to |
| 84 | * indicate that no specific multiview handling has been requested or |
| 85 | * provided. This value is never carried on caps. |
| 86 | * @GST_VIDEO_MULTIVIEW_MODE_MONO: All frames are monoscopic. |
| 87 | * @GST_VIDEO_MULTIVIEW_MODE_LEFT: All frames represent a left-eye view. |
| 88 | * @GST_VIDEO_MULTIVIEW_MODE_RIGHT: All frames represent a right-eye view. |
| 89 | * @GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE: Left and right eye views are |
| 90 | * provided in the left and right half of the frame respectively. |
| 91 | * @GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE_QUINCUNX: Left and right eye |
| 92 | * views are provided in the left and right half of the frame, but |
| 93 | * have been sampled using quincunx method, with half-pixel offset |
| 94 | * between the 2 views. |
| 95 | * @GST_VIDEO_MULTIVIEW_MODE_COLUMN_INTERLEAVED: Alternating vertical |
| 96 | * columns of pixels represent the left and right eye view respectively. |
| 97 | * @GST_VIDEO_MULTIVIEW_MODE_ROW_INTERLEAVED: Alternating horizontal |
| 98 | * rows of pixels represent the left and right eye view respectively. |
| 99 | * @GST_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM: The top half of the frame |
| 100 | * contains the left eye, and the bottom half the right eye. |
| 101 | * @GST_VIDEO_MULTIVIEW_MODE_CHECKERBOARD: Pixels are arranged with |
| 102 | * alternating pixels representing left and right eye views in a |
| 103 | * checkerboard fashion. |
| 104 | * @GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME: Left and right eye views |
| 105 | * are provided in separate frames alternately. |
| 106 | * @GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME: Multiple |
| 107 | * independent views are provided in separate frames in sequence. |
| 108 | * This method only applies to raw video buffers at the moment. |
| 109 | * Specific view identification is via the #GstVideoMultiviewMeta |
| 110 | * and #GstVideoMeta(s) on raw video buffers. |
| 111 | * @GST_VIDEO_MULTIVIEW_MODE_SEPARATED: Multiple views are |
| 112 | * provided as separate #GstMemory framebuffers attached to each |
| 113 | * #GstBuffer, described by the #GstVideoMultiviewMeta |
| 114 | * and #GstVideoMeta(s) |
| 115 | * |
| 116 | * All possible stereoscopic 3D and multiview representations. |
| 117 | * In conjunction with #GstVideoMultiviewFlags, describes how |
| 118 | * multiview content is being transported in the stream. |
| 119 | */ |
| 120 | typedef enum { |
| 121 | GST_VIDEO_MULTIVIEW_MODE_NONE = -1, |
| 122 | GST_VIDEO_MULTIVIEW_MODE_MONO = 0, |
| 123 | /* Single view modes */ |
| 124 | GST_VIDEO_MULTIVIEW_MODE_LEFT, |
| 125 | GST_VIDEO_MULTIVIEW_MODE_RIGHT, |
| 126 | /* Stereo view modes */ |
| 127 | GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE, |
| 128 | GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE_QUINCUNX, |
| 129 | GST_VIDEO_MULTIVIEW_MODE_COLUMN_INTERLEAVED, |
| 130 | GST_VIDEO_MULTIVIEW_MODE_ROW_INTERLEAVED, |
| 131 | GST_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM, |
| 132 | GST_VIDEO_MULTIVIEW_MODE_CHECKERBOARD, |
| 133 | /* Padding for new frame packing modes */ |
| 134 | |
| 135 | GST_VIDEO_MULTIVIEW_MODE_FRAME_BY_FRAME = 32, |
| 136 | /* Multivew mode(s) */ |
| 137 | GST_VIDEO_MULTIVIEW_MODE_MULTIVIEW_FRAME_BY_FRAME, |
| 138 | GST_VIDEO_MULTIVIEW_MODE_SEPARATED |
| 139 | /* future expansion for annotated modes */ |
| 140 | } GstVideoMultiviewMode; |
| 141 | |
| 142 | /** |
| 143 | * GstVideoMultiviewFramePacking: |
| 144 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_NONE: A special value indicating |
| 145 | * no frame packing info. |
| 146 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_MONO: All frames are monoscopic. |
| 147 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_LEFT: All frames represent a left-eye view. |
| 148 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_RIGHT: All frames represent a right-eye view. |
| 149 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_SIDE_BY_SIDE: Left and right eye views are |
| 150 | * provided in the left and right half of the frame respectively. |
| 151 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_SIDE_BY_SIDE_QUINCUNX: Left and right eye |
| 152 | * views are provided in the left and right half of the frame, but |
| 153 | * have been sampled using quincunx method, with half-pixel offset |
| 154 | * between the 2 views. |
| 155 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_COLUMN_INTERLEAVED: Alternating vertical |
| 156 | * columns of pixels represent the left and right eye view respectively. |
| 157 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_ROW_INTERLEAVED: Alternating horizontal |
| 158 | * rows of pixels represent the left and right eye view respectively. |
| 159 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_TOP_BOTTOM: The top half of the frame |
| 160 | * contains the left eye, and the bottom half the right eye. |
| 161 | * @GST_VIDEO_MULTIVIEW_FRAME_PACKING_CHECKERBOARD: Pixels are arranged with |
| 162 | * alternating pixels representing left and right eye views in a |
| 163 | * checkerboard fashion. |
| 164 | * |
| 165 | * #GstVideoMultiviewFramePacking represents the subset of #GstVideoMultiviewMode |
| 166 | * values that can be applied to any video frame without needing extra metadata. |
| 167 | * It can be used by elements that provide a property to override the |
| 168 | * multiview interpretation of a video stream when the video doesn't contain |
| 169 | * any markers. |
| 170 | * |
| 171 | * This enum is used (for example) on playbin, to re-interpret a played |
| 172 | * video stream as a stereoscopic video. The individual enum values are |
| 173 | * equivalent to and have the same value as the matching #GstVideoMultiviewMode. |
| 174 | * |
| 175 | */ |
| 176 | typedef enum { |
| 177 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_NONE = GST_VIDEO_MULTIVIEW_MODE_NONE, |
| 178 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_MONO = GST_VIDEO_MULTIVIEW_MODE_MONO, |
| 179 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_LEFT = GST_VIDEO_MULTIVIEW_MODE_LEFT, |
| 180 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_RIGHT = GST_VIDEO_MULTIVIEW_MODE_RIGHT, |
| 181 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_SIDE_BY_SIDE = GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE, |
| 182 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_SIDE_BY_SIDE_QUINCUNX = GST_VIDEO_MULTIVIEW_MODE_SIDE_BY_SIDE_QUINCUNX, |
| 183 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_COLUMN_INTERLEAVED = GST_VIDEO_MULTIVIEW_MODE_COLUMN_INTERLEAVED, |
| 184 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_ROW_INTERLEAVED = GST_VIDEO_MULTIVIEW_MODE_ROW_INTERLEAVED, |
| 185 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_TOP_BOTTOM = GST_VIDEO_MULTIVIEW_MODE_TOP_BOTTOM, |
| 186 | GST_VIDEO_MULTIVIEW_FRAME_PACKING_CHECKERBOARD = GST_VIDEO_MULTIVIEW_MODE_CHECKERBOARD |
| 187 | } GstVideoMultiviewFramePacking; |
| 188 | |
| 189 | #define GST_VIDEO_MULTIVIEW_MAX_FRAME_PACKING GST_VIDEO_MULTIVIEW_FRAME_PACKING_CHECKERBOARD |
| 190 | |
| 191 | /** |
| 192 | * GstVideoMultiviewFlags: |
| 193 | * @GST_VIDEO_MULTIVIEW_FLAGS_NONE: No flags |
| 194 | * @GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST: For stereo streams, the |
| 195 | * normal arrangement of left and right views is reversed. |
| 196 | * @GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED: The left view is vertically |
| 197 | * mirrored. |
| 198 | * @GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED: The left view is horizontally |
| 199 | * mirrored. |
| 200 | * @GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED: The right view is |
| 201 | * vertically mirrored. |
| 202 | * @GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED: The right view is |
| 203 | * horizontally mirrored. |
| 204 | * @GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT: For frame-packed |
| 205 | * multiview modes, indicates that the individual |
| 206 | * views have been encoded with half the true width or height |
| 207 | * and should be scaled back up for display. This flag |
| 208 | * is used for overriding input layout interpretation |
| 209 | * by adjusting pixel-aspect-ratio. |
| 210 | * For side-by-side, column interleaved or checkerboard packings, the |
| 211 | * pixel width will be doubled. For row interleaved and top-bottom |
| 212 | * encodings, pixel height will be doubled. |
| 213 | * @GST_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO: The video stream contains both |
| 214 | * mono and multiview portions, signalled on each buffer by the |
| 215 | * absence or presence of the @GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW |
| 216 | * buffer flag. |
| 217 | * |
| 218 | * GstVideoMultiviewFlags are used to indicate extra properties of a |
| 219 | * stereo/multiview stream beyond the frame layout and buffer mapping |
| 220 | * that is conveyed in the #GstVideoMultiviewMode. |
| 221 | */ |
| 222 | typedef enum { |
| 223 | GST_VIDEO_MULTIVIEW_FLAGS_NONE = 0, |
| 224 | GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_VIEW_FIRST = (1 << 0), |
| 225 | GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLIPPED = (1 << 1), |
| 226 | GST_VIDEO_MULTIVIEW_FLAGS_LEFT_FLOPPED = (1 << 2), |
| 227 | GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLIPPED = (1 << 3), |
| 228 | GST_VIDEO_MULTIVIEW_FLAGS_RIGHT_FLOPPED = (1 << 4), |
| 229 | GST_VIDEO_MULTIVIEW_FLAGS_HALF_ASPECT = (1 << 14), |
| 230 | GST_VIDEO_MULTIVIEW_FLAGS_MIXED_MONO = (1 << 15) |
| 231 | } GstVideoMultiviewFlags; |
| 232 | |
| 233 | /** |
| 234 | * GstVideoFlags: |
| 235 | * @GST_VIDEO_FLAG_NONE: no flags |
| 236 | * @GST_VIDEO_FLAG_VARIABLE_FPS: a variable fps is selected, fps_n and fps_d |
| 237 | * denote the maximum fps of the video |
| 238 | * @GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA: Each color has been scaled by the alpha |
| 239 | * value. |
| 240 | * |
| 241 | * Extra video flags |
| 242 | */ |
| 243 | typedef enum { |
| 244 | GST_VIDEO_FLAG_NONE = 0, |
| 245 | GST_VIDEO_FLAG_VARIABLE_FPS = (1 << 0), |
| 246 | GST_VIDEO_FLAG_PREMULTIPLIED_ALPHA = (1 << 1) |
| 247 | } GstVideoFlags; |
| 248 | |
| 249 | /** |
| 250 | * GstVideoFieldOrder: |
| 251 | * @GST_VIDEO_FIELD_ORDER_UNKNOWN: unknown field order for interlaced content. |
| 252 | * The actual field order is signalled via buffer flags. |
| 253 | * @GST_VIDEO_FIELD_ORDER_TOP_FIELD_FIRST: top field is first |
| 254 | * @GST_VIDEO_FIELD_ORDER_BOTTOM_FIELD_FIRST: bottom field is first |
| 255 | * |
| 256 | * Field order of interlaced content. This is only valid for |
| 257 | * interlace-mode=interleaved and not interlace-mode=mixed. In the case of |
| 258 | * mixed or GST_VIDEO_FIELD_ORDER_UNKOWN, the field order is signalled via |
| 259 | * buffer flags. |
| 260 | * |
| 261 | * Since: 1.12 |
| 262 | */ |
| 263 | typedef enum { |
| 264 | GST_VIDEO_FIELD_ORDER_UNKNOWN = 0, |
| 265 | GST_VIDEO_FIELD_ORDER_TOP_FIELD_FIRST = 1, |
| 266 | GST_VIDEO_FIELD_ORDER_BOTTOM_FIELD_FIRST = 2, |
| 267 | } GstVideoFieldOrder; |
| 268 | |
| 269 | GST_VIDEO_API |
| 270 | const gchar * gst_video_field_order_to_string (GstVideoFieldOrder order); |
| 271 | |
| 272 | GST_VIDEO_API |
| 273 | GstVideoFieldOrder gst_video_field_order_from_string (const gchar * order); |
| 274 | |
| 275 | /** |
| 276 | * GstVideoInfo: |
| 277 | * @finfo: the format info of the video |
| 278 | * @interlace_mode: the interlace mode |
| 279 | * @flags: additional video flags |
| 280 | * @width: the width of the video |
| 281 | * @height: the height of the video |
| 282 | * @views: the number of views for multiview video |
| 283 | * @size: the default size of one frame |
| 284 | * @chroma_site: a #GstVideoChromaSite. |
| 285 | * @colorimetry: the colorimetry info |
| 286 | * @par_n: the pixel-aspect-ratio numerator |
| 287 | * @par_d: the pixel-aspect-ratio demnominator |
| 288 | * @fps_n: the framerate numerator |
| 289 | * @fps_d: the framerate demnominator |
| 290 | * @offset: offsets of the planes |
| 291 | * @stride: strides of the planes |
| 292 | * @multiview_mode: delivery mode for multiple views. (Since 1.6) |
| 293 | * @multiview_flags: flags for multiple views configuration (Since 1.6) |
| 294 | * |
| 295 | * Information describing image properties. This information can be filled |
| 296 | * in from GstCaps with gst_video_info_from_caps(). The information is also used |
| 297 | * to store the specific video info when mapping a video frame with |
| 298 | * gst_video_frame_map(). |
| 299 | * |
| 300 | * Use the provided macros to access the info in this structure. |
| 301 | */ |
| 302 | struct _GstVideoInfo { |
| 303 | const GstVideoFormatInfo *finfo; |
| 304 | |
| 305 | GstVideoInterlaceMode interlace_mode; |
| 306 | GstVideoFlags flags; |
| 307 | gint width; |
| 308 | gint height; |
| 309 | gsize size; |
| 310 | gint views; |
| 311 | |
| 312 | GstVideoChromaSite chroma_site; |
| 313 | GstVideoColorimetry colorimetry; |
| 314 | |
| 315 | gint par_n; |
| 316 | gint par_d; |
| 317 | gint fps_n; |
| 318 | gint fps_d; |
| 319 | |
| 320 | gsize offset[GST_VIDEO_MAX_PLANES]; |
| 321 | gint stride[GST_VIDEO_MAX_PLANES]; |
| 322 | |
| 323 | /* Union preserves padded struct size for backwards compat |
| 324 | * Consumer code should use the accessor macros for fields */ |
| 325 | union { |
| 326 | struct { |
| 327 | GstVideoMultiviewMode multiview_mode; |
| 328 | GstVideoMultiviewFlags multiview_flags; |
| 329 | GstVideoFieldOrder field_order; |
| 330 | } abi; |
| 331 | /*< private >*/ |
| 332 | gpointer _gst_reserved[GST_PADDING]; |
| 333 | } ABI; |
| 334 | }; |
| 335 | |
| 336 | #define GST_TYPE_VIDEO_INFO (gst_video_info_get_type ()) |
| 337 | GST_VIDEO_API |
| 338 | GType gst_video_info_get_type (void); |
| 339 | |
| 340 | /* general info */ |
| 341 | #define GST_VIDEO_INFO_FORMAT(i) (GST_VIDEO_FORMAT_INFO_FORMAT((i)->finfo)) |
| 342 | #define GST_VIDEO_INFO_NAME(i) (GST_VIDEO_FORMAT_INFO_NAME((i)->finfo)) |
| 343 | #define GST_VIDEO_INFO_IS_YUV(i) (GST_VIDEO_FORMAT_INFO_IS_YUV((i)->finfo)) |
| 344 | #define GST_VIDEO_INFO_IS_RGB(i) (GST_VIDEO_FORMAT_INFO_IS_RGB((i)->finfo)) |
| 345 | #define GST_VIDEO_INFO_IS_GRAY(i) (GST_VIDEO_FORMAT_INFO_IS_GRAY((i)->finfo)) |
| 346 | #define GST_VIDEO_INFO_HAS_ALPHA(i) (GST_VIDEO_FORMAT_INFO_HAS_ALPHA((i)->finfo)) |
| 347 | |
| 348 | #define GST_VIDEO_INFO_INTERLACE_MODE(i) ((i)->interlace_mode) |
| 349 | #define GST_VIDEO_INFO_IS_INTERLACED(i) ((i)->interlace_mode != GST_VIDEO_INTERLACE_MODE_PROGRESSIVE) |
| 350 | #define GST_VIDEO_INFO_FIELD_ORDER(i) ((i)->ABI.abi.field_order) |
| 351 | #define GST_VIDEO_INFO_FLAGS(i) ((i)->flags) |
| 352 | #define GST_VIDEO_INFO_WIDTH(i) ((i)->width) |
| 353 | #define GST_VIDEO_INFO_HEIGHT(i) ((i)->height) |
| 354 | /** |
| 355 | * GST_VIDEO_INFO_FIELD_HEIGHT: |
| 356 | * |
| 357 | * The height of a field. It's the height of the full frame unless split-field |
| 358 | * (alternate) interlacing is in use. |
| 359 | * |
| 360 | * Since: 1.16. |
| 361 | */ |
| 362 | #define GST_VIDEO_INFO_FIELD_HEIGHT(i) ((i)->interlace_mode == GST_VIDEO_INTERLACE_MODE_ALTERNATE? (i)->height / 2 : (i)->height) |
| 363 | #define GST_VIDEO_INFO_SIZE(i) ((i)->size) |
| 364 | #define GST_VIDEO_INFO_VIEWS(i) ((i)->views) |
| 365 | #define GST_VIDEO_INFO_PAR_N(i) ((i)->par_n) |
| 366 | #define GST_VIDEO_INFO_PAR_D(i) ((i)->par_d) |
| 367 | #define GST_VIDEO_INFO_FPS_N(i) ((i)->fps_n) |
| 368 | #define GST_VIDEO_INFO_FIELD_RATE_N(i) ((GST_VIDEO_INFO_INTERLACE_MODE ((i)) == \ |
| 369 | GST_VIDEO_INTERLACE_MODE_ALTERNATE) ? \ |
| 370 | (i)->fps_n * 2 : (i)->fps_n) |
| 371 | #define GST_VIDEO_INFO_FPS_D(i) ((i)->fps_d) |
| 372 | |
| 373 | #define GST_VIDEO_INFO_COLORIMETRY(i) ((i)->colorimetry) |
| 374 | #define GST_VIDEO_INFO_CHROMA_SITE(i) ((i)->chroma_site) |
| 375 | |
| 376 | #define GST_VIDEO_INFO_MULTIVIEW_MODE(i) ((i)->ABI.abi.multiview_mode) |
| 377 | #define GST_VIDEO_INFO_MULTIVIEW_FLAGS(i) ((i)->ABI.abi.multiview_flags) |
| 378 | |
| 379 | /* dealing with GstVideoInfo flags */ |
| 380 | #define GST_VIDEO_INFO_FLAG_IS_SET(i,flag) ((GST_VIDEO_INFO_FLAGS(i) & (flag)) == (flag)) |
| 381 | #define GST_VIDEO_INFO_FLAG_SET(i,flag) (GST_VIDEO_INFO_FLAGS(i) |= (flag)) |
| 382 | #define GST_VIDEO_INFO_FLAG_UNSET(i,flag) (GST_VIDEO_INFO_FLAGS(i) &= ~(flag)) |
| 383 | |
| 384 | /* dealing with planes */ |
| 385 | #define GST_VIDEO_INFO_N_PLANES(i) (GST_VIDEO_FORMAT_INFO_N_PLANES((i)->finfo)) |
| 386 | #define GST_VIDEO_INFO_PLANE_OFFSET(i,p) ((i)->offset[p]) |
| 387 | #define GST_VIDEO_INFO_PLANE_STRIDE(i,p) ((i)->stride[p]) |
| 388 | |
| 389 | /* dealing with components */ |
| 390 | #define GST_VIDEO_INFO_N_COMPONENTS(i) GST_VIDEO_FORMAT_INFO_N_COMPONENTS((i)->finfo) |
| 391 | #define GST_VIDEO_INFO_COMP_DEPTH(i,c) GST_VIDEO_FORMAT_INFO_DEPTH((i)->finfo,(c)) |
| 392 | #define GST_VIDEO_INFO_COMP_DATA(i,d,c) GST_VIDEO_FORMAT_INFO_DATA((i)->finfo,d,(c)) |
| 393 | #define GST_VIDEO_INFO_COMP_OFFSET(i,c) GST_VIDEO_FORMAT_INFO_OFFSET((i)->finfo,(i)->offset,(c)) |
| 394 | #define GST_VIDEO_INFO_COMP_STRIDE(i,c) GST_VIDEO_FORMAT_INFO_STRIDE((i)->finfo,(i)->stride,(c)) |
| 395 | #define GST_VIDEO_INFO_COMP_WIDTH(i,c) GST_VIDEO_FORMAT_INFO_SCALE_WIDTH((i)->finfo,(c),(i)->width) |
| 396 | #define GST_VIDEO_INFO_COMP_HEIGHT(i,c) GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT((i)->finfo,(c),GST_VIDEO_INFO_FIELD_HEIGHT(i)) |
| 397 | #define GST_VIDEO_INFO_COMP_PLANE(i,c) GST_VIDEO_FORMAT_INFO_PLANE((i)->finfo,(c)) |
| 398 | #define GST_VIDEO_INFO_COMP_PSTRIDE(i,c) GST_VIDEO_FORMAT_INFO_PSTRIDE((i)->finfo,(c)) |
| 399 | #define GST_VIDEO_INFO_COMP_POFFSET(i,c) GST_VIDEO_FORMAT_INFO_POFFSET((i)->finfo,(c)) |
| 400 | |
| 401 | GST_VIDEO_API |
| 402 | GstVideoInfo * gst_video_info_new (void); |
| 403 | |
| 404 | GST_VIDEO_API |
| 405 | void gst_video_info_init (GstVideoInfo *info); |
| 406 | |
| 407 | GST_VIDEO_API |
| 408 | GstVideoInfo * gst_video_info_copy (const GstVideoInfo *info); |
| 409 | |
| 410 | GST_VIDEO_API |
| 411 | void gst_video_info_free (GstVideoInfo *info); |
| 412 | |
| 413 | GST_VIDEO_API |
| 414 | gboolean gst_video_info_set_format (GstVideoInfo *info, GstVideoFormat format, |
| 415 | guint width, guint height); |
| 416 | |
| 417 | GST_VIDEO_API |
| 418 | gboolean gst_video_info_set_interlaced_format |
| 419 | (GstVideoInfo *info, |
| 420 | GstVideoFormat format, |
| 421 | GstVideoInterlaceMode mode, |
| 422 | guint width, |
| 423 | guint height); |
| 424 | |
| 425 | GST_VIDEO_API |
| 426 | gboolean gst_video_info_from_caps (GstVideoInfo *info, const GstCaps * caps); |
| 427 | |
| 428 | GST_VIDEO_API |
| 429 | GstCaps * gst_video_info_to_caps (GstVideoInfo *info); |
| 430 | |
| 431 | GST_VIDEO_API |
| 432 | gboolean gst_video_info_convert (GstVideoInfo *info, |
| 433 | GstFormat src_format, |
| 434 | gint64 src_value, |
| 435 | GstFormat dest_format, |
| 436 | gint64 *dest_value); |
| 437 | |
| 438 | GST_VIDEO_API |
| 439 | gboolean gst_video_info_is_equal (const GstVideoInfo *info, |
| 440 | const GstVideoInfo *other); |
| 441 | |
| 442 | #include <gst/video/video.h> |
| 443 | |
| 444 | GST_VIDEO_API |
| 445 | gboolean gst_video_info_align (GstVideoInfo * info, GstVideoAlignment * align); |
| 446 | |
| 447 | |
| 448 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC |
| 449 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVideoInfo, gst_video_info_free) |
| 450 | #endif |
| 451 | |
| 452 | G_END_DECLS |
| 453 | |
| 454 | #endif /* __GST_VIDEO_INFO_H__ */ |
| 455 | |