win32: Add the new audio symbols to the list of exported symbols
[platform/upstream/gstreamer.git] / gst-libs / gst / video / gstvideometa.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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GST_VIDEO_META_H__
21 #define __GST_VIDEO_META_H__
22
23 #include <gst/gst.h>
24
25 #include <gst/video/video.h>
26
27 G_BEGIN_DECLS
28
29 #define GST_VIDEO_META_API   "GstVideoMeta"
30 #define GST_VIDEO_META_INFO  (gst_video_meta_get_info())
31 typedef struct _GstVideoMeta GstVideoMeta;
32
33 #define GST_VIDEO_CROP_META_API   "GstVideoCropMeta"
34 #define GST_VIDEO_CROP_META_INFO  (gst_video_crop_meta_get_info())
35 typedef struct _GstVideoCropMeta GstVideoCropMeta;
36
37 /**
38  * GstVideoMeta:
39  * @meta: parent #GstMeta
40  * @buffer: the buffer this metadata belongs to
41  * @flags: additional video flags
42  * @format: the video format
43  * @id: identifier of the frame
44  * @width: the video width
45  * @height: the video height
46  * @n_planes: the number of planes in the image
47  * @offset: array of offsets for the planes
48  * @stride: array of strides for the planes
49  * @map: map the memory of a plane
50  * @unmap: unmap the memory of a plane
51  *
52  * Extra buffer metadata describing image properties
53  */
54 struct _GstVideoMeta {
55   GstMeta            meta;
56
57   GstBuffer         *buffer;
58
59   GstVideoFlags      flags;
60   GstVideoFormat     format;
61   gint               id;
62   guint              width;
63   guint              height;
64
65   guint              n_planes;
66   gsize              offset[GST_VIDEO_MAX_PLANES];
67   gint               stride[GST_VIDEO_MAX_PLANES];
68
69   gpointer (*map)    (GstVideoMeta *meta, guint plane, gint *stride,
70                       GstMapFlags flags);
71   gboolean (*unmap)  (GstVideoMeta *meta, guint plane, gpointer data);
72 };
73
74 const GstMetaInfo * gst_video_meta_get_info (void);
75
76 #define gst_buffer_get_video_meta(b) ((GstVideoMeta*)gst_buffer_get_meta((b),GST_VIDEO_META_INFO))
77 GstVideoMeta * gst_buffer_get_video_meta_id    (GstBuffer *buffer, gint id);
78
79 GstVideoMeta * gst_buffer_add_video_meta       (GstBuffer *buffer, GstVideoFlags flags,
80                                                 GstVideoFormat format, guint width, guint height);
81 GstVideoMeta * gst_buffer_add_video_meta_full  (GstBuffer *buffer, GstVideoFlags flags,
82                                                 GstVideoFormat format, guint width, guint height,
83                                                 guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
84                                                 gint stride[GST_VIDEO_MAX_PLANES]);
85
86 gpointer       gst_video_meta_map        (GstVideoMeta *meta, guint plane, gint *stride,
87                                           GstMapFlags flags);
88 gboolean       gst_video_meta_unmap      (GstVideoMeta *meta, guint plane, gpointer data);
89
90 /**
91  * GstVideoCropMeta:
92  * @meta: parent #GstMeta
93  * @x: the horizontal offset
94  * @y: the vertical offset
95  * @width: the cropped width
96  * @height: the cropped height
97  *
98  * Extra buffer metadata describing image cropping.
99  */
100 struct _GstVideoCropMeta {
101   GstMeta       meta;
102
103   guint         x;
104   guint         y;
105   guint         width;
106   guint         height;
107 };
108
109 const GstMetaInfo * gst_video_crop_meta_get_info (void);
110
111 #define gst_buffer_get_video_crop_meta(b) ((GstVideoCropMeta*)gst_buffer_get_meta((b),GST_VIDEO_CROP_META_INFO))
112 #define gst_buffer_add_video_crop_meta(b) ((GstVideoCropMeta*)gst_buffer_add_meta((b),GST_VIDEO_CROP_META_INFO, NULL))
113
114 G_END_DECLS
115
116 #endif /* __GST_VIDEO_META_H__ */