diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-03-08 13:03:22 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-03-08 13:03:22 +0100 |
commit | 8ebd13ee5efad33199f010e2335ee6f8bf27aab4 (patch) | |
tree | 21ce4cd1d1f1aa0ac4b550c2101cc7642b121fd3 | |
parent | 591ff74d7dab2b607d7c2831bd1a8c4db43bca4c (diff) |
videopool: only do alignment when videometa is enabled
We require the videometa activated before we can implement the alignment of
buffers. Users of the bufferpool should do this manually based on the results of
the allocation query.
-rw-r--r-- | gst-libs/gst/video/gstvideopool.c | 11 | ||||
-rw-r--r-- | gst-libs/gst/video/gstvideopool.h | 3 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gst-libs/gst/video/gstvideopool.c b/gst-libs/gst/video/gstvideopool.c index 5d2bb455a..91d07ebe3 100644 --- a/gst-libs/gst/video/gstvideopool.c +++ b/gst-libs/gst/video/gstvideopool.c @@ -142,7 +142,7 @@ struct _GstVideoBufferPoolPrivate GstCaps *caps; GstVideoInfo info; GstVideoAlignment video_align; - gboolean add_metavideo; + gboolean add_videometa; gboolean need_alignment; guint prefix; guint align; @@ -198,7 +198,7 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) priv->align = align; /* enable metadata based on config of the pool */ - priv->add_metavideo = + priv->add_videometa = gst_buffer_pool_config_has_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META); @@ -206,13 +206,10 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) priv->need_alignment = gst_buffer_pool_config_has_option (config, GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT); - if (priv->need_alignment) { + if (priv->need_alignment && priv->add_videometa) { /* get an apply the alignment to the info */ gst_buffer_pool_config_get_video_alignment (config, &priv->video_align); gst_video_info_align (&info, &priv->video_align); - - /* we need the video metadata too now */ - priv->add_metavideo = TRUE; } priv->info = info; @@ -260,7 +257,7 @@ video_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer, gst_memory_resize (mem, priv->prefix, info->size); gst_buffer_take_memory (*buffer, -1, mem); - if (priv->add_metavideo) { + if (priv->add_videometa) { GST_DEBUG_OBJECT (pool, "adding GstVideoMeta"); gst_buffer_add_video_meta_full (*buffer, 0, GST_VIDEO_INFO_FORMAT (info), diff --git a/gst-libs/gst/video/gstvideopool.h b/gst-libs/gst/video/gstvideopool.h index 40e3915c0..a573f18bb 100644 --- a/gst-libs/gst/video/gstvideopool.h +++ b/gst-libs/gst/video/gstvideopool.h @@ -39,6 +39,9 @@ G_BEGIN_DECLS * * A bufferpool option to enable extra padding. When a bufferpool supports this * option, gst_buffer_pool_config_set_video_alignment() can be called. + * + * When this option is enabled on the bufferpool, + * #GST_BUFFER_POOL_OPTION_VIDEO_META should also be enabled. */ #define GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT "GstBufferPoolOptionVideoAlignment" |