plugin: allocator: No need to ref allocator when create mem.

We do not need to ref the allocator when creating GstVaapiVideoMemory
kind memory, and then release it in _free(). The framework already
does it for us.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/383>
This commit is contained in:
He Junyan 2020-08-16 01:57:15 +08:00
parent ae6d4f3969
commit 3540dcf4d9

View file

@ -367,7 +367,7 @@ gst_vaapi_video_memory_new (GstAllocator * base_allocator,
vip = &allocator->image_info;
gst_memory_init (&mem->parent_instance, GST_MEMORY_FLAG_NO_SHARE,
gst_object_ref (allocator), NULL, GST_VIDEO_INFO_SIZE (vip), 0,
base_allocator, NULL, GST_VIDEO_INFO_SIZE (vip), 0,
0, GST_VIDEO_INFO_SIZE (vip));
mem->proxy = NULL;
@ -607,7 +607,6 @@ gst_vaapi_video_allocator_free (GstAllocator * allocator, GstMemory * base_mem)
gst_vaapi_video_memory_reset_image (mem);
gst_vaapi_surface_proxy_replace (&mem->proxy, NULL);
gst_vaapi_video_meta_replace (&mem->meta, NULL);
gst_object_unref (GST_MEMORY_CAST (mem)->allocator);
g_mutex_clear (&mem->lock);
g_slice_free (GstVaapiVideoMemory, mem);
}