From e214be79defa9d34cc49c7dc336cefdab97c1a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 8 Jan 2023 18:03:49 +0000 Subject: [PATCH] libs: va: drop use of GSlice Part-of: --- .../gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c | 12 ++++++------ .../gst-libs/gst/va/gstvasurfacecopy.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c index 4739343f8e..6581fd2509 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c @@ -125,7 +125,7 @@ gst_va_buffer_surface_unref (gpointer data) GST_LOG_OBJECT (buf->display, "Destroying surface %#x", buf->surface); va_destroy_surfaces (buf->display, &buf->surface, 1); gst_clear_object (&buf->display); - g_slice_free (GstVaBufferSurface, buf); + g_free (buf); } } @@ -133,7 +133,7 @@ static GstVaBufferSurface * gst_va_buffer_surface_new (VASurfaceID surface, GstVideoFormat format, gint width, gint height) { - GstVaBufferSurface *buf = g_slice_new (GstVaBufferSurface); + GstVaBufferSurface *buf = g_new (GstVaBufferSurface, 1); g_atomic_int_set (&buf->ref_count, 0); g_atomic_int_set (&buf->ref_mems_count, 0); @@ -194,7 +194,7 @@ gst_va_memory_pool_flush_unlocked (GstVaMemoryPool * self, GST_LOG ("Destroying surface %#x", buf->surface); va_destroy_surfaces (display, &buf->surface, 1); self->surface_count -= 1; /* GstVaDmabufAllocator */ - g_slice_free (GstVaBufferSurface, buf); + g_free (buf); } } else { self->surface_count -= 1; /* GstVaAllocator */ @@ -1170,7 +1170,7 @@ _va_free (GstAllocator * allocator, GstMemory * mem) g_mutex_clear (&va_mem->lock); - g_slice_free (GstVaMemory, va_mem); + g_free (va_mem); } static void @@ -1444,7 +1444,7 @@ _va_share (GstMemory * mem, gssize offset, gssize size) if (size == -1) size = mem->maxsize - offset; - sub = g_slice_new (GstVaMemory); + sub = g_new (GstVaMemory, 1); /* the shared memory is alwyas readonly */ gst_memory_init (GST_MEMORY_CAST (sub), GST_MINI_OBJECT_FLAGS (parent) | @@ -1593,7 +1593,7 @@ gst_va_allocator_alloc (GstAllocator * allocator) &surface, 1)) return NULL; - mem = g_slice_new (GstVaMemory); + mem = g_new (GstVaMemory, 1); mem->surface = surface; mem->surface_format = self->surface_format; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvasurfacecopy.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvasurfacecopy.c index 038a1080f7..ad1fc8b44f 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvasurfacecopy.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvasurfacecopy.c @@ -71,7 +71,7 @@ gst_va_surface_copy_new (GstVaDisplay * display, GstVideoInfo * vinfo) g_return_val_if_fail (GST_IS_VA_DISPLAY (display), NULL); g_return_val_if_fail (vinfo != NULL, NULL); - self = g_slice_new (GstVaSurfaceCopy); + self = g_new (GstVaSurfaceCopy, 1); self->display = gst_object_ref (display); self->has_copy = _has_copy (display); self->info = *vinfo; @@ -89,7 +89,7 @@ gst_va_surface_copy_free (GstVaSurfaceCopy * self) g_rec_mutex_clear (&self->lock); - g_slice_free (GstVaSurfaceCopy, self); + g_free (self); } gboolean