2 * Copyright (C) <2011> Wim Taymans <wim.taymans@gmail.com>
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.
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.
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.
20 #ifndef __GST_VIDEO_POOL_H__
21 #define __GST_VIDEO_POOL_H__
25 #include <gst/video/video.h>
30 * GST_BUFFER_POOL_OPTION_VIDEO_META:
32 * An option that can be activated on bufferpool to request video metadata
33 * on buffers from the pool.
35 #define GST_BUFFER_POOL_OPTION_VIDEO_META "GstBufferPoolOptionVideoMeta"
38 * GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT:
40 * A bufferpool option to enable extra padding. When a bufferpool supports this
41 * option, gst_buffer_pool_set_video_alignment() can be called.
43 #define GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT "GstBufferPoolOptionVideoAlignment"
45 typedef struct _GstVideoAlignment GstVideoAlignment;
49 * @padding_left: extra pixels on the left side
50 * @padding_right: extra pixels on the right side
51 * @padding_top: extra pixels on the top
52 * @padding_bottom: extra pixels on the bottom
53 * @stride_align: array with extra alignment requirements for the strides
55 * Extra alignment paramters for the memory of video buffers. This
56 * structure is usually used to configure the bufferpool if it supports the
57 * #GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT.
59 struct _GstVideoAlignment
65 guint stride_align[GST_VIDEO_MAX_PLANES];
68 void gst_video_alignment_reset (GstVideoAlignment *align);
70 /* setting a bufferpool config */
71 void gst_buffer_pool_config_set_video_alignment (GstStructure *config, GstVideoAlignment *align);
72 gboolean gst_buffer_pool_config_get_video_alignment (GstStructure *config, GstVideoAlignment *align);
74 /* video bufferpool */
75 typedef struct _GstVideoBufferPool GstVideoBufferPool;
76 typedef struct _GstVideoBufferPoolClass GstVideoBufferPoolClass;
77 typedef struct _GstVideoBufferPoolPrivate GstVideoBufferPoolPrivate;
79 #define GST_TYPE_VIDEO_BUFFER_POOL (gst_video_buffer_pool_get_type())
80 #define GST_IS_VIDEO_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_BUFFER_POOL))
81 #define GST_VIDEO_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_BUFFER_POOL, GstVideoBufferPool))
82 #define GST_VIDEO_BUFFER_POOL_CAST(obj) ((GstVideoBufferPool*)(obj))
84 struct _GstVideoBufferPool
86 GstBufferPool bufferpool;
88 GstVideoBufferPoolPrivate *priv;
91 struct _GstVideoBufferPoolClass
93 GstBufferPoolClass parent_class;
96 GType gst_video_buffer_pool_get_type (void);
98 GstBufferPool * gst_video_buffer_pool_new (void);
100 const GstAllocator * gst_video_buffer_pool_get_allocator (GstVideoBufferPool *pool);
101 void gst_video_buffer_pool_set_allocator (GstVideoBufferPool *pool,
102 const GstAllocator *allocator);
106 #endif /* __GST_VIDEO_POOL_H__ */