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