From 857200ff4046f172aeda5a6225531bd72b416e3b Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 8 May 2014 15:30:49 +1000 Subject: [PATCH] gl: make all GObjects inherit from GstObject Aids memory leak debugging with GST_TRACE=mem-live --- gst-libs/gst/gl/gstglcolorconvert.c | 4 ++-- gst-libs/gst/gl/gstglcolorconvert.h | 4 ++-- gst-libs/gst/gl/gstglcontext.c | 2 +- gst-libs/gst/gl/gstglcontext.h | 4 ++-- gst-libs/gst/gl/gstgldisplay.c | 2 +- gst-libs/gst/gl/gstgldownload.c | 2 +- gst-libs/gst/gl/gstgldownload.h | 4 ++-- gst-libs/gst/gl/gstglshader.c | 3 ++- gst-libs/gst/gl/gstglshader.h | 4 ++-- gst-libs/gst/gl/gstglupload.c | 2 +- gst-libs/gst/gl/gstglupload.h | 4 ++-- gst-libs/gst/gl/gstglwindow.c | 2 +- gst-libs/gst/gl/gstglwindow.h | 4 ++-- 13 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c index 906d5b0d1e..9bc7b600be 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.c +++ b/gst-libs/gst/gl/gstglcolorconvert.c @@ -374,8 +374,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_gl_color_convert_debug); #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_color_convert_debug, "glconvert", 0, "convert"); -G_DEFINE_TYPE_WITH_CODE (GstGLColorConvert, gst_gl_color_convert, G_TYPE_OBJECT, - DEBUG_INIT); +G_DEFINE_TYPE_WITH_CODE (GstGLColorConvert, gst_gl_color_convert, + GST_TYPE_OBJECT, DEBUG_INIT); static void gst_gl_color_convert_finalize (GObject * object); #define GST_GL_COLOR_CONVERT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \ diff --git a/gst-libs/gst/gl/gstglcolorconvert.h b/gst-libs/gst/gl/gstglcolorconvert.h index 9b416a5cae..d259c2887e 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.h +++ b/gst-libs/gst/gl/gstglcolorconvert.h @@ -44,7 +44,7 @@ GType gst_gl_color_convert_get_type (void); struct _GstGLColorConvert { /* */ - GObject parent; + GstObject parent; GMutex lock; @@ -79,7 +79,7 @@ struct _GstGLColorConvert */ struct _GstGLColorConvertClass { - GObjectClass object_class; + GstObjectClass object_class; }; /** diff --git a/gst-libs/gst/gl/gstglcontext.c b/gst-libs/gst/gl/gstglcontext.c index 196dc8358d..cae532c1db 100644 --- a/gst-libs/gst/gl/gstglcontext.c +++ b/gst-libs/gst/gl/gstglcontext.c @@ -122,7 +122,7 @@ load_gles2_module (gpointer user_data) GST_DEBUG_CATEGORY (GST_CAT_DEFAULT); #define gst_gl_context_parent_class parent_class -G_DEFINE_ABSTRACT_TYPE (GstGLContext, gst_gl_context, G_TYPE_OBJECT); +G_DEFINE_ABSTRACT_TYPE (GstGLContext, gst_gl_context, GST_TYPE_OBJECT); #define GST_GL_CONTEXT_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_GL_TYPE_CONTEXT, GstGLContextPrivate)) diff --git a/gst-libs/gst/gl/gstglcontext.h b/gst-libs/gst/gl/gstglcontext.h index 97e4326a41..edf347ffe9 100644 --- a/gst-libs/gst/gl/gstglcontext.h +++ b/gst-libs/gst/gl/gstglcontext.h @@ -68,7 +68,7 @@ typedef enum */ struct _GstGLContext { /*< private >*/ - GObject parent; + GstObject parent; GstGLWindow *window; @@ -91,7 +91,7 @@ struct _GstGLContext { * @swap_buffers: swap the default framebuffer's front/back buffers */ struct _GstGLContextClass { - GObjectClass parent_class; + GstObjectClass parent_class; guintptr (*get_gl_context) (GstGLContext *context); GstGLAPI (*get_gl_api) (GstGLContext *context); diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 5bee1b1d1f..3c07cf4702 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -55,7 +55,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_gl_display_debug); GST_DEBUG_CATEGORY_INIT (gst_gl_display_debug, "gldisplay", 0, "opengl display"); \ GST_DEBUG_CATEGORY_GET (gst_context, "GST_CONTEXT"); -G_DEFINE_TYPE_WITH_CODE (GstGLDisplay, gst_gl_display, G_TYPE_OBJECT, +G_DEFINE_TYPE_WITH_CODE (GstGLDisplay, gst_gl_display, GST_TYPE_OBJECT, DEBUG_INIT); #define GST_GL_DISPLAY_GET_PRIVATE(o) \ diff --git a/gst-libs/gst/gl/gstgldownload.c b/gst-libs/gst/gl/gstgldownload.c index fd8216e1d9..15586ab89a 100644 --- a/gst-libs/gst/gl/gstgldownload.c +++ b/gst-libs/gst/gl/gstgldownload.c @@ -67,7 +67,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_gl_download_debug); #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_download_debug, "gldownload", 0, "download"); -G_DEFINE_TYPE_WITH_CODE (GstGLDownload, gst_gl_download, G_TYPE_OBJECT, +G_DEFINE_TYPE_WITH_CODE (GstGLDownload, gst_gl_download, GST_TYPE_OBJECT, DEBUG_INIT); static void gst_gl_download_finalize (GObject * object); diff --git a/gst-libs/gst/gl/gstgldownload.h b/gst-libs/gst/gl/gstgldownload.h index 831b2cf665..42a36ac30e 100644 --- a/gst-libs/gst/gl/gstgldownload.h +++ b/gst-libs/gst/gl/gstgldownload.h @@ -44,7 +44,7 @@ GType gst_gl_download_get_type (void); struct _GstGLDownload { /* */ - GObject parent; + GstObject parent; GMutex lock; @@ -74,7 +74,7 @@ struct _GstGLDownload struct _GstGLDownloadClass { /* */ - GObjectClass object_class; + GstObjectClass object_class; }; GstGLDownload * gst_gl_download_new (GstGLContext * context); diff --git a/gst-libs/gst/gl/gstglshader.c b/gst-libs/gst/gl/gstglshader.c index 3482a04469..f274b773a2 100644 --- a/gst-libs/gst/gl/gstglshader.c +++ b/gst-libs/gst/gl/gstglshader.c @@ -115,7 +115,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_gl_shader_debug); #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_shader_debug, "glshader", 0, "shader"); -G_DEFINE_TYPE_WITH_CODE (GstGLShader, gst_gl_shader, G_TYPE_OBJECT, DEBUG_INIT); +G_DEFINE_TYPE_WITH_CODE (GstGLShader, gst_gl_shader, GST_TYPE_OBJECT, + DEBUG_INIT); static void _cleanup_shader (GstGLContext * context, GstGLShader * shader) diff --git a/gst-libs/gst/gl/gstglshader.h b/gst-libs/gst/gl/gstglshader.h index 73cc8ebfd5..a56b642f53 100644 --- a/gst-libs/gst/gl/gstglshader.h +++ b/gst-libs/gst/gl/gstglshader.h @@ -48,7 +48,7 @@ typedef enum { struct _GstGLShader { /*< private >*/ - GObject parent; + GstObject parent; GstGLContext *context; @@ -57,7 +57,7 @@ struct _GstGLShader { struct _GstGLShaderClass { /*< private >*/ - GObjectClass parent_class; + GstObjectClass parent_class; }; /* methods */ diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index de1760b286..dba38a2fc9 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -92,7 +92,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug); #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_upload_debug, "glupload", 0, "upload"); -G_DEFINE_TYPE_WITH_CODE (GstGLUpload, gst_gl_upload, G_TYPE_OBJECT, DEBUG_INIT); +G_DEFINE_TYPE_WITH_CODE (GstGLUpload, gst_gl_upload, GST_TYPE_OBJECT, DEBUG_INIT); static void gst_gl_upload_finalize (GObject * object); diff --git a/gst-libs/gst/gl/gstglupload.h b/gst-libs/gst/gl/gstglupload.h index d2c53a3401..51ee1315ea 100644 --- a/gst-libs/gst/gl/gstglupload.h +++ b/gst-libs/gst/gl/gstglupload.h @@ -44,7 +44,7 @@ GType gst_gl_upload_get_type (void); struct _GstGLUpload { /* */ - GObject parent; + GstObject parent; GMutex lock; @@ -72,7 +72,7 @@ struct _GstGLUpload */ struct _GstGLUploadClass { - GObjectClass object_class; + GstObjectClass object_class; }; GstGLUpload * gst_gl_upload_new (GstGLContext * context); diff --git a/gst-libs/gst/gl/gstglwindow.c b/gst-libs/gst/gl/gstglwindow.c index 84dbd31eae..329327ba1a 100644 --- a/gst-libs/gst/gl/gstglwindow.c +++ b/gst-libs/gst/gl/gstglwindow.c @@ -72,7 +72,7 @@ GST_DEBUG_CATEGORY (GST_CAT_DEFAULT); #define gst_gl_window_parent_class parent_class -G_DEFINE_ABSTRACT_TYPE (GstGLWindow, gst_gl_window, G_TYPE_OBJECT); +G_DEFINE_ABSTRACT_TYPE (GstGLWindow, gst_gl_window, GST_TYPE_OBJECT); #define GST_GL_WINDOW_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_GL_TYPE_WINDOW, GstGLWindowPrivate)) diff --git a/gst-libs/gst/gl/gstglwindow.h b/gst-libs/gst/gl/gstglwindow.h index 217f03cbb3..518661ffbc 100644 --- a/gst-libs/gst/gl/gstglwindow.h +++ b/gst-libs/gst/gl/gstglwindow.h @@ -64,7 +64,7 @@ typedef void (*GstGLWindowResizeCB) (gpointer data, guint width, guint height); */ struct _GstGLWindow { /*< private >*/ - GObject parent; + GstObject parent; GMutex lock; @@ -109,7 +109,7 @@ struct _GstGLWindow { * @close: close the connection to the display */ struct _GstGLWindowClass { - GObjectClass parent_class; + GstObjectClass parent_class; guintptr (*get_display) (GstGLWindow *window); void (*set_window_handle) (GstGLWindow *window, guintptr id);