Fix FSF address
[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-event.h>
28 #include <gst/video/video-format.h>
29 #include <gst/video/video-color.h>
30 #include <gst/video/video-info.h>
31 #include <gst/video/video-frame.h>
32 #include <gst/video/video-enumtypes.h>
33
34 G_BEGIN_DECLS
35
36 /**
37  * GstVideoAlignment:
38  * @padding_left: extra pixels on the left side
39  * @padding_right: extra pixels on the right side
40  * @padding_top: extra pixels on the top
41  * @padding_bottom: extra pixels on the bottom
42  * @stride_align: array with extra alignment requirements for the strides
43  *
44  * Extra alignment paramters for the memory of video buffers. This
45  * structure is usually used to configure the bufferpool if it supports the
46  * #GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT.
47  */
48 struct _GstVideoAlignment
49 {
50   guint padding_top;
51   guint padding_bottom;
52   guint padding_left;
53   guint padding_right;
54   guint stride_align[GST_VIDEO_MAX_PLANES];
55 };
56
57 void           gst_video_alignment_reset         (GstVideoAlignment *align);
58
59
60 /* some helper functions */
61 gboolean       gst_video_calculate_display_ratio (guint * dar_n,
62                                                   guint * dar_d,
63                                                   guint   video_width,
64                                                   guint   video_height,
65                                                   guint   video_par_n,
66                                                   guint   video_par_d,
67                                                   guint   display_par_n,
68                                                   guint   display_par_d);
69
70 /* convert/encode video sample from one format to another */
71
72 typedef void (*GstVideoConvertSampleCallback) (GstSample * sample, GError *error, gpointer user_data);
73
74 void          gst_video_convert_sample_async (GstSample                    * sample,
75                                               const GstCaps                * to_caps,
76                                               GstClockTime                   timeout,
77                                               GstVideoConvertSampleCallback  callback,
78                                               gpointer                       user_data,
79                                               GDestroyNotify                 destroy_notify);
80
81 GstSample *   gst_video_convert_sample       (GstSample     * sample,
82                                               const GstCaps * to_caps,
83                                               GstClockTime    timeout,
84                                               GError       ** error);
85 G_END_DECLS
86
87 #endif /* __GST_VIDEO_H__ */