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);
_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));
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,
{
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;
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;
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);
}
_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));
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
_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));
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);
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;
}
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) {
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;
GstVulkanWindowWayland *
gst_vulkan_window_wayland_new (GstVulkanDisplay * display)
{
+ GstVulkanWindowWayland *window;
+
if ((gst_vulkan_display_get_handle_type (display) &
GST_VULKAN_DISPLAY_TYPE_WAYLAND)
== 0)
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
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);
GstVulkanWindowXCB *
gst_vulkan_window_xcb_new (GstVulkanDisplay * display)
{
+ GstVulkanWindowXCB *window;
+
_init_debug ();
if ((gst_vulkan_display_get_handle_type (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
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 *
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
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
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;
}
} 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);
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
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 */
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
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
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
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
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);
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;
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);
_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,
_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);
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,
* gst_gl_color_convert_new:
* @context: a #GstGLContext
*
- * Returns: a new #GstGLColorConvert object
+ * Returns: (transfer full): a new #GstGLColorConvert object
*
* Since: 1.4
*/
GstGLColorConvert *convert;
convert = g_object_new (GST_TYPE_GL_COLOR_CONVERT, NULL);
+ gst_object_ref_sink (convert);
convert->context = gst_object_ref (context);
* 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
*/
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 */
"(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;
*
* Returns: a new #GstGLFramebuffer
*
- * Since: 1.10
+ * Since: (transfer full): 1.10
*/
GstGLFramebuffer *
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;
}
"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);
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);
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,
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);
_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);
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 *))) {
* @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
*/
* @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
*/
* @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
*/
* 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
*/
* 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
*/
* 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)
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
/**
* 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;
}
/**
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;
}
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) {
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
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) {
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;
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 */
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
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
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
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
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);
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;
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,
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
* 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,
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);
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;
}
/**
_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));
_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));
_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));
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);
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;
}
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
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;
}
{
GstShmSinkAllocator *self = g_object_new (GST_TYPE_SHM_SINK_ALLOCATOR, NULL);
+ gst_object_ref_sink (self);
+
self->sink = gst_object_ref (sink);
return self;
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);
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));