diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2018-02-15 19:22:08 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2018-02-20 10:57:12 -0600 |
commit | ad705cc5a3d45e70d2b1cb71698ebafe3c91cdc8 (patch) | |
tree | 79c5f63e6e99b958907c9cc95a2e388a922529a6 /gst | |
parent | 516d6bb3e2ceb8d1f308fbffbc2e697370b97ebe (diff) |
vaapibufferpool: don't change config when forcing video meta
VA-API based buffer might need a video meta because of different
strides. But when donwstream doesn't support video meta we need to
force the usage of video meta.
Before we changed the buffer pool configuration, but actually this
is a hack and we cannot rely on that for downstream.
This patch add a check fo raw video caps and allocator is VA-API,
then the option is enabled without changing the pool configuration.
In this case the element is responsible to copy the frame to a
simple buffer with the expected strides.
https://bugzilla.gnome.org/show_bug.cgi?id=785054
Diffstat (limited to 'gst')
-rw-r--r-- | gst/vaapi/gstvaapivideobufferpool.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c index f4b1a42f..812893ba 100644 --- a/gst/vaapi/gstvaapivideobufferpool.c +++ b/gst/vaapi/gstvaapivideobufferpool.c @@ -142,7 +142,7 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool, const GstVideoInfo *negotiated_vinfo; GstVideoAlignment align; GstAllocator *allocator; - gboolean ret, updated = FALSE; + gboolean ret; guint size, min_buffers, max_buffers; guint surface_alloc_flags; @@ -248,17 +248,16 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool, if (gst_buffer_pool_config_has_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META)) { priv->options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META; - } else { + } else if (gst_caps_is_video_raw (caps) && !priv->use_dmabuf_memory) { gint i; + for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&new_allocation_vinfo); i++) { if (GST_VIDEO_INFO_PLANE_OFFSET (&new_allocation_vinfo, i) != GST_VIDEO_INFO_PLANE_OFFSET (&priv->vmeta_vinfo, i) || GST_VIDEO_INFO_PLANE_STRIDE (&new_allocation_vinfo, i) != GST_VIDEO_INFO_PLANE_STRIDE (&priv->vmeta_vinfo, i)) { priv->options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META; - gst_buffer_pool_config_add_option (config, - GST_BUFFER_POOL_OPTION_VIDEO_META); - updated = TRUE; + GST_INFO_OBJECT (pool, "adding unrequested video meta"); break; } } @@ -277,7 +276,7 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool, ret = GST_BUFFER_POOL_CLASS (gst_vaapi_video_buffer_pool_parent_class)->set_config (pool, config); - return !updated && ret; + return ret; /* ERRORS */ error_invalid_config: |