From d57dc6534f0a33229123ae19e96a3c893f45ffab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 24 Jun 2018 00:17:26 +0200 Subject: [PATCH] gl: Update for g_type_class_add_private() deprecation in recent GLib --- ext/gl/gstglbasemixer.c | 20 +++++--------------- ext/gl/gstglmixer.c | 14 +++++--------- ext/gl/gstglmixerbin.c | 7 ++----- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/ext/gl/gstglbasemixer.c b/ext/gl/gstglbasemixer.c index 0dd3f81..0284c8d 100644 --- a/ext/gl/gstglbasemixer.c +++ b/ext/gl/gstglbasemixer.c @@ -28,10 +28,6 @@ #include "gstglbasemixer.h" -#define gst_gl_base_mixer_parent_class parent_class -G_DEFINE_ABSTRACT_TYPE (GstGLBaseMixer, gst_gl_base_mixer, - GST_TYPE_VIDEO_AGGREGATOR); - #define GST_CAT_DEFAULT gst_gl_base_mixer_debug GST_DEBUG_CATEGORY (gst_gl_base_mixer_debug); @@ -45,14 +41,6 @@ static void gst_gl_base_mixer_set_context (GstElement * element, static GstStateChangeReturn gst_gl_base_mixer_change_state (GstElement * element, GstStateChange transition); -enum -{ - PROP_PAD_0 -}; - -#define GST_GL_BASE_MIXER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_BASE_MIXER, GstGLBaseMixerPrivate)) - struct _GstGLBaseMixerPrivate { gboolean negotiated; @@ -60,6 +48,10 @@ struct _GstGLBaseMixerPrivate GstGLContext *other_context; }; +#define gst_gl_base_mixer_parent_class parent_class +G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLBaseMixer, gst_gl_base_mixer, + GST_TYPE_VIDEO_AGGREGATOR); + G_DEFINE_TYPE (GstGLBaseMixerPad, gst_gl_base_mixer_pad, GST_TYPE_VIDEO_AGGREGATOR_PAD); @@ -260,8 +252,6 @@ gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass) gobject_class = (GObjectClass *) klass; element_class = GST_ELEMENT_CLASS (klass); - g_type_class_add_private (klass, sizeof (GstGLBaseMixerPrivate)); - gobject_class->get_property = gst_gl_base_mixer_get_property; gobject_class->set_property = gst_gl_base_mixer_set_property; @@ -292,7 +282,7 @@ gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass) static void gst_gl_base_mixer_init (GstGLBaseMixer * mix) { - mix->priv = GST_GL_BASE_MIXER_GET_PRIVATE (mix); + mix->priv = gst_gl_base_mixer_get_instance_private (mix); } static void diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c index fcc9542..682622d 100644 --- a/ext/gl/gstglmixer.c +++ b/ext/gl/gstglmixer.c @@ -30,9 +30,6 @@ #include "gstglmixer.h" -#define gst_gl_mixer_parent_class parent_class -G_DEFINE_ABSTRACT_TYPE (GstGLMixer, gst_gl_mixer, GST_TYPE_GL_BASE_MIXER); - #define GST_CAT_DEFAULT gst_gl_mixer_debug GST_DEBUG_CATEGORY (gst_gl_mixer_debug); @@ -51,9 +48,6 @@ enum PROP_PAD_0 }; -#define GST_GL_MIXER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_MIXER, GstGLMixerPrivate)) - struct _GstGLMixerPrivate { gboolean negotiated; @@ -63,6 +57,10 @@ struct _GstGLMixerPrivate GCond gl_resource_cond; }; +#define gst_gl_mixer_parent_class parent_class +G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLMixer, gst_gl_mixer, + GST_TYPE_GL_BASE_MIXER); + G_DEFINE_TYPE (GstGLMixerPad, gst_gl_mixer_pad, GST_TYPE_GL_BASE_MIXER_PAD); static void @@ -407,8 +405,6 @@ gst_gl_mixer_class_init (GstGLMixerClass * klass) GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixer", 0, "OpenGL mixer"); - g_type_class_add_private (klass, sizeof (GstGLMixerPrivate)); - gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gl_mixer_finalize); gobject_class->get_property = gst_gl_mixer_get_property; @@ -446,7 +442,7 @@ gst_gl_mixer_reset (GstGLMixer * mix) static void gst_gl_mixer_init (GstGLMixer * mix) { - mix->priv = GST_GL_MIXER_GET_PRIVATE (mix); + mix->priv = gst_gl_mixer_get_instance_private (mix); mix->priv->gl_resource_ready = FALSE; g_mutex_init (&mix->priv->gl_resource_lock); diff --git a/ext/gl/gstglmixerbin.c b/ext/gl/gstglmixerbin.c index 1e6ebeb..94525e1 100644 --- a/ext/gl/gstglmixerbin.c +++ b/ext/gl/gstglmixerbin.c @@ -126,9 +126,8 @@ enum static void gst_gl_mixer_bin_child_proxy_init (gpointer g_iface, gpointer iface_data); -#define GST_GL_MIXER_BIN_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_MIXER_BIN, GstGLMixerBinPrivate)) G_DEFINE_TYPE_WITH_CODE (GstGLMixerBin, gst_gl_mixer_bin, GST_TYPE_BIN, + G_ADD_PRIVATE (GstGLMixerBin) G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY, gst_gl_mixer_bin_child_proxy_init)); @@ -159,8 +158,6 @@ gst_gl_mixer_bin_class_init (GstGLMixerBinClass * klass) GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstCaps *upload_caps; - g_type_class_add_private (klass, sizeof (GstGLMixerBinPrivate)); - GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixerbin", 0, "opengl mixer bin"); @@ -233,7 +230,7 @@ gst_gl_mixer_bin_init (GstGLMixerBin * self) gboolean res = TRUE; GstPad *pad; - self->priv = GST_GL_MIXER_BIN_GET_PRIVATE (self); + self->priv = gst_gl_mixer_bin_get_instance_private (self); self->out_convert = gst_element_factory_make ("glcolorconvert", NULL); self->download = gst_element_factory_make ("gldownload", NULL); -- 2.7.4