0158be05047cc34046a1cecba2ca847d04a9cfd3
[platform/upstream/gstreamer.git] / gst-libs / gst / video / video.h
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 typedef struct _GstVideoAlignment GstVideoAlignment;
26
27 #include <gst/video/video-format.h>
28 #include <gst/video/video-color.h>
29 #include <gst/video/video-info.h>
30 #include <gst/video/video-frame.h>
31 #include <gst/video/video-enumtypes.h>
32
33 G_BEGIN_DECLS
34
35 /**
36  * GstVideoAlignment:
37  * @padding_left: extra pixels on the left side
38  * @padding_right: extra pixels on the right side
39  * @padding_top: extra pixels on the top
40  * @padding_bottom: extra pixels on the bottom
41  * @stride_align: array with extra alignment requirements for the strides
42  *
43  * Extra alignment paramters for the memory of video buffers. This
44  * structure is usually used to configure the bufferpool if it supports the
45  * #GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT.
46  */
47 struct _GstVideoAlignment
48 {
49   guint padding_top;
50   guint padding_bottom;
51   guint padding_left;
52   guint padding_right;
53   guint stride_align[GST_VIDEO_MAX_PLANES];
54 };
55
56 /* metadata macros */
57 /**
58  * GST_META_TAG_VIDEO_STR:
59  *
60  * This metadata is relevant for video streams.
61  *
62  * Since: 1.2
63  */
64 #define GST_META_TAG_VIDEO_STR "video"
65 /**
66  * GST_META_TAG_VIDEO_ORIENTATION_STR:
67  *
68  * This metadata stays relevant as long as video orientation is unchanged.
69  *
70  * Since: 1.2
71  */
72 #define GST_META_TAG_VIDEO_ORIENTATION_STR "orientation"
73 /**
74  * GST_META_TAG_VIDEO_SIZE_STR:
75  *
76  * This metadata stays relevant as long as video size is unchanged.
77  *
78  * Since: 1.2
79  */
80 #define GST_META_TAG_VIDEO_SIZE_STR "size"
81 /**
82  * GST_META_TAG_VIDEO_COLORSPACE_STR:
83  *
84  * This metadata stays relevant as long as video colorspace is unchanged.
85  *
86  * Since: 1.2
87  */
88 #define GST_META_TAG_VIDEO_COLORSPACE_STR "colorspace"
89
90 void           gst_video_alignment_reset         (GstVideoAlignment *align);
91
92
93 /* some helper functions */
94 gboolean       gst_video_calculate_display_ratio (guint * dar_n,
95                                                   guint * dar_d,
96                                                   guint   video_width,
97                                                   guint   video_height,
98                                                   guint   video_par_n,
99                                                   guint   video_par_d,
100                                                   guint   display_par_n,
101                                                   guint   display_par_d);
102
103 gboolean       gst_video_guess_framerate (GstClockTime duration,
104                                           gint * dest_n, gint * dest_d);
105
106 /* convert/encode video sample from one format to another */
107
108 typedef void (*GstVideoConvertSampleCallback) (GstSample * sample, GError *error, gpointer user_data);
109
110 void          gst_video_convert_sample_async (GstSample                    * sample,
111                                               const GstCaps                * to_caps,
112                                               GstClockTime                   timeout,
113                                               GstVideoConvertSampleCallback  callback,
114                                               gpointer                       user_data,
115                                               GDestroyNotify                 destroy_notify);
116
117 GstSample *   gst_video_convert_sample       (GstSample     * sample,
118                                               const GstCaps * to_caps,
119                                               GstClockTime    timeout,
120                                               GError       ** error);
121
122 G_END_DECLS
123
124 #include <gst/video/colorbalancechannel.h>
125 #include <gst/video/colorbalance.h>
126 #include <gst/video/gstvideodecoder.h>
127 #include <gst/video/gstvideoencoder.h>
128 #include <gst/video/gstvideofilter.h>
129 #include <gst/video/gstvideometa.h>
130 #include <gst/video/gstvideopool.h>
131 #include <gst/video/gstvideosink.h>
132 #include <gst/video/gstvideoutils.h>
133 #include <gst/video/navigation.h>
134 #include <gst/video/video-blend.h>
135 #include <gst/video/video-event.h>
136 #include <gst/video/videoorientation.h>
137 #include <gst/video/video-overlay-composition.h>
138 #include <gst/video/videooverlay.h>
139
140 #endif /* __GST_VIDEO_H__ */