static void gst_egl_image_allocator_free_vfunc (GstAllocator * allocator, GstMemory * mem) { GstEGLImageMemory *emem = (GstEGLImageMemory *) mem; g_return_if_fail (gst_is_egl_image_memory (mem)); /* Shared memory should not destroy all the data */ if (!mem->parent) { emem->context->eglDestroyImage (emem->context->egl_display, emem->image); if (emem->user_data_destroy) emem->user_data_destroy (emem->context, emem->user_data); gst_object_unref (emem->context); emem->context = NULL; } g_slice_free (GstEGLImageMemory, emem); }
static void gst_egl_image_allocator_free_vfunc (GstAllocator * allocator, GstMemory * mem) { GstEGLImageMemory *emem = (GstEGLImageMemory *) mem; EGLDisplay display; g_return_if_fail (gst_is_egl_image_memory (mem)); /* Shared memory should not destroy all the data */ if (!mem->parent) { display = gst_egl_display_get (emem->display); eglDestroyImageKHR (display, emem->image); if (emem->user_data_destroy) emem->user_data_destroy (emem->user_data); gst_egl_display_unref (emem->display); } g_slice_free (GstEGLImageMemory, emem); }