summaryrefslogtreecommitdiff
path: root/gst/vaapi
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2020-08-16 01:57:15 +0800
committerHe Junyan <junyan.he@intel.com>2020-08-16 01:57:15 +0800
commit3540dcf4d98120c0596eabbec3025dfce322585a (patch)
tree32f87b746f16bd43716162433ac2668aa6f89de2 /gst/vaapi
parentae6d4f3969d27848a45494eb3038119941117ec7 (diff)
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>
Diffstat (limited to 'gst/vaapi')
-rw-r--r--gst/vaapi/gstvaapivideomemory.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c
index 48f42ab2..abf97157 100644
--- a/gst/vaapi/gstvaapivideomemory.c
+++ b/gst/vaapi/gstvaapivideomemory.c
@@ -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);
}