From 11e375486e07cfa0686a97b5cf6110909b3a828c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 26 Sep 2011 15:34:54 +0200 Subject: [PATCH] audioencoder: Use GST_BOILERPLATE instead of custom GObject boilerplate code --- gst-libs/gst/audio/gstaudioencoder.c | 59 +++++++++------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 19e946c975..9a3d75c0f9 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -245,45 +245,6 @@ struct _GstAudioEncoderPrivate GstTagList *tags; }; - -static GstElementClass *parent_class = NULL; - -static void gst_audio_encoder_class_init (GstAudioEncoderClass * klass); -static void gst_audio_encoder_init (GstAudioEncoder * parse, - GstAudioEncoderClass * klass); - -GType -gst_audio_encoder_get_type (void) -{ - static GType audio_encoder_type = 0; - - if (!audio_encoder_type) { - static const GTypeInfo audio_encoder_info = { - sizeof (GstAudioEncoderClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gst_audio_encoder_class_init, - NULL, - NULL, - sizeof (GstAudioEncoder), - 0, - (GInstanceInitFunc) gst_audio_encoder_init, - }; - const GInterfaceInfo preset_interface_info = { - NULL, /* interface_init */ - NULL, /* interface_finalize */ - NULL /* interface_data */ - }; - - audio_encoder_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstAudioEncoder", &audio_encoder_info, G_TYPE_FLAG_ABSTRACT); - - g_type_add_interface_static (audio_encoder_type, GST_TYPE_PRESET, - &preset_interface_info); - } - return audio_encoder_type; -} - static void gst_audio_encoder_finalize (GObject * object); static void gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full); @@ -303,6 +264,20 @@ static gboolean gst_audio_encoder_sink_query (GstPad * pad, GstQuery * query); static const GstQueryType *gst_audio_encoder_get_query_types (GstPad * pad); static GstCaps *gst_audio_encoder_sink_getcaps (GstPad * pad); +static void +do_init (GType gtype) +{ + const GInterfaceInfo preset_interface_info = { + NULL, /* interface_init */ + NULL, /* interface_finalize */ + NULL /* interface_data */ + }; + + g_type_add_interface_static (gtype, GST_TYPE_PRESET, &preset_interface_info); +} + +GST_BOILERPLATE_FULL (GstAudioEncoder, gst_audio_encoder, GstElement, + GST_TYPE_ELEMENT, do_init); static void gst_audio_encoder_class_init (GstAudioEncoderClass * klass) @@ -310,7 +285,6 @@ gst_audio_encoder_class_init (GstAudioEncoderClass * klass) GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); GST_DEBUG_CATEGORY_INIT (gst_audio_encoder_debug, "audioencoder", 0, "audio encoder base class"); @@ -342,6 +316,11 @@ gst_audio_encoder_class_init (GstAudioEncoderClass * klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } +static void +gst_audio_encoder_base_init (gpointer g_class) +{ +} + static void gst_audio_encoder_init (GstAudioEncoder * enc, GstAudioEncoderClass * bclass) {