mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
vaapivideomemory: unroll gst_vaapi_video_allocator_free()
Instead of having a gst_vaapi_video_memory_free() that is only going to be called by gst_vaapi_video_allocator_free(), let's just remove the first and merged into the second.
This commit is contained in:
parent
582d4d47f9
commit
85b3af62b4
1 changed files with 10 additions and 14 deletions
|
@ -396,18 +396,6 @@ gst_vaapi_video_memory_new (GstAllocator * base_allocator,
|
||||||
return GST_MEMORY_CAST (mem);
|
return GST_MEMORY_CAST (mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gst_vaapi_video_memory_free (GstVaapiVideoMemory * mem)
|
|
||||||
{
|
|
||||||
mem->surface = NULL;
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_vaapi_video_memory_reset_image (GstVaapiVideoMemory * mem)
|
gst_vaapi_video_memory_reset_image (GstVaapiVideoMemory * mem)
|
||||||
{
|
{
|
||||||
|
@ -626,9 +614,17 @@ G_DEFINE_TYPE_WITH_CODE (GstVaapiVideoAllocator,
|
||||||
"VA-API video memory allocator"));
|
"VA-API video memory allocator"));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_vaapi_video_allocator_free (GstAllocator * allocator, GstMemory * mem)
|
gst_vaapi_video_allocator_free (GstAllocator * allocator, GstMemory * base_mem)
|
||||||
{
|
{
|
||||||
gst_vaapi_video_memory_free (GST_VAAPI_VIDEO_MEMORY_CAST (mem));
|
GstVaapiVideoMemory *const mem = GST_VAAPI_VIDEO_MEMORY_CAST (base_mem);
|
||||||
|
|
||||||
|
mem->surface = NULL;
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue