vaapivideobufferpool: rename local variables

Renamed local video info structure names in set_config() vitual
method. The purpose of their renaming is to clarify the origin
of those structures, whether come from passed caps parameter
(new_allocation_vinfo) or from the configured allocator
(allocator_vinfo).

https://bugzilla.gnome.org/show_bug.cgi?id=783599
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-06-08 16:05:49 +02:00
parent dce7a6f46b
commit 45faeb25e8

View file

@ -135,8 +135,8 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
GstVaapiVideoBufferPoolPrivate *const priv = GstVaapiVideoBufferPoolPrivate *const priv =
GST_VAAPI_VIDEO_BUFFER_POOL (pool)->priv; GST_VAAPI_VIDEO_BUFFER_POOL (pool)->priv;
GstCaps *caps; GstCaps *caps;
GstVideoInfo new_vip; GstVideoInfo new_allocation_vinfo;
const GstVideoInfo *alloc_vip; const GstVideoInfo *allocator_vinfo;
GstVideoAlignment align; GstVideoAlignment align;
GstAllocator *allocator; GstAllocator *allocator;
gboolean ret, updated = FALSE; gboolean ret, updated = FALSE;
@ -150,34 +150,35 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
goto error_invalid_config; goto error_invalid_config;
if (!caps) if (!caps)
goto error_no_caps; goto error_no_caps;
if (!gst_video_info_from_caps (&new_vip, caps)) if (!gst_video_info_from_caps (&new_allocation_vinfo, caps))
goto error_invalid_caps; goto error_invalid_caps;
allocator = NULL; allocator = NULL;
if (!gst_buffer_pool_config_get_allocator (config, &allocator, NULL)) if (!gst_buffer_pool_config_get_allocator (config, &allocator, NULL))
goto error_invalid_allocator; goto error_invalid_allocator;
if (gst_video_info_changed (&priv->allocation_vinfo, &new_vip)) if (gst_video_info_changed (&priv->allocation_vinfo, &new_allocation_vinfo))
gst_object_replace ((GstObject **) & priv->allocator, NULL); gst_object_replace ((GstObject **) & priv->allocator, NULL);
priv->allocation_vinfo = new_vip; priv->allocation_vinfo = new_allocation_vinfo;
{ {
guint surface_alloc_flags; guint surface_alloc_flags;
gboolean vinfo_changed = FALSE; gboolean vinfo_changed = FALSE;
if (allocator) { if (allocator) {
const GstVideoInfo *alloc_vinfo = allocator_vinfo =
gst_allocator_get_vaapi_video_info (allocator, &surface_alloc_flags); gst_allocator_get_vaapi_video_info (allocator, &surface_alloc_flags);
vinfo_changed = gst_video_info_changed (alloc_vinfo, &new_vip); vinfo_changed =
gst_video_info_changed (allocator_vinfo, &new_allocation_vinfo);
} }
if (vinfo_changed && allocator && priv->use_dmabuf_memory) { if (vinfo_changed && allocator && priv->use_dmabuf_memory) {
gst_allocator_set_vaapi_video_info (allocator, &new_vip, gst_allocator_set_vaapi_video_info (allocator, &new_allocation_vinfo,
surface_alloc_flags); surface_alloc_flags);
} else if (!priv->use_dmabuf_memory && (vinfo_changed || !allocator)) { } else if (!priv->use_dmabuf_memory && (vinfo_changed || !allocator)) {
/* let's destroy the other allocator and create a new one */ /* let's destroy the other allocator and create a new one */
allocator = gst_vaapi_video_allocator_new (priv->display, &new_vip, allocator = gst_vaapi_video_allocator_new (priv->display,
surface_alloc_flags, 0); &new_allocation_vinfo, surface_alloc_flags, 0);
gst_buffer_pool_config_set_allocator (config, allocator, NULL); gst_buffer_pool_config_set_allocator (config, allocator, NULL);
gst_object_unref (allocator); gst_object_unref (allocator);
} }
@ -196,10 +197,11 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
gst_object_unref (priv->allocator); gst_object_unref (priv->allocator);
if ((priv->allocator = allocator)) if ((priv->allocator = allocator))
gst_object_ref (allocator); gst_object_ref (allocator);
alloc_vip = gst_allocator_get_vaapi_video_info (priv->allocator, NULL); allocator_vinfo =
if (!alloc_vip) gst_allocator_get_vaapi_video_info (priv->allocator, NULL);
if (!allocator_vinfo)
goto error_create_allocator_info; goto error_create_allocator_info;
priv->vmeta_vinfo = *alloc_vip; priv->vmeta_vinfo = *allocator_vinfo;
} }
if (GST_VIDEO_INFO_SIZE (&priv->vmeta_vinfo) != size) { if (GST_VIDEO_INFO_SIZE (&priv->vmeta_vinfo) != size) {
gst_buffer_pool_config_set_params (config, caps, gst_buffer_pool_config_set_params (config, caps,