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_H__
21#define __GST_VIDEO_H__
22
23#include <gst/gst.h>
24
25#include <gst/video/video-prelude.h>
26
27typedef struct _GstVideoAlignment GstVideoAlignment;
28
29#include <gst/video/video-format.h>
30#include <gst/video/video-color.h>
31#include <gst/video/video-dither.h>
32#include <gst/video/video-info.h>
33#include <gst/video/video-frame.h>
34#include <gst/video/video-enumtypes.h>
35#include <gst/video/video-converter.h>
36#include <gst/video/video-scaler.h>
37#include <gst/video/video-multiview.h>
38#include <gst/video/video-info-dma.h>
39
40G_BEGIN_DECLS
41
42/**
43 * GstVideoAlignment:
44 * @padding_left: extra pixels on the left side
45 * @padding_right: extra pixels on the right side
46 * @padding_top: extra pixels on the top
47 * @padding_bottom: extra pixels on the bottom
48 * @stride_align: array with extra alignment requirements for the strides
49 *
50 * Extra alignment parameters for the memory of video buffers. This
51 * structure is usually used to configure the bufferpool if it supports the
52 * #GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT.
53 */
54struct _GstVideoAlignment
55{
56 guint padding_top;
57 guint padding_bottom;
58 guint padding_left;
59 guint padding_right;
60 guint stride_align[GST_VIDEO_MAX_PLANES];
61};
62
63/**
64 * GstVideoOrientationMethod:
65 * @GST_VIDEO_ORIENTATION_IDENTITY: Identity (no rotation)
66 * @GST_VIDEO_ORIENTATION_90R: Rotate clockwise 90 degrees
67 * @GST_VIDEO_ORIENTATION_180: Rotate 180 degrees
68 * @GST_VIDEO_ORIENTATION_90L: Rotate counter-clockwise 90 degrees
69 * @GST_VIDEO_ORIENTATION_HORIZ: Flip horizontally
70 * @GST_VIDEO_ORIENTATION_VERT: Flip vertically
71 * @GST_VIDEO_ORIENTATION_UL_LR: Flip across upper left/lower right diagonal
72 * @GST_VIDEO_ORIENTATION_UR_LL: Flip across upper right/lower left diagonal
73 * @GST_VIDEO_ORIENTATION_AUTO: Select flip method based on image-orientation tag
74 * @GST_VIDEO_ORIENTATION_CUSTOM: Current status depends on plugin internal setup
75 *
76 * The different video orientation methods.
77 *
78 * Since: 1.10
79 */
80typedef enum {
81 GST_VIDEO_ORIENTATION_IDENTITY,
82 GST_VIDEO_ORIENTATION_90R,
83 GST_VIDEO_ORIENTATION_180,
84 GST_VIDEO_ORIENTATION_90L,
85 GST_VIDEO_ORIENTATION_HORIZ,
86 GST_VIDEO_ORIENTATION_VERT,
87 GST_VIDEO_ORIENTATION_UL_LR,
88 GST_VIDEO_ORIENTATION_UR_LL,
89 GST_VIDEO_ORIENTATION_AUTO,
90 GST_VIDEO_ORIENTATION_CUSTOM,
91} GstVideoOrientationMethod;
92
93/**
94 * GST_TYPE_VIDEO_ORIENTATION_METHOD:
95 *
96 * Since: 1.20
97 */
98
99/* metadata macros */
100/**
101 * GST_META_TAG_VIDEO_STR:
102 *
103 * This metadata is relevant for video streams.
104 *
105 * Since: 1.2
106 */
107#define GST_META_TAG_VIDEO_STR "video"
108/**
109 * GST_META_TAG_VIDEO_ORIENTATION_STR:
110 *
111 * This metadata stays relevant as long as video orientation is unchanged.
112 *
113 * Since: 1.2
114 */
115#define GST_META_TAG_VIDEO_ORIENTATION_STR "orientation"
116/**
117 * GST_META_TAG_VIDEO_SIZE_STR:
118 *
119 * This metadata stays relevant as long as video size is unchanged.
120 *
121 * Since: 1.2
122 */
123#define GST_META_TAG_VIDEO_SIZE_STR "size"
124/**
125 * GST_META_TAG_VIDEO_COLORSPACE_STR:
126 *
127 * This metadata stays relevant as long as video colorspace is unchanged.
128 *
129 * Since: 1.2
130 */
131#define GST_META_TAG_VIDEO_COLORSPACE_STR "colorspace"
132
133GST_VIDEO_API
134void gst_video_alignment_reset (GstVideoAlignment *align);
135
136
137/* some helper functions */
138
139GST_VIDEO_API
140gboolean gst_video_calculate_display_ratio (guint * dar_n,
141 guint * dar_d,
142 guint video_width,
143 guint video_height,
144 guint video_par_n,
145 guint video_par_d,
146 guint display_par_n,
147 guint display_par_d);
148
149GST_VIDEO_API
150gboolean gst_video_guess_framerate (GstClockTime duration,
151 gint * dest_n, gint * dest_d);
152
153GST_VIDEO_API
154gboolean gst_video_is_common_aspect_ratio (gint width, gint height, gint par_n, gint par_d);
155
156/* convert/encode video sample from one format to another */
157
158typedef void (*GstVideoConvertSampleCallback) (GstSample * sample, GError *error, gpointer user_data);
159
160GST_VIDEO_API
161void gst_video_convert_sample_async (GstSample * sample,
162 const GstCaps * to_caps,
163 GstClockTime timeout,
164 GstVideoConvertSampleCallback callback,
165 gpointer user_data,
166 GDestroyNotify destroy_notify);
167
168GST_VIDEO_API
169GstSample * gst_video_convert_sample (GstSample * sample,
170 const GstCaps * to_caps,
171 GstClockTime timeout,
172 GError ** error);
173
174
175GST_VIDEO_API
176gboolean gst_video_orientation_from_tag (GstTagList * taglist,
177 GstVideoOrientationMethod * method);
178
179G_END_DECLS
180
181#include <gst/video/colorbalancechannel.h>
182#include <gst/video/colorbalance.h>
183#include <gst/video/gstvideoaffinetransformationmeta.h>
184#include <gst/video/gstvideoaggregator.h>
185#include <gst/video/gstvideocodecalphameta.h>
186#include <gst/video/gstvideodecoder.h>
187#include <gst/video/gstvideoencoder.h>
188#include <gst/video/gstvideofilter.h>
189#include <gst/video/gstvideometa.h>
190#include <gst/video/gstvideopool.h>
191#include <gst/video/gstvideosink.h>
192#include <gst/video/gstvideotimecode.h>
193#include <gst/video/gstvideoutils.h>
194#include <gst/video/navigation.h>
195#include <gst/video/video-anc.h>
196#include <gst/video/video-blend.h>
197#include <gst/video/videodirection.h>
198#include <gst/video/video-event.h>
199#include <gst/video/video-hdr.h>
200#include <gst/video/videoorientation.h>
201#include <gst/video/video-overlay-composition.h>
202#include <gst/video/videooverlay.h>
203#include <gst/video/video-sei.h>
204
205#endif /* __GST_VIDEO_H__ */
206

source code of include/gstreamer-1.0/gst/video/video.h