diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-05-15 20:31:31 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-05-17 10:40:23 +0300 |
commit | 634cd87c76f58b5e1383715bafd5614db825c7d1 (patch) | |
tree | 56ed020dce25df5d80c2f5b3530138d2d202820d | |
parent | c40b8a894dc2fd542a6987c07992ca3e5fbb5658 (diff) | |
download | gstreamer-plugins-bad-634cd87c76f58b5e1383715bafd5614db825c7d1.tar.gz |
gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
https://bugzilla.gnome.org/show_bug.cgi?id=743062
60 files changed, 207 insertions, 39 deletions
diff --git a/ext/directfb/dfbvideosink.c b/ext/directfb/dfbvideosink.c index de3bf9163..be624ba69 100644 --- a/ext/directfb/dfbvideosink.c +++ b/ext/directfb/dfbvideosink.c @@ -466,6 +466,7 @@ gst_dfb_buffer_pool_new (GstDfbVideoSink * dfbvideosink) g_return_val_if_fail (GST_IS_DFBVIDEOSINK (dfbvideosink), NULL); pool = g_object_new (GST_TYPE_DFB_BUFFER_POOL, NULL); + g_object_ref_sink (pool); pool->dfbvideosink = gst_object_ref (dfbvideosink); GST_LOG_OBJECT (pool, "new dfb buffer pool %p", pool); diff --git a/ext/vulkan/vkbuffermemory.c b/ext/vulkan/vkbuffermemory.c index d3b199e74..fafd73102 100644 --- a/ext/vulkan/vkbuffermemory.c +++ b/ext/vulkan/vkbuffermemory.c @@ -411,6 +411,7 @@ gst_vulkan_buffer_memory_init_once (void) _vulkan_buffer_memory_allocator = g_object_new (gst_vulkan_buffer_memory_allocator_get_type (), NULL); + gst_object_ref_sink (_vulkan_buffer_memory_allocator); gst_allocator_register (GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_NAME, gst_object_ref (_vulkan_buffer_memory_allocator)); diff --git a/ext/vulkan/vkbufferpool.c b/ext/vulkan/vkbufferpool.c index df64358e1..74690fdbc 100644 --- a/ext/vulkan/vkbufferpool.c +++ b/ext/vulkan/vkbufferpool.c @@ -207,6 +207,7 @@ gst_vulkan_buffer_pool_new (GstVulkanDevice * device) GstVulkanBufferPool *pool; pool = g_object_new (GST_TYPE_VULKAN_BUFFER_POOL, NULL); + g_object_ref_sink (pool); pool->device = gst_object_ref (device); GST_LOG_OBJECT (pool, "new Vulkan buffer pool for device %" GST_PTR_FORMAT, diff --git a/ext/vulkan/vkdevice.c b/ext/vulkan/vkdevice.c index d9e15593d..dd2a1212f 100644 --- a/ext/vulkan/vkdevice.c +++ b/ext/vulkan/vkdevice.c @@ -60,6 +60,8 @@ gst_vulkan_device_new (GstVulkanInstance * instance) { GstVulkanDevice *device = g_object_new (GST_TYPE_VULKAN_DEVICE, NULL); + gst_object_ref_sink (device); + device->instance = gst_object_ref (instance); /* FIXME: select this externally */ device->device_index = 0; @@ -350,6 +352,7 @@ gst_vulkan_device_get_queue (GstVulkanDevice * device, guint32 queue_family, device->queue_family_props[queue_family].queueCount, NULL); ret = g_object_new (GST_TYPE_VULKAN_QUEUE, NULL); + gst_object_ref_sink (ret); ret->device = gst_object_ref (device); ret->family = queue_family; ret->index = queue_i; diff --git a/ext/vulkan/vkdisplay.c b/ext/vulkan/vkdisplay.c index 550134cd8..354832a25 100644 --- a/ext/vulkan/vkdisplay.c +++ b/ext/vulkan/vkdisplay.c @@ -216,6 +216,7 @@ gst_vulkan_display_new (GstVulkanInstance * instance) GST_FIXME ("creating dummy display"); display = g_object_new (GST_TYPE_VULKAN_DISPLAY, NULL); + gst_object_ref_sink (display); display->instance = gst_object_ref (instance); } diff --git a/ext/vulkan/vkimagememory.c b/ext/vulkan/vkimagememory.c index 025443416..384d29fe8 100644 --- a/ext/vulkan/vkimagememory.c +++ b/ext/vulkan/vkimagememory.c @@ -550,6 +550,7 @@ gst_vulkan_image_memory_init_once (void) _vulkan_image_memory_allocator = g_object_new (gst_vulkan_image_memory_allocator_get_type (), NULL); + gst_object_ref_sink (_vulkan_image_memory_allocator); gst_allocator_register (GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_NAME, gst_object_ref (_vulkan_image_memory_allocator)); diff --git a/ext/vulkan/vkinstance.c b/ext/vulkan/vkinstance.c index 14d1435af..29f99b6ba 100644 --- a/ext/vulkan/vkinstance.c +++ b/ext/vulkan/vkinstance.c @@ -72,7 +72,12 @@ struct _GstVulkanInstancePrivate GstVulkanInstance * gst_vulkan_instance_new (void) { - return g_object_new (GST_TYPE_VULKAN_INSTANCE, NULL); + GstVulkanInstance *instance; + + instance = g_object_new (GST_TYPE_VULKAN_INSTANCE, NULL); + gst_object_ref_sink (instance); + + return instance; } static void diff --git a/ext/vulkan/vkmemory.c b/ext/vulkan/vkmemory.c index c21c34daa..f426043d5 100644 --- a/ext/vulkan/vkmemory.c +++ b/ext/vulkan/vkmemory.c @@ -338,6 +338,7 @@ gst_vulkan_memory_init_once (void) _vulkan_memory_allocator = g_object_new (gst_vulkan_memory_allocator_get_type (), NULL); + gst_object_ref_sink (_vulkan_memory_allocator); gst_allocator_register (GST_VULKAN_MEMORY_ALLOCATOR_NAME, gst_object_ref (_vulkan_memory_allocator)); diff --git a/ext/vulkan/vkswapper.c b/ext/vulkan/vkswapper.c index 75f86abc3..0353fdeaf 100644 --- a/ext/vulkan/vkswapper.c +++ b/ext/vulkan/vkswapper.c @@ -410,6 +410,7 @@ gst_vulkan_swapper_new (GstVulkanDevice * device, GstVulkanWindow * window) GstVulkanSwapper *swapper; swapper = g_object_new (GST_TYPE_VULKAN_SWAPPER, NULL); + gst_object_ref_sink (swapper); swapper->device = gst_object_ref (device); swapper->window = gst_object_ref (window); diff --git a/ext/vulkan/vkwindow.c b/ext/vulkan/vkwindow.c index 6846e3156..ac66bde87 100644 --- a/ext/vulkan/vkwindow.c +++ b/ext/vulkan/vkwindow.c @@ -311,5 +311,10 @@ gst_vulkan_dummy_window_init (GstVulkanDummyWindow * dummy) GstVulkanDummyWindow * gst_vulkan_dummy_window_new (void) { - return g_object_new (gst_vulkan_dummy_window_get_type (), NULL); + GstVulkanDummyWindow *window; + + window = g_object_new (gst_vulkan_dummy_window_get_type (), NULL); + gst_object_ref_sink (window); + + return window; } diff --git a/ext/vulkan/wayland/vkdisplay_wayland.c b/ext/vulkan/wayland/vkdisplay_wayland.c index 686d67103..2a7b62358 100644 --- a/ext/vulkan/wayland/vkdisplay_wayland.c +++ b/ext/vulkan/wayland/vkdisplay_wayland.c @@ -117,6 +117,7 @@ gst_vulkan_display_wayland_new (const gchar * name) GstVulkanDisplayWayland *ret; ret = g_object_new (GST_TYPE_VULKAN_DISPLAY_WAYLAND, NULL); + gst_object_ref_sink (ret); ret->display = wl_display_connect (name); if (!ret->display) { @@ -154,6 +155,7 @@ gst_vulkan_display_wayland_new_with_display (struct wl_display * display) g_return_val_if_fail (display != NULL, NULL); ret = g_object_new (GST_TYPE_VULKAN_DISPLAY_WAYLAND, NULL); + gst_object_ref_sink (ret); ret->display = display; ret->foreign_display = TRUE; diff --git a/ext/vulkan/wayland/vkwindow_wayland.c b/ext/vulkan/wayland/vkwindow_wayland.c index dc9902778..40df44f82 100644 --- a/ext/vulkan/wayland/vkwindow_wayland.c +++ b/ext/vulkan/wayland/vkwindow_wayland.c @@ -164,6 +164,8 @@ gst_vulkan_window_wayland_init (GstVulkanWindowWayland * window) GstVulkanWindowWayland * gst_vulkan_window_wayland_new (GstVulkanDisplay * display) { + GstVulkanWindowWayland *window; + if ((gst_vulkan_display_get_handle_type (display) & GST_VULKAN_DISPLAY_TYPE_WAYLAND) == 0) @@ -172,7 +174,10 @@ gst_vulkan_window_wayland_new (GstVulkanDisplay * display) GST_DEBUG ("creating Wayland window"); - return g_object_new (GST_TYPE_VULKAN_WINDOW_WAYLAND, NULL); + window = g_object_new (GST_TYPE_VULKAN_WINDOW_WAYLAND, NULL); + gst_object_ref_sink (window); + + return window; } static void diff --git a/ext/vulkan/xcb/vkdisplay_xcb.c b/ext/vulkan/xcb/vkdisplay_xcb.c index 763f5d5f7..625d5936a 100644 --- a/ext/vulkan/xcb/vkdisplay_xcb.c +++ b/ext/vulkan/xcb/vkdisplay_xcb.c @@ -130,6 +130,7 @@ gst_vulkan_display_xcb_new_with_connection (xcb_connection_t * connection, GST_DEBUG_CATEGORY_GET (gst_vulkan_display_debug, "gldisplay"); ret = g_object_new (GST_TYPE_VULKAN_DISPLAY_XCB, NULL); + gst_object_ref_sink (ret); ret->connection = connection; ret->screen = _get_screen_from_connection (connection, screen_no); diff --git a/ext/vulkan/xcb/vkwindow_xcb.c b/ext/vulkan/xcb/vkwindow_xcb.c index d08c0bf6e..eb85d10f6 100644 --- a/ext/vulkan/xcb/vkwindow_xcb.c +++ b/ext/vulkan/xcb/vkwindow_xcb.c @@ -109,6 +109,8 @@ gst_vulkan_window_xcb_init (GstVulkanWindowXCB * window) GstVulkanWindowXCB * gst_vulkan_window_xcb_new (GstVulkanDisplay * display) { + GstVulkanWindowXCB *window; + _init_debug (); if ((gst_vulkan_display_get_handle_type (display) & @@ -119,7 +121,10 @@ gst_vulkan_window_xcb_new (GstVulkanDisplay * display) return NULL; } - return g_object_new (GST_TYPE_VULKAN_WINDOW_XCB, NULL); + window = g_object_new (GST_TYPE_VULKAN_WINDOW_XCB, NULL); + gst_object_ref_sink (window); + + return window; } static void diff --git a/ext/wayland/wlshmallocator.c b/ext/wayland/wlshmallocator.c index e1b691b0e..dd334e341 100644 --- a/ext/wayland/wlshmallocator.c +++ b/ext/wayland/wlshmallocator.c @@ -110,8 +110,11 @@ gst_wl_shm_allocator_init (GstWlShmAllocator * self) void gst_wl_shm_allocator_register (void) { - gst_allocator_register (GST_ALLOCATOR_WL_SHM, - g_object_new (GST_TYPE_WL_SHM_ALLOCATOR, NULL)); + GstAllocator *alloc; + + alloc = g_object_new (GST_TYPE_WL_SHM_ALLOCATOR, NULL); + gst_object_ref_sink (alloc); + gst_allocator_register (GST_ALLOCATOR_WL_SHM, alloc); } GstAllocator * diff --git a/gst-libs/gst/gl/android/gstglwindow_android_egl.c b/gst-libs/gst/gl/android/gstglwindow_android_egl.c index af0ec1a7f..4e7ded80a 100644 --- a/gst-libs/gst/gl/android/gstglwindow_android_egl.c +++ b/gst-libs/gst/gl/android/gstglwindow_android_egl.c @@ -69,13 +69,18 @@ gst_gl_window_android_egl_init (GstGLWindowAndroidEGL * window) GstGLWindowAndroidEGL * gst_gl_window_android_egl_new (GstGLDisplay * display) { + GstGLWindowAndroidEGL *window; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_EGL) == 0) /* we require an egl display to create android windows */ return NULL; GST_DEBUG ("creating Android EGL window"); - return g_object_new (GST_TYPE_GL_WINDOW_ANDROID_EGL, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_ANDROID_EGL, NULL); + gst_object_ref_sink (window); + + return window; } static void diff --git a/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m b/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m index daaecaa9b..1869be4da 100644 --- a/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m +++ b/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m @@ -77,11 +77,16 @@ gst_gl_context_cocoa_init (GstGLContextCocoa * context) GstGLContextCocoa * gst_gl_context_cocoa_new (GstGLDisplay * display) { + GstGLContextCocoa *context; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_COCOA) == 0) /* we require an cocoa display to create CGL contexts */ return NULL; - return g_object_new (GST_TYPE_GL_CONTEXT_COCOA, NULL); + context = g_object_new (GST_TYPE_GL_CONTEXT_COCOA, NULL); + gst_object_ref_sink (context); + + return context; } struct pixel_attr diff --git a/gst-libs/gst/gl/cocoa/gstgldisplay_cocoa.m b/gst-libs/gst/gl/cocoa/gstgldisplay_cocoa.m index cbdaa7eac..3fa88e62d 100644 --- a/gst-libs/gst/gl/cocoa/gstgldisplay_cocoa.m +++ b/gst-libs/gst/gl/cocoa/gstgldisplay_cocoa.m @@ -115,6 +115,7 @@ gst_gl_display_cocoa_setup_nsapp (gpointer data) if (NSApp != nil && !singleton) { GstGLDisplayCocoa *ret = g_object_new (GST_TYPE_GL_DISPLAY_COCOA, NULL); + gst_object_ref_sink (ret); g_mutex_unlock (&nsapp_lock); return ret; } @@ -167,6 +168,7 @@ gst_gl_display_cocoa_setup_nsapp (gpointer data) } else { GST_DEBUG ("Create display"); singleton = g_object_new (GST_TYPE_GL_DISPLAY_COCOA, NULL); + gst_object_ref_sink (singletone); } g_mutex_unlock (&nsapp_lock); @@ -223,13 +225,18 @@ gst_gl_display_cocoa_finalize (GObject * object) GstGLDisplayCocoa * gst_gl_display_cocoa_new (void) { + GstGLDisplayCocoa *display; + GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay"); #ifndef GSTREAMER_GLIB_COCOA_NSAPPLICATION - return gst_gl_display_cocoa_setup_nsapp (NULL); + display = gst_gl_display_cocoa_setup_nsapp (NULL); #else - return g_object_new (GST_TYPE_GL_DISPLAY_COCOA, NULL); + display = g_object_new (GST_TYPE_GL_DISPLAY_COCOA, NULL); + gst_object_ref_sink (display); #endif + + return display; } static guintptr diff --git a/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m b/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m index 7bc822a7e..57d7dfeb8 100644 --- a/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m +++ b/gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m @@ -143,11 +143,16 @@ gst_gl_window_cocoa_finalize (GObject * object) GstGLWindowCocoa * gst_gl_window_cocoa_new (GstGLDisplay * display) { + GstGLWindowCocoa *window; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_COCOA) == 0) /* we require an cocoa display to create CGL windows */ return NULL; - return g_object_new (GST_TYPE_GL_WINDOW_COCOA, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_COCOA, NULL); + gst_object_ref_sink (window); + + return window; } /* Must be called from the main thread */ diff --git a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c index 4af4ec693..011f49fdb 100644 --- a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c +++ b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c @@ -108,13 +108,18 @@ gst_gl_window_dispmanx_egl_init (GstGLWindowDispmanxEGL * window_egl) GstGLWindowDispmanxEGL * gst_gl_window_dispmanx_egl_new (GstGLDisplay * display) { + GstGLWindowDispmanxEGL *window; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_EGL) == 0) /* we require an egl display to create dispmanx windows */ return NULL; GST_DEBUG ("creating Dispmanx EGL window"); - return g_object_new (GST_TYPE_GL_WINDOW_DISPMANX_EGL, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_DISPMANX_EGL, NULL); + gst_object_ref_sink (window); + + return window; } static void diff --git a/gst-libs/gst/gl/eagl/gstglcontext_eagl.m b/gst-libs/gst/gl/eagl/gstglcontext_eagl.m index d7294bab3..412e9ce10 100644 --- a/gst-libs/gst/gl/eagl/gstglcontext_eagl.m +++ b/gst-libs/gst/gl/eagl/gstglcontext_eagl.m @@ -96,8 +96,13 @@ gst_gl_context_eagl_init (GstGLContextEagl * context) GstGLContextEagl * gst_gl_context_eagl_new (GstGLDisplay * display) { + GstGLContextEagl *context; + /* there isn't actually a display type for eagl yet? */ - return g_object_new (GST_TYPE_GL_CONTEXT_EAGL, NULL); + context = g_object_new (GST_TYPE_GL_CONTEXT_EAGL, NULL); + gst_object_ref_sink (context); + + return context; } void diff --git a/gst-libs/gst/gl/eagl/gstglwindow_eagl.m b/gst-libs/gst/gl/eagl/gstglwindow_eagl.m index fb70c012f..4923260ff 100644 --- a/gst-libs/gst/gl/eagl/gstglwindow_eagl.m +++ b/gst-libs/gst/gl/eagl/gstglwindow_eagl.m @@ -103,8 +103,13 @@ gst_gl_window_eagl_finalize (GObject * object) GstGLWindowEagl * gst_gl_window_eagl_new (GstGLDisplay * display) { + GstGLWindowEagl *window; + /* there isn't an eagl display type */ - return g_object_new (GST_TYPE_GL_WINDOW_EAGL, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_EAGL, NULL); + gst_object_ref_sink (window); + + return window; } static guintptr diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c index a8cf2f889..eabc09c5e 100644 --- a/gst-libs/gst/gl/egl/gstglcontext_egl.c +++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c @@ -108,9 +108,14 @@ gst_gl_context_egl_init (GstGLContextEGL * context) GstGLContextEGL * gst_gl_context_egl_new (GstGLDisplay * display) { + GstGLContextEGL *context; + /* XXX: display type could theoretically be anything, as long as * eglGetDisplay supports it. */ - return g_object_new (GST_TYPE_GL_CONTEXT_EGL, NULL); + context = g_object_new (GST_TYPE_GL_CONTEXT_EGL, NULL); + gst_object_ref_sink (context); + + return context; } static gboolean diff --git a/gst-libs/gst/gl/egl/gstgldisplay_egl.c b/gst-libs/gst/gl/egl/gstgldisplay_egl.c index 06ddc9bdb..a2dc98a8e 100644 --- a/gst-libs/gst/gl/egl/gstgldisplay_egl.c +++ b/gst-libs/gst/gl/egl/gstgldisplay_egl.c @@ -176,6 +176,7 @@ gst_gl_display_egl_new (void) GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay"); ret = g_object_new (GST_TYPE_GL_DISPLAY_EGL, NULL); + gst_object_ref_sink (ret); ret->display = gst_gl_display_egl_get_from_native (GST_GL_DISPLAY_TYPE_ANY, 0); @@ -206,6 +207,7 @@ gst_gl_display_egl_new_with_egl_display (EGLDisplay display) GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay"); ret = g_object_new (GST_TYPE_GL_DISPLAY_EGL, NULL); + gst_object_ref_sink (ret); ret->display = display; ret->foreign_display = TRUE; @@ -270,6 +272,7 @@ gst_gl_display_egl_from_gl_display (GstGLDisplay * display) g_return_val_if_fail (display_type != GST_GL_DISPLAY_TYPE_NONE, NULL); ret = g_object_new (GST_TYPE_GL_DISPLAY_EGL, NULL); + gst_object_ref_sink (ret); ret->display = gst_gl_display_egl_get_from_native (display_type, native_display); diff --git a/gst-libs/gst/gl/egl/gstglmemoryegl.c b/gst-libs/gst/gl/egl/gstglmemoryegl.c index 414d76b15..378925f0c 100644 --- a/gst-libs/gst/gl/egl/gstglmemoryegl.c +++ b/gst-libs/gst/gl/egl/gstglmemoryegl.c @@ -252,6 +252,7 @@ gst_gl_memory_egl_init_once (void) _gl_memory_egl_allocator = g_object_new (GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, NULL); + gst_object_ref_sink (_gl_memory_egl_allocator); /* The allocator is never unreffed */ GST_OBJECT_FLAG_SET (_gl_memory_egl_allocator, diff --git a/gst-libs/gst/gl/gstglbuffer.c b/gst-libs/gst/gl/gstglbuffer.c index 73c4b210a..5b184d1a6 100644 --- a/gst-libs/gst/gl/gstglbuffer.c +++ b/gst-libs/gst/gl/gstglbuffer.c @@ -461,6 +461,7 @@ gst_gl_buffer_init_once (void) _gl_buffer_allocator = g_object_new (gst_gl_buffer_allocator_get_type (), NULL); + gst_object_ref_sink (_gl_buffer_allocator); /* The allocator is never unreffed */ GST_OBJECT_FLAG_SET (_gl_buffer_allocator, GST_OBJECT_FLAG_MAY_BE_LEAKED); diff --git a/gst-libs/gst/gl/gstglbufferpool.c b/gst-libs/gst/gl/gstglbufferpool.c index e886557ac..53d3b66d9 100644 --- a/gst-libs/gst/gl/gstglbufferpool.c +++ b/gst-libs/gst/gl/gstglbufferpool.c @@ -310,6 +310,7 @@ gst_gl_buffer_pool_new (GstGLContext * context) GstGLBufferPool *pool; pool = g_object_new (GST_TYPE_GL_BUFFER_POOL, NULL); + gst_object_ref_sink (pool); pool->context = gst_object_ref (context); GST_LOG_OBJECT (pool, "new GL buffer pool for context %" GST_PTR_FORMAT, diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c index 89edb164c..60ae5cbd4 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.c +++ b/gst-libs/gst/gl/gstglcolorconvert.c @@ -469,7 +469,7 @@ gst_gl_color_convert_init (GstGLColorConvert * convert) * gst_gl_color_convert_new: * @context: a #GstGLContext * - * Returns: a new #GstGLColorConvert object + * Returns: (transfer full): a new #GstGLColorConvert object * * Since: 1.4 */ @@ -479,6 +479,7 @@ gst_gl_color_convert_new (GstGLContext * context) GstGLColorConvert *convert; convert = g_object_new (GST_TYPE_GL_COLOR_CONVERT, NULL); + gst_object_ref_sink (convert); convert->context = gst_object_ref (context); diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 9af5e1cc8..5550477a7 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -382,7 +382,7 @@ gst_gl_context_new (GstGLDisplay * display) * represented by @handle stays alive while the returned #GstGLContext is * active. * - * Returns: a #GstGLContext wrapping @handle + * Returns: (transfer full): a #GstGLContext wrapping @handle * * Since: 1.4 */ @@ -402,6 +402,7 @@ gst_gl_context_new_wrapped (GstGLDisplay * display, guintptr handle, NULL); context_wrap = g_object_new (GST_TYPE_GL_WRAPPED_CONTEXT, NULL); + gst_object_ref_sink (context_wrap); if (!context_wrap) { /* subclass returned a NULL context */ diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index b456b1fa4..d7f4a5913 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -323,7 +323,8 @@ gst_gl_display_new (void) "(platform: %s), creating dummy", GST_STR_NULL (user_choice), GST_STR_NULL (platform_choice)); - return g_object_new (GST_TYPE_GL_DISPLAY, NULL); + display = g_object_new (GST_TYPE_GL_DISPLAY, NULL); + gst_object_ref_sink (display); } return display; diff --git a/gst-libs/gst/gl/gstglframebuffer.c b/gst-libs/gst/gl/gstglframebuffer.c index f6289970f..ef9bf7326 100644 --- a/gst-libs/gst/gl/gstglframebuffer.c +++ b/gst-libs/gst/gl/gstglframebuffer.c @@ -166,7 +166,7 @@ gst_gl_framebuffer_finalize (GObject * object) * * Returns: a new #GstGLFramebuffer * - * Since: 1.10 + * Since: (transfer full): 1.10 */ GstGLFramebuffer * gst_gl_framebuffer_new (GstGLContext * context) @@ -187,6 +187,7 @@ gst_gl_framebuffer_new (GstGLContext * context) fb = g_object_new (GST_TYPE_GL_FRAMEBUFFER, NULL); fb->context = gst_object_ref (context); gl->GenFramebuffers (1, &fb->fbo_id); + gst_object_ref_sink (fb); return fb; } diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c index 343a8598f..2425b3878 100644 --- a/gst-libs/gst/gl/gstglmemory.c +++ b/gst-libs/gst/gl/gstglmemory.c @@ -1096,6 +1096,7 @@ gst_gl_memory_init_once (void) "OpenGL Base Texture Memory"); _gl_memory_allocator = g_object_new (GST_TYPE_GL_MEMORY_ALLOCATOR, NULL); + gst_object_ref_sink (_gl_memory_allocator); gst_allocator_register (GST_GL_MEMORY_ALLOCATOR_NAME, _gl_memory_allocator); diff --git a/gst-libs/gst/gl/gstglmemorypbo.c b/gst-libs/gst/gl/gstglmemorypbo.c index 4ae7125a3..a7cf042f2 100644 --- a/gst-libs/gst/gl/gstglmemorypbo.c +++ b/gst-libs/gst/gl/gstglmemorypbo.c @@ -835,6 +835,7 @@ gst_gl_memory_pbo_init_once (void) GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_MEMORY, "glmemory", 0, "OpenGL Memory"); _gl_allocator = g_object_new (GST_TYPE_GL_MEMORY_PBO_ALLOCATOR, NULL); + gst_object_ref_sink (_gl_allocator); /* The allocator is never unreffed */ GST_OBJECT_FLAG_SET (_gl_allocator, GST_OBJECT_FLAG_MAY_BE_LEAKED); diff --git a/gst-libs/gst/gl/gstgloverlaycompositor.c b/gst-libs/gst/gl/gstgloverlaycompositor.c index 16c123cd0..257211097 100644 --- a/gst-libs/gst/gl/gstgloverlaycompositor.c +++ b/gst-libs/gst/gl/gstgloverlaycompositor.c @@ -474,6 +474,8 @@ gst_gl_overlay_compositor_new (GstGLContext * context) GstGLOverlayCompositor *compositor = g_object_new (GST_TYPE_GL_OVERLAY_COMPOSITOR, NULL); + gst_object_ref_sink (compositor); + compositor->context = gst_object_ref (context); gst_gl_context_thread_add (compositor->context, @@ -575,6 +577,7 @@ gst_gl_overlay_compositor_upload_overlays (GstGLOverlayCompositor * compositor, GstGLCompositionOverlay *overlay = gst_gl_composition_overlay_new (compositor->context, rectangle, compositor->position_attrib, compositor->texcoord_attrib); + gst_object_ref_sink (overlay); gst_gl_composition_overlay_upload (overlay, buf); diff --git a/gst-libs/gst/gl/gstglrenderbuffer.c b/gst-libs/gst/gl/gstglrenderbuffer.c index 72f95f853..c3e36f6b5 100644 --- a/gst-libs/gst/gl/gstglrenderbuffer.c +++ b/gst-libs/gst/gl/gstglrenderbuffer.c @@ -317,6 +317,7 @@ gst_gl_renderbuffer_init_once (void) _gl_renderbuffer_allocator = g_object_new (GST_TYPE_GL_RENDERBUFFER_ALLOCATOR, NULL); + gst_object_ref_sink (_gl_renderbuffer_allocator); GST_OBJECT_FLAG_SET (_gl_renderbuffer_allocator, GST_OBJECT_FLAG_MAY_BE_LEAKED); diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c index ab348f163..c665296eb 100644 --- a/gst-libs/gst/gl/gstglshader.c +++ b/gst-libs/gst/gl/gstglshader.c @@ -235,6 +235,7 @@ _new_with_stages_va_list (GstGLContext * context, GError ** error, g_return_val_if_fail (GST_IS_GL_CONTEXT (context), NULL); shader = g_object_new (GST_TYPE_GL_SHADER, NULL); + gst_object_ref_sink (shader); shader->context = gst_object_ref (context); while ((stage = va_arg (varargs, GstGLSLStage *))) { diff --git a/gst-libs/gst/gl/gstglslstage.c b/gst-libs/gst/gl/gstglslstage.c index 60a5af7a5..d40a88b7e 100644 --- a/gst-libs/gst/gl/gstglslstage.c +++ b/gst-libs/gst/gl/gstglslstage.c @@ -196,7 +196,7 @@ _ensure_shader (GstGLSLStage * stage) * @n_strings: the number of strings in @str * @str: an array of strings concatted together to produce a shader * - * Returns: (transfer full): a new #GstGLSLStage of the specified @type + * Returns: (transfer floating): a new #GstGLSLStage of the specified @type * * Since: 1.8 */ @@ -235,7 +235,7 @@ gst_glsl_stage_new_with_strings (GstGLContext * context, guint type, * @profile: the #GstGLSLProfile * @str: a shader string * - * Returns: (transfer full): a new #GstGLSLStage of the specified @type + * Returns: (transfer floating): a new #GstGLSLStage of the specified @type * * Since: 1.8 */ @@ -252,7 +252,7 @@ gst_glsl_stage_new_with_string (GstGLContext * context, guint type, * @context: a #GstGLContext * @type: the GL enum shader stage type * - * Returns: (transfer full): a new #GstGLSLStage of the specified @type + * Returns: (transfer floating): a new #GstGLSLStage of the specified @type * * Since: 1.8 */ @@ -267,7 +267,7 @@ gst_glsl_stage_new (GstGLContext * context, guint type) * gst_glsl_stage_new_with_default_vertex: * @context: a #GstGLContext * - * Returns: (transfer full): a new #GstGLSLStage with the default vertex shader + * Returns: (transfer floating): a new #GstGLSLStage with the default vertex shader * * Since: 1.8 */ @@ -284,7 +284,7 @@ gst_glsl_stage_new_default_vertex (GstGLContext * context) * gst_glsl_stage_new_with_default_fragment: * @context: a #GstGLContext * - * Returns: (transfer full): a new #GstGLSLStage with the default fragment shader + * Returns: (transfer floating): a new #GstGLSLStage with the default fragment shader * * Since: 1.8 */ diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 2b51bfad8..810f4fa1a 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -1561,7 +1561,7 @@ gst_gl_upload_init (GstGLUpload * upload) * gst_gl_upload_new: * @context: a #GstGLContext * - * Returns: a new #GstGLUpload object + * Returns: (transfer full): a new #GstGLUpload object */ GstGLUpload * gst_gl_upload_new (GstGLContext * context) @@ -1569,6 +1569,8 @@ gst_gl_upload_new (GstGLContext * context) GstGLUpload *upload = g_object_new (GST_TYPE_GL_UPLOAD, NULL); gint i, n; + gst_object_ref_sink (upload); + if (context) gst_gl_upload_set_context (upload, context); else diff --git a/gst-libs/gst/gl/gstglviewconvert.c b/gst-libs/gst/gl/gstglviewconvert.c index acb9c8504..6ba48b6cc 100644 --- a/gst-libs/gst/gl/gstglviewconvert.c +++ b/gst-libs/gst/gl/gstglviewconvert.c @@ -336,14 +336,19 @@ gst_gl_view_convert_finalize (GObject * object) /** * gst_gl_view_convert_new: * - * Returns: a new #GstGLViewConvert + * Returns: (transfer full): a new #GstGLViewConvert * * Since: 1.6 */ GstGLViewConvert * gst_gl_view_convert_new (void) { - return g_object_new (GST_TYPE_GL_VIEW_CONVERT, NULL); + GstGLViewConvert *convert; + + convert = g_object_new (GST_TYPE_GL_VIEW_CONVERT, NULL); + gst_object_ref_sink (convert); + + return convert; } /** diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c index c1dae2d17..e7947bf04 100644 --- a/gst-libs/gst/gl/gstglwindow.c +++ b/gst-libs/gst/gl/gstglwindow.c @@ -1014,5 +1014,10 @@ gst_gl_dummy_window_init (GstGLDummyWindow * dummy) GstGLDummyWindow * gst_gl_dummy_window_new (void) { - return g_object_new (gst_gl_dummy_window_get_type (), NULL); + GstGLDummyWindow *window; + + window = g_object_new (gst_gl_dummy_window_get_type (), NULL); + gst_object_ref_sink (window); + + return window; } diff --git a/gst-libs/gst/gl/viv-fb/gstgldisplay_viv_fb.c b/gst-libs/gst/gl/viv-fb/gstgldisplay_viv_fb.c index 682020318..48815e52f 100644 --- a/gst-libs/gst/gl/viv-fb/gstgldisplay_viv_fb.c +++ b/gst-libs/gst/gl/viv-fb/gstgldisplay_viv_fb.c @@ -83,6 +83,7 @@ gst_gl_display_viv_fb_new (gint disp_idx) GST_DEBUG ("creating Vivante FB EGL display %d", disp_idx); display = g_object_new (GST_TYPE_GL_DISPLAY_VIV_FB, NULL); + gst_object_ref_sink (display); display->disp_idx = disp_idx; display->display = fbGetDisplayByIndex (display->disp_idx); if (!display->display) { diff --git a/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c b/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c index f8fb63892..8ce25eed3 100644 --- a/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c +++ b/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c @@ -72,12 +72,17 @@ gst_gl_window_viv_fb_egl_init (GstGLWindowVivFBEGL * window) GstGLWindowVivFBEGL * gst_gl_window_viv_fb_egl_new (GstGLDisplay * display) { + GstGLWindowVivFBEGL *window; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_VIV_FB) == 0) /* we require a Vivante FB display to create windows */ return NULL; - return g_object_new (GST_TYPE_GL_WINDOW_VIV_FB_EGL, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_VIV_FB_EGL, NULL); + gst_object_ref_sink (window); + + return window; } static void diff --git a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c index e466fb4dd..a7ca203e6 100644 --- a/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c +++ b/gst-libs/gst/gl/wayland/gstgldisplay_wayland.c @@ -116,6 +116,7 @@ gst_gl_display_wayland_new (const gchar * name) GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay"); ret = g_object_new (GST_TYPE_GL_DISPLAY_WAYLAND, NULL); + gst_object_ref_sink (ret); ret->display = wl_display_connect (name); if (!ret->display) { @@ -151,6 +152,7 @@ gst_gl_display_wayland_new_with_display (struct wl_display * display) GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay"); ret = g_object_new (GST_TYPE_GL_DISPLAY_WAYLAND, NULL); + gst_object_ref_sink (ret); ret->display = display; ret->foreign_display = TRUE; diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c index 933ddfe41..7d99a5561 100644 --- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c @@ -353,6 +353,8 @@ gst_gl_window_wayland_egl_init (GstGLWindowWaylandEGL * window) GstGLWindowWaylandEGL * gst_gl_window_wayland_egl_new (GstGLDisplay * display) { + GstGLWindowWaylandEGL *window; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_WAYLAND) == 0) /* we require a wayland display to create wayland surfaces */ @@ -360,7 +362,10 @@ gst_gl_window_wayland_egl_new (GstGLDisplay * display) GST_DEBUG ("creating Wayland EGL window"); - return g_object_new (GST_TYPE_GL_WINDOW_WAYLAND_EGL, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_WAYLAND_EGL, NULL); + gst_object_ref_sink (window); + + return window; } static void diff --git a/gst-libs/gst/gl/win32/gstglcontext_wgl.c b/gst-libs/gst/gl/win32/gstglcontext_wgl.c index 53ebb8092..91cea8fed 100644 --- a/gst-libs/gst/gl/win32/gstglcontext_wgl.c +++ b/gst-libs/gst/gl/win32/gstglcontext_wgl.c @@ -98,12 +98,17 @@ gst_gl_context_wgl_init (GstGLContextWGL * context_wgl) GstGLContextWGL * gst_gl_context_wgl_new (GstGLDisplay * display) { + GstGLContextWGL *context; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_WIN32) == 0) /* we require an win32 display handle to create WGL contexts */ return NULL; - return g_object_new (GST_TYPE_GL_CONTEXT_WGL, NULL); + context = g_object_new (GST_TYPE_GL_CONTEXT_WGL, NULL); + gst_object_ref_sink (context); + + return context; } static HGLRC diff --git a/gst-libs/gst/gl/win32/gstglwindow_win32.c b/gst-libs/gst/gl/win32/gstglwindow_win32.c index dd1174544..8d33ea443 100644 --- a/gst-libs/gst/gl/win32/gstglwindow_win32.c +++ b/gst-libs/gst/gl/win32/gstglwindow_win32.c @@ -93,12 +93,17 @@ gst_gl_window_win32_init (GstGLWindowWin32 * window) GstGLWindowWin32 * gst_gl_window_win32_new (GstGLDisplay * display) { + GstGLWindowWin32 *window; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_WIN32) == 0) /* we require an win32 display to create win32 windows */ return NULL; - return g_object_new (GST_TYPE_GL_WINDOW_WIN32, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_WIN32, NULL); + gst_object_ref_sink (window); + + return window; } static void diff --git a/gst-libs/gst/gl/x11/gstglcontext_glx.c b/gst-libs/gst/gl/x11/gstglcontext_glx.c index f59a0d3fe..795cd9b98 100644 --- a/gst-libs/gst/gl/x11/gstglcontext_glx.c +++ b/gst-libs/gst/gl/x11/gstglcontext_glx.c @@ -112,11 +112,16 @@ gst_gl_context_glx_init (GstGLContextGLX * context) GstGLContextGLX * gst_gl_context_glx_new (GstGLDisplay * display) { + GstGLContextGLX *context; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_X11) == 0) /* we require an x11 display handle to create GLX contexts */ return NULL; - return g_object_new (GST_TYPE_GL_CONTEXT_GLX, NULL); + context = g_object_new (GST_TYPE_GL_CONTEXT_GLX, NULL); + gst_object_ref_sink (context); + + return context; } static inline void diff --git a/gst-libs/gst/gl/x11/gstgldisplay_x11.c b/gst-libs/gst/gl/x11/gstgldisplay_x11.c index 92101d45e..c19d7a61a 100644 --- a/gst-libs/gst/gl/x11/gstgldisplay_x11.c +++ b/gst-libs/gst/gl/x11/gstgldisplay_x11.c @@ -88,6 +88,7 @@ gst_gl_display_x11_new (const gchar * name) GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay"); ret = g_object_new (GST_TYPE_GL_DISPLAY_X11, NULL); + gst_object_ref_sink (ret); ret->name = g_strdup (name); ret->display = XOpenDisplay (ret->name); @@ -131,6 +132,7 @@ gst_gl_display_x11_new_with_display (Display * display) GST_DEBUG_CATEGORY_GET (gst_gl_display_debug, "gldisplay"); ret = g_object_new (GST_TYPE_GL_DISPLAY_X11, NULL); + gst_object_ref_sink (ret); ret->name = g_strdup (DisplayString (display)); ret->display = display; diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c index 4675122f2..0c8353973 100644 --- a/gst-libs/gst/gl/x11/gstglwindow_x11.c +++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c @@ -123,6 +123,8 @@ gst_gl_window_x11_init (GstGLWindowX11 * window) GstGLWindowX11 * gst_gl_window_x11_new (GstGLDisplay * display) { + GstGLWindowX11 *window; + if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_X11) == GST_GL_DISPLAY_TYPE_NONE) { GST_INFO ("Wrong display type %u for this window type %u", display->type, @@ -130,7 +132,10 @@ gst_gl_window_x11_new (GstGLDisplay * display) return NULL; } - return g_object_new (GST_TYPE_GL_WINDOW_X11, NULL); + window = g_object_new (GST_TYPE_GL_WINDOW_X11, NULL); + gst_object_ref_sink (window); + + return window; } gboolean diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c index 273a480b4..3e0f26ee8 100644 --- a/gst-libs/gst/player/gstplayer.c +++ b/gst-libs/gst/player/gstplayer.c @@ -3020,7 +3020,7 @@ gst_player_init_once (G_GNUC_UNUSED gpointer user_data) * no special video set up will be done and some default handling will be * performed. * - * Returns: a new #GstPlayer instance + * Returns: (transfer full): a new #GstPlayer instance */ GstPlayer * gst_player_new (GstPlayerVideoRenderer * video_renderer, @@ -3034,6 +3034,7 @@ gst_player_new (GstPlayerVideoRenderer * video_renderer, self = g_object_new (GST_TYPE_PLAYER, "video-renderer", video_renderer, "signal-dispatcher", signal_dispatcher, NULL); + gst_object_ref_sink (self); if (video_renderer) g_object_unref (video_renderer); diff --git a/gst-libs/gst/uridownloader/gsturidownloader.c b/gst-libs/gst/uridownloader/gsturidownloader.c index 47b5e8b05..05169818c 100644 --- a/gst-libs/gst/uridownloader/gsturidownloader.c +++ b/gst-libs/gst/uridownloader/gsturidownloader.c @@ -154,7 +154,12 @@ gst_uri_downloader_finalize (GObject * object) GstUriDownloader * gst_uri_downloader_new (void) { - return g_object_new (GST_TYPE_URI_DOWNLOADER, NULL); + GstUriDownloader *downloader; + + downloader = g_object_new (GST_TYPE_URI_DOWNLOADER, NULL); + gst_object_ref_sink (downloader); + + return downloader; } /** diff --git a/sys/applemedia/corevideomemory.c b/sys/applemedia/corevideomemory.c index e8ab72f14..5e832d474 100644 --- a/sys/applemedia/corevideomemory.c +++ b/sys/applemedia/corevideomemory.c @@ -269,6 +269,7 @@ gst_apple_core_video_memory_init (void) _apple_core_video_allocator = g_object_new (GST_TYPE_APPLE_CORE_VIDEO_ALLOCATOR, NULL); + gst_object_ref_sink (_apple_core_video_allocator); gst_allocator_register (GST_APPLE_CORE_VIDEO_ALLOCATOR_NAME, gst_object_ref (_apple_core_video_allocator)); diff --git a/sys/applemedia/iosglmemory.c b/sys/applemedia/iosglmemory.c index 7b7db9bc6..f677efa4c 100644 --- a/sys/applemedia/iosglmemory.c +++ b/sys/applemedia/iosglmemory.c @@ -113,6 +113,7 @@ gst_ios_gl_memory_init (void) _ios_gl_memory_allocator = g_object_new (GST_TYPE_IOS_GL_MEMORY_ALLOCATOR, NULL); + gst_object_ref_sink (_ios_gl_memory_allocator); gst_allocator_register (GST_IOS_GL_MEMORY_ALLOCATOR_NAME, gst_object_ref (_ios_gl_memory_allocator)); diff --git a/sys/applemedia/iosurfacememory.c b/sys/applemedia/iosurfacememory.c index af5c90e8d..09baaa815 100644 --- a/sys/applemedia/iosurfacememory.c +++ b/sys/applemedia/iosurfacememory.c @@ -147,6 +147,7 @@ gst_ios_surface_memory_init (void) _io_surface_memory_allocator = g_object_new (GST_TYPE_IO_SURFACE_MEMORY_ALLOCATOR, NULL); + gst_object_ref_sink (_io_surface_memory_allocator); gst_allocator_register (GST_IO_SURFACE_MEMORY_ALLOCATOR_NAME, gst_object_ref (_io_surface_memory_allocator)); diff --git a/sys/d3dvideosink/d3dhelpers.c b/sys/d3dvideosink/d3dhelpers.c index 9e7f95aaf..b1fa358d1 100644 --- a/sys/d3dvideosink/d3dhelpers.c +++ b/sys/d3dvideosink/d3dhelpers.c @@ -489,6 +489,7 @@ gst_d3dsurface_buffer_pool_new (GstD3DVideoSink * sink) GstD3DSurfaceBufferPool *pool; pool = g_object_new (GST_TYPE_D3DSURFACE_BUFFER_POOL, NULL); + gst_object_ref_sink (pool); pool->sink = gst_object_ref (sink); GST_LOG_OBJECT (pool, "new buffer pool %p", pool); @@ -559,9 +560,11 @@ gst_d3dsurface_buffer_pool_set_config (GstBufferPool * bpool, gst_buffer_pool_config_has_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META); - if (pool->add_metavideo) + if (pool->add_metavideo) { pool->allocator = g_object_new (GST_TYPE_D3D_SURFACE_MEMORY_ALLOCATOR, NULL); + gst_object_ref_sink (pool->allocator); + } return TRUE; } diff --git a/sys/kms/gstkmsallocator.c b/sys/kms/gstkmsallocator.c index 687ebf992..a3c444396 100644 --- a/sys/kms/gstkmsallocator.c +++ b/sys/kms/gstkmsallocator.c @@ -346,8 +346,13 @@ gst_kms_allocator_init (GstKMSAllocator * allocator) GstAllocator * gst_kms_allocator_new (int fd) { - return g_object_new (GST_TYPE_KMS_ALLOCATOR, "name", + GstAllocator *alloc; + + alloc = g_object_new (GST_TYPE_KMS_ALLOCATOR, "name", "KMSMemory::allocator", "drm-fd", fd, NULL); + gst_object_ref_sink (alloc); + + return alloc; } /* The mem_offsets are relative to the GstMemory start, unlike the vinfo->offset diff --git a/sys/kms/gstkmsbufferpool.c b/sys/kms/gstkmsbufferpool.c index 329135c10..5e12d3fbe 100644 --- a/sys/kms/gstkmsbufferpool.c +++ b/sys/kms/gstkmsbufferpool.c @@ -209,5 +209,10 @@ gst_kms_buffer_pool_class_init (GstKMSBufferPoolClass * klass) GstBufferPool * gst_kms_buffer_pool_new (void) { - return g_object_new (GST_TYPE_KMS_BUFFER_POOL, NULL); + GstBufferPool *pool; + + pool = g_object_new (GST_TYPE_KMS_BUFFER_POOL, NULL); + gst_object_ref_sink (pool); + + return pool; } diff --git a/sys/shm/gstshmsink.c b/sys/shm/gstshmsink.c index b2e7dbeee..1e77c13df 100644 --- a/sys/shm/gstshmsink.c +++ b/sys/shm/gstshmsink.c @@ -334,6 +334,8 @@ gst_shm_sink_allocator_new (GstShmSink * sink) { GstShmSinkAllocator *self = g_object_new (GST_TYPE_SHM_SINK_ALLOCATOR, NULL); + gst_object_ref_sink (self); + self->sink = gst_object_ref (sink); return self; diff --git a/sys/vdpau/gstvdpvideobufferpool.c b/sys/vdpau/gstvdpvideobufferpool.c index c89ca3635..33f346e48 100644 --- a/sys/vdpau/gstvdpvideobufferpool.c +++ b/sys/vdpau/gstvdpvideobufferpool.c @@ -171,6 +171,7 @@ gst_vdp_video_buffer_pool_new (GstVdpDevice * device) GstVdpVideoBufferPool *pool; pool = g_object_new (GST_TYPE_VDP_VIDEO_BUFFER_POOL, NULL); + g_object_ref_sink (pool); pool->device = gst_object_ref (device); GST_LOG_OBJECT (pool, "new VdpVideo buffer pool %p", pool); diff --git a/sys/vdpau/gstvdpvideomemory.c b/sys/vdpau/gstvdpvideomemory.c index 92aff573a..17778a0bb 100644 --- a/sys/vdpau/gstvdpvideomemory.c +++ b/sys/vdpau/gstvdpvideomemory.c @@ -283,6 +283,7 @@ gst_vdp_video_memory_init (void) if (g_once_init_enter (&_init)) { _vdp_video_allocator = g_object_new (gst_vdp_video_allocator_get_type (), NULL); + gst_object_ref_sink (_vdp_video_allocator); gst_allocator_register (GST_VDP_VIDEO_MEMORY_ALLOCATOR, gst_object_ref (_vdp_video_allocator)); |