vaapi: use gst_clear_object instead of g_clear_object

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/406>
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-12-12 10:30:41 +01:00
parent 5bee089331
commit a16849b4ed
3 changed files with 13 additions and 13 deletions

View file

@ -411,7 +411,7 @@ gst_vaapi_decode_bin_init (GstVaapiDecodeBin * vaapidecbin)
/* create the queue */ /* create the queue */
vaapidecbin->queue = gst_element_factory_make ("queue", "vaapi-queue"); vaapidecbin->queue = gst_element_factory_make ("queue", "vaapi-queue");
if (!vaapidecbin->queue) { if (!vaapidecbin->queue) {
g_clear_object (&vaapidecbin->decoder); gst_clear_object (&vaapidecbin->decoder);
post_missing_element_message (vaapidecbin, "queue"); post_missing_element_message (vaapidecbin, "queue");
return; return;
} }
@ -420,8 +420,8 @@ gst_vaapi_decode_bin_init (GstVaapiDecodeBin * vaapidecbin)
vaapidecbin->queue, NULL); vaapidecbin->queue, NULL);
if (!gst_element_link (vaapidecbin->decoder, vaapidecbin->queue)) { if (!gst_element_link (vaapidecbin->decoder, vaapidecbin->queue)) {
g_clear_object (&vaapidecbin->decoder); gst_clear_object (&vaapidecbin->decoder);
g_clear_object (&vaapidecbin->queue); gst_clear_object (&vaapidecbin->queue);
g_critical ("failed to link decoder and queue"); g_critical ("failed to link decoder and queue");
return; return;
} }

View file

@ -61,13 +61,13 @@ gst_vaapi_pad_private_reset (GstVaapiPadPrivate * priv)
gst_caps_replace (&priv->caps, NULL); gst_caps_replace (&priv->caps, NULL);
gst_video_info_init (&priv->info); gst_video_info_init (&priv->info);
g_clear_object (&priv->buffer_pool); gst_clear_object (&priv->buffer_pool);
g_clear_object (&priv->allocator); gst_clear_object (&priv->allocator);
priv->buffer_size = 0; priv->buffer_size = 0;
priv->caps_is_raw = FALSE; priv->caps_is_raw = FALSE;
g_clear_object (&priv->other_allocator); gst_clear_object (&priv->other_allocator);
} }
void void
@ -765,8 +765,8 @@ ensure_sinkpad_buffer_pool (GstVaapiPluginBase * plugin, GstPad * sinkpad)
if (gst_vaapi_buffer_pool_caps_is_equal (sinkpriv->buffer_pool, caps)) if (gst_vaapi_buffer_pool_caps_is_equal (sinkpriv->buffer_pool, caps))
return TRUE; return TRUE;
gst_buffer_pool_set_active (sinkpriv->buffer_pool, FALSE); gst_buffer_pool_set_active (sinkpriv->buffer_pool, FALSE);
g_clear_object (&sinkpriv->buffer_pool); gst_clear_object (&sinkpriv->buffer_pool);
g_clear_object (&sinkpriv->allocator); gst_clear_object (&sinkpriv->allocator);
sinkpriv->buffer_size = 0; sinkpriv->buffer_size = 0;
} }
@ -802,8 +802,8 @@ _set_srcpad_caps (GstVaapiPluginBase * plugin, GstPad * srcpad, GstCaps * caps)
&& !gst_vaapi_buffer_pool_caps_is_equal (srcpriv->buffer_pool, && !gst_vaapi_buffer_pool_caps_is_equal (srcpriv->buffer_pool,
caps)) { caps)) {
gst_buffer_pool_set_active (srcpriv->buffer_pool, FALSE); gst_buffer_pool_set_active (srcpriv->buffer_pool, FALSE);
g_clear_object (&srcpriv->buffer_pool); gst_clear_object (&srcpriv->buffer_pool);
g_clear_object (&srcpriv->allocator); gst_clear_object (&srcpriv->allocator);
plugin_reset_texture_map (plugin); plugin_reset_texture_map (plugin);
} }
gst_caps_replace (&srcpriv->caps, caps); gst_caps_replace (&srcpriv->caps, caps);
@ -1085,7 +1085,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META)) { GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META)) {
GST_INFO_OBJECT (plugin, "ignoring non-VAAPI pool: %" GST_PTR_FORMAT, GST_INFO_OBJECT (plugin, "ignoring non-VAAPI pool: %" GST_PTR_FORMAT,
pool); pool);
g_clear_object (&pool); gst_clear_object (&pool);
} }
} }
} else { } else {
@ -1122,7 +1122,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
} }
} }
g_clear_object (&srcpriv->buffer_pool); gst_clear_object (&srcpriv->buffer_pool);
srcpriv->buffer_pool = pool; srcpriv->buffer_pool = pool;
/* if downstream doesn't support GstVideoMeta, and the negotiated /* if downstream doesn't support GstVideoMeta, and the negotiated

View file

@ -61,7 +61,7 @@ gst_vaapi_video_buffer_pool_finalize (GObject * object)
GST_VAAPI_VIDEO_BUFFER_POOL (object)->priv; GST_VAAPI_VIDEO_BUFFER_POOL (object)->priv;
gst_vaapi_display_replace (&priv->display, NULL); gst_vaapi_display_replace (&priv->display, NULL);
g_clear_object (&priv->allocator); gst_clear_object (&priv->allocator);
if (priv->dma_mem_map) if (priv->dma_mem_map)
g_hash_table_destroy (priv->dma_mem_map); g_hash_table_destroy (priv->dma_mem_map);