[521/906] GstGLMemory: update for GstAllocator changes
authorMatthew Waters <ystreet00@gmail.com>
Sat, 7 Jul 2012 15:09:56 +0000 (01:09 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:24 +0000 (19:31 +0000)
gst-libs/gst/gl/gstglmemory.c

index ea7d7b2..4016827 100644 (file)
@@ -266,9 +266,11 @@ _gl_mem_is_span_func (GstGLMemory * mem1, GstGLMemory * mem2, gsize * offset)
 }
 
 static void
-_gl_mem_destroy_notify (gpointer user_data)
+_gl_mem_destroy_free (GstMiniObject * allocator)
 {
   GST_LOG ("GLTexture memory allocator freed");
+
+  g_slice_free (GstAllocator, (GstAllocator *) allocator);
 }
 
 /**
@@ -312,9 +314,12 @@ gst_gl_memory_init (void)
   };
 
   if (g_once_init_enter (&_init)) {
-    _gl_allocator = gst_allocator_new (&mem_info, NULL, _gl_mem_destroy_notify);
+    _gl_allocator = g_slice_new (GstAllocator);
+    gst_allocator_init (_gl_allocator, GST_ALLOCATOR_FLAG_CUSTOM_ALLOC,
+        &mem_info, _gl_mem_destroy_free);
     gst_allocator_register (GST_GL_MEMORY_ALLOCATOR,
         gst_allocator_ref (_gl_allocator));
+
     g_once_init_leave (&_init, 1);
   }
 }