From 353186aec8296570061d6881b823ef3c8f66c904 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 19 Apr 2011 14:11:32 +0200 Subject: [PATCH] ext: Use G_DEFINE_TYPE instead of GST_BOILERPLATE --- ext/alsa/gstalsamixerelement.c | 24 ++++++-------- ext/alsa/gstalsamixertrack.c | 5 +-- ext/alsa/gstalsasink.c | 30 ++++++++--------- ext/alsa/gstalsasrc.c | 30 ++++++++--------- ext/cdparanoia/gstcdparanoiasrc.c | 23 +++++-------- ext/gio/gstgiobasesink.c | 25 ++++++-------- ext/gio/gstgiobasesrc.c | 25 ++++++-------- ext/gio/gstgiosink.c | 30 ++++++++--------- ext/gio/gstgiosrc.c | 30 ++++++++--------- ext/gio/gstgiostreamsink.c | 30 +++++++---------- ext/gio/gstgiostreamsrc.c | 29 +++++++--------- ext/gnomevfs/gstgnomevfssink.c | 29 ++++++++-------- ext/gnomevfs/gstgnomevfssrc.c | 70 +++++++++------------------------------ ext/ogg/gstoggdemux.c | 25 ++++++-------- ext/ogg/gstoggmux.c | 68 ++++++++----------------------------- ext/pango/gstbasetextoverlay.c | 35 ++++++++++++++++++-- ext/pango/gstclockoverlay.c | 25 ++++++-------- ext/pango/gsttextrender.c | 35 +++++++++----------- ext/pango/gsttimeoverlay.c | 24 ++++++-------- ext/theora/gsttheoradec.c | 32 ++++++++---------- ext/theora/gsttheoraenc.c | 46 ++++++++----------------- ext/theora/gsttheoraparse.c | 31 ++++++++--------- ext/vorbis/gstvorbisdec.c | 35 ++++++++------------ ext/vorbis/gstvorbisenc.c | 34 ++++++++----------- ext/vorbis/gstvorbisparse.c | 28 ++++++---------- ext/vorbis/gstvorbistag.c | 30 ++++------------- 26 files changed, 324 insertions(+), 504 deletions(-) diff --git a/ext/alsa/gstalsamixerelement.c b/ext/alsa/gstalsamixerelement.c index ec80039..66e9135 100644 --- a/ext/alsa/gstalsamixerelement.c +++ b/ext/alsa/gstalsamixerelement.c @@ -36,9 +36,10 @@ enum }; static void gst_alsa_mixer_element_init_interfaces (GType type); - -GST_BOILERPLATE_FULL (GstAlsaMixerElement, gst_alsa_mixer_element, - GstElement, GST_TYPE_ELEMENT, gst_alsa_mixer_element_init_interfaces); +#define gst_alsa_mixer_element_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstAlsaMixerElement, gst_alsa_mixer_element, + GST_TYPE_ELEMENT, + gst_alsa_mixer_element_init_interfaces (g_define_type_id)); /* massive macro that takes care of all the GstMixer stuff */ GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaMixerElement, gst_alsa_mixer_element); @@ -91,15 +92,6 @@ gst_alsa_mixer_element_init_interfaces (GType type) } static void -gst_alsa_mixer_element_base_init (gpointer klass) -{ - gst_element_class_set_details_simple (GST_ELEMENT_CLASS (klass), - "Alsa mixer", "Generic/Audio", - "Control sound input and output levels with ALSA", - "Leif Johnson "); -} - -static void gst_alsa_mixer_element_class_init (GstAlsaMixerElementClass * klass) { GstElementClass *element_class; @@ -122,6 +114,11 @@ gst_alsa_mixer_element_class_init (GstAlsaMixerElementClass * klass) "Human-readable name of the sound device", DEFAULT_PROP_DEVICE_NAME, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + gst_element_class_set_details_simple (element_class, + "Alsa mixer", "Generic/Audio", + "Control sound input and output levels with ALSA", + "Leif Johnson "); + element_class->change_state = GST_DEBUG_FUNCPTR (gst_alsa_mixer_element_change_state); } @@ -137,8 +134,7 @@ gst_alsa_mixer_element_finalize (GObject * obj) } static void -gst_alsa_mixer_element_init (GstAlsaMixerElement * this, - GstAlsaMixerElementClass * klass) +gst_alsa_mixer_element_init (GstAlsaMixerElement * this) { this->mixer = NULL; this->device = g_strdup (DEFAULT_PROP_DEVICE); diff --git a/ext/alsa/gstalsamixertrack.c b/ext/alsa/gstalsamixertrack.c index a1fdb7f..dea8ef0 100644 --- a/ext/alsa/gstalsamixertrack.c +++ b/ext/alsa/gstalsamixertrack.c @@ -170,7 +170,8 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t * element, GST_LOG ("[%s] created new mixer track %p", name, track); /* This reflects the assumptions used for GstAlsaMixerTrack */ - if (!(!!(flags & GST_MIXER_TRACK_OUTPUT) ^ !!(flags & GST_MIXER_TRACK_INPUT))) { + if (!(! !(flags & GST_MIXER_TRACK_OUTPUT) ^ ! !(flags & + GST_MIXER_TRACK_INPUT))) { GST_ERROR ("Mixer track must be either output or input!"); g_return_val_if_reached (NULL); } @@ -302,7 +303,7 @@ gst_alsa_mixer_track_update (GstAlsaMixerTrack * alsa_track) } } - if (!!(audible) != !(track->flags & GST_MIXER_TRACK_MUTE)) { + if (! !(audible) != !(track->flags & GST_MIXER_TRACK_MUTE)) { if (audible) { track->flags &= ~GST_MIXER_TRACK_MUTE; diff --git a/ext/alsa/gstalsasink.c b/ext/alsa/gstalsasink.c index 2fb37df..1f4529f 100644 --- a/ext/alsa/gstalsasink.c +++ b/ext/alsa/gstalsasink.c @@ -69,9 +69,9 @@ enum }; static void gst_alsasink_init_interfaces (GType type); - -GST_BOILERPLATE_FULL (GstAlsaSink, gst_alsasink, GstAudioSink, - GST_TYPE_AUDIO_SINK, gst_alsasink_init_interfaces); +#define gst_alsasink_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstAlsaSink, gst_alsasink, + GST_TYPE_AUDIO_SINK, gst_alsasink_init_interfaces (g_define_type_id)); static void gst_alsasink_finalise (GObject * object); static void gst_alsasink_set_property (GObject * object, @@ -164,26 +164,15 @@ gst_alsasink_init_interfaces (GType type) } static void -gst_alsasink_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_set_details_simple (element_class, - "Audio sink (ALSA)", "Sink/Audio", - "Output to a sound card via ALSA", "Wim Taymans "); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&alsasink_sink_factory)); -} - -static void gst_alsasink_class_init (GstAlsaSinkClass * klass) { GObjectClass *gobject_class; + GstElementClass *gstelement_class; GstBaseSinkClass *gstbasesink_class; GstAudioSinkClass *gstaudiosink_class; gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass; gstaudiosink_class = (GstAudioSinkClass *) klass; @@ -193,6 +182,13 @@ gst_alsasink_class_init (GstAlsaSinkClass * klass) gobject_class->get_property = gst_alsasink_get_property; gobject_class->set_property = gst_alsasink_set_property; + gst_element_class_set_details_simple (gstelement_class, + "Audio sink (ALSA)", "Sink/Audio", + "Output to a sound card via ALSA", "Wim Taymans "); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&alsasink_sink_factory)); + gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_alsasink_getcaps); gstaudiosink_class->open = GST_DEBUG_FUNCPTR (gst_alsasink_open); @@ -271,7 +267,7 @@ gst_alsasink_get_property (GObject * object, guint prop_id, } static void -gst_alsasink_init (GstAlsaSink * alsasink, GstAlsaSinkClass * g_class) +gst_alsasink_init (GstAlsaSink * alsasink) { GST_DEBUG_OBJECT (alsasink, "initializing alsasink"); diff --git a/ext/alsa/gstalsasrc.c b/ext/alsa/gstalsasrc.c index d9e6bc8..8a4e3d3 100644 --- a/ext/alsa/gstalsasrc.c +++ b/ext/alsa/gstalsasrc.c @@ -65,9 +65,9 @@ enum }; static void gst_alsasrc_init_interfaces (GType type); - -GST_BOILERPLATE_FULL (GstAlsaSrc, gst_alsasrc, GstAudioSrc, - GST_TYPE_AUDIO_SRC, gst_alsasrc_init_interfaces); +#define gst_alsasrc_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstAlsaSrc, gst_alsasrc, + GST_TYPE_AUDIO_SRC, gst_alsasrc_init_interfaces (g_define_type_id)); GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaSrc, gst_alsasrc_mixer); @@ -183,26 +183,15 @@ gst_alsasrc_init_interfaces (GType type) } static void -gst_alsasrc_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_set_details_simple (element_class, - "Audio source (ALSA)", "Source/Audio", - "Read from a sound card via ALSA", "Wim Taymans "); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&alsasrc_src_factory)); -} - -static void gst_alsasrc_class_init (GstAlsaSrcClass * klass) { GObjectClass *gobject_class; + GstElementClass *gstelement_class; GstBaseSrcClass *gstbasesrc_class; GstAudioSrcClass *gstaudiosrc_class; gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; gstbasesrc_class = (GstBaseSrcClass *) klass; gstaudiosrc_class = (GstAudioSrcClass *) klass; @@ -210,6 +199,13 @@ gst_alsasrc_class_init (GstAlsaSrcClass * klass) gobject_class->get_property = gst_alsasrc_get_property; gobject_class->set_property = gst_alsasrc_set_property; + gst_element_class_set_details_simple (gstelement_class, + "Audio source (ALSA)", "Source/Audio", + "Read from a sound card via ALSA", "Wim Taymans "); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&alsasrc_src_factory)); + gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_alsasrc_getcaps); gstaudiosrc_class->open = GST_DEBUG_FUNCPTR (gst_alsasrc_open); @@ -287,7 +283,7 @@ gst_alsasrc_get_property (GObject * object, guint prop_id, } static void -gst_alsasrc_init (GstAlsaSrc * alsasrc, GstAlsaSrcClass * g_class) +gst_alsasrc_init (GstAlsaSrc * alsasrc) { GST_DEBUG_OBJECT (alsasrc, "initializing"); diff --git a/ext/cdparanoia/gstcdparanoiasrc.c b/ext/cdparanoia/gstcdparanoiasrc.c index bb1edbf..27907dc 100644 --- a/ext/cdparanoia/gstcdparanoiasrc.c +++ b/ext/cdparanoia/gstcdparanoiasrc.c @@ -56,8 +56,8 @@ enum GST_DEBUG_CATEGORY_STATIC (gst_cd_paranoia_src_debug); #define GST_CAT_DEFAULT gst_cd_paranoia_src_debug -GST_BOILERPLATE (GstCdParanoiaSrc, gst_cd_paranoia_src, GstCddaBaseSrc, - GST_TYPE_CDDA_BASE_SRC); +#define gst_cd_paranoia_src_parent_class parent_class +G_DEFINE_TYPE (GstCdParanoiaSrc, gst_cd_paranoia_src, GST_TYPE_CDDA_BASE_SRC); static void gst_cd_paranoia_src_finalize (GObject * obj); static void gst_cd_paranoia_src_get_property (GObject * object, guint prop_id, @@ -103,18 +103,7 @@ gst_cd_paranoia_mode_get_type (void) } static void -gst_cd_paranoia_src_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_set_details_simple (element_class, - "CD Audio (cdda) Source, Paranoia IV", "Source/File", - "Read audio from CD in paranoid mode", - "Erik Walthinsen , Wim Taymans "); -} - -static void -gst_cd_paranoia_src_init (GstCdParanoiaSrc * src, GstCdParanoiaSrcClass * klass) +gst_cd_paranoia_src_init (GstCdParanoiaSrc * src) { src->d = NULL; src->p = NULL; @@ -131,12 +120,18 @@ static void gst_cd_paranoia_src_class_init (GstCdParanoiaSrcClass * klass) { GstCddaBaseSrcClass *cddabasesrc_class = GST_CDDA_BASE_SRC_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = gst_cd_paranoia_src_set_property; gobject_class->get_property = gst_cd_paranoia_src_get_property; gobject_class->finalize = gst_cd_paranoia_src_finalize; + gst_element_class_set_details_simple (element_class, + "CD Audio (cdda) Source, Paranoia IV", "Source/File", + "Read audio from CD in paranoid mode", + "Erik Walthinsen , Wim Taymans "); + cddabasesrc_class->open = gst_cd_paranoia_src_open; cddabasesrc_class->close = gst_cd_paranoia_src_close; cddabasesrc_class->read_sector = gst_cd_paranoia_src_read_sector; diff --git a/ext/gio/gstgiobasesink.c b/ext/gio/gstgiobasesink.c index 123949b..4ea6bbc 100644 --- a/ext/gio/gstgiobasesink.c +++ b/ext/gio/gstgiobasesink.c @@ -33,8 +33,8 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); -GST_BOILERPLATE (GstGioBaseSink, gst_gio_base_sink, GstBaseSink, - GST_TYPE_BASE_SINK); +#define gst_gio_base_sink_parent_class parent_class +G_DEFINE_TYPE (GstGioBaseSink, gst_gio_base_sink, GST_TYPE_BASE_SINK); static void gst_gio_base_sink_finalize (GObject * object); static gboolean gst_gio_base_sink_start (GstBaseSink * base_sink); @@ -48,25 +48,20 @@ static GstFlowReturn gst_gio_base_sink_render (GstBaseSink * base_sink, static gboolean gst_gio_base_sink_query (GstPad * pad, GstQuery * query); static void -gst_gio_base_sink_base_init (gpointer gclass) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); - - GST_DEBUG_CATEGORY_INIT (gst_gio_base_sink_debug, "gio_base_sink", 0, - "GIO base sink"); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory)); -} - -static void gst_gio_base_sink_class_init (GstGioBaseSinkClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; + GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseSinkClass *gstbasesink_class = (GstBaseSinkClass *) klass; + GST_DEBUG_CATEGORY_INIT (gst_gio_base_sink_debug, "gio_base_sink", 0, + "GIO base sink"); + gobject_class->finalize = gst_gio_base_sink_finalize; + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sink_factory)); + gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_gio_base_sink_start); gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_sink_stop); gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_gio_base_sink_unlock); @@ -77,7 +72,7 @@ gst_gio_base_sink_class_init (GstGioBaseSinkClass * klass) } static void -gst_gio_base_sink_init (GstGioBaseSink * sink, GstGioBaseSinkClass * gclass) +gst_gio_base_sink_init (GstGioBaseSink * sink) { gst_pad_set_query_function (GST_BASE_SINK_PAD (sink), GST_DEBUG_FUNCPTR (gst_gio_base_sink_query)); diff --git a/ext/gio/gstgiobasesrc.c b/ext/gio/gstgiobasesrc.c index 7850f9d..a31c054 100644 --- a/ext/gio/gstgiobasesrc.c +++ b/ext/gio/gstgiobasesrc.c @@ -35,8 +35,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY); -GST_BOILERPLATE (GstGioBaseSrc, gst_gio_base_src, GstBaseSrc, - GST_TYPE_BASE_SRC); +#define gst_gio_base_src_parent_class parent_class +G_DEFINE_TYPE (GstGioBaseSrc, gst_gio_base_src, GST_TYPE_BASE_SRC); static void gst_gio_base_src_finalize (GObject * object); @@ -54,25 +54,20 @@ static gboolean gst_gio_base_src_query (GstBaseSrc * base_src, GstQuery * query); static void -gst_gio_base_src_base_init (gpointer gclass) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); - - GST_DEBUG_CATEGORY_INIT (gst_gio_base_src_debug, "gio_base_src", 0, - "GIO base source"); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&src_factory)); -} - -static void gst_gio_base_src_class_init (GstGioBaseSrcClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; + GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass; + GST_DEBUG_CATEGORY_INIT (gst_gio_base_src_debug, "gio_base_src", 0, + "GIO base source"); + gobject_class->finalize = gst_gio_base_src_finalize; + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&src_factory)); + gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_gio_base_src_start); gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_src_stop); gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gio_base_src_get_size); @@ -88,7 +83,7 @@ gst_gio_base_src_class_init (GstGioBaseSrcClass * klass) } static void -gst_gio_base_src_init (GstGioBaseSrc * src, GstGioBaseSrcClass * gclass) +gst_gio_base_src_init (GstGioBaseSrc * src) { src->cancel = g_cancellable_new (); } diff --git a/ext/gio/gstgiosink.c b/ext/gio/gstgiosink.c index 69e05e5..fe7a23f 100644 --- a/ext/gio/gstgiosink.c +++ b/ext/gio/gstgiosink.c @@ -92,8 +92,9 @@ enum PROP_FILE }; -GST_BOILERPLATE_FULL (GstGioSink, gst_gio_sink, GstGioBaseSink, - GST_TYPE_GIO_BASE_SINK, gst_gio_uri_handler_do_init); +#define gst_gio_sink_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstGioSink, gst_gio_sink, GST_TYPE_GIO_BASE_SINK, + gst_gio_uri_handler_do_init (g_define_type_id)); static void gst_gio_sink_finalize (GObject * object); static void gst_gio_sink_set_property (GObject * object, guint prop_id, @@ -103,25 +104,14 @@ static void gst_gio_sink_get_property (GObject * object, guint prop_id, static GOutputStream *gst_gio_sink_get_stream (GstGioBaseSink * base_sink); static void -gst_gio_sink_base_init (gpointer gclass) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); - - GST_DEBUG_CATEGORY_INIT (gst_gio_sink_debug, "gio_sink", 0, "GIO sink"); - - gst_element_class_set_details_simple (element_class, "GIO sink", - "Sink/File", - "Write to any GIO-supported location", - "Ren\xc3\xa9 Stadler , " - "Sebastian Dröge "); -} - -static void gst_gio_sink_class_init (GstGioSinkClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; + GstElementClass *gstelement_class = (GstElementClass *) klass; GstGioBaseSinkClass *gstgiobasesink_class = (GstGioBaseSinkClass *) klass; + GST_DEBUG_CATEGORY_INIT (gst_gio_sink_debug, "gio_sink", 0, "GIO sink"); + gobject_class->finalize = gst_gio_sink_finalize; gobject_class->set_property = gst_gio_sink_set_property; gobject_class->get_property = gst_gio_sink_get_property; @@ -141,13 +131,19 @@ gst_gio_sink_class_init (GstGioSinkClass * klass) g_param_spec_object ("file", "File", "GFile to write to", G_TYPE_FILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_element_class_set_details_simple (gstelement_class, "GIO sink", + "Sink/File", + "Write to any GIO-supported location", + "Ren\xc3\xa9 Stadler , " + "Sebastian Dröge "); + gstgiobasesink_class->get_stream = GST_DEBUG_FUNCPTR (gst_gio_sink_get_stream); gstgiobasesink_class->close_on_stop = TRUE; } static void -gst_gio_sink_init (GstGioSink * sink, GstGioSinkClass * gclass) +gst_gio_sink_init (GstGioSink * sink) { } diff --git a/ext/gio/gstgiosrc.c b/ext/gio/gstgiosrc.c index 5fd810e..62e8c2b 100644 --- a/ext/gio/gstgiosrc.c +++ b/ext/gio/gstgiosrc.c @@ -83,8 +83,9 @@ enum PROP_FILE }; -GST_BOILERPLATE_FULL (GstGioSrc, gst_gio_src, GstGioBaseSrc, - GST_TYPE_GIO_BASE_SRC, gst_gio_uri_handler_do_init); +#define gst_gio_src_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstGioSrc, gst_gio_src, + GST_TYPE_GIO_BASE_SRC, gst_gio_uri_handler_do_init (g_define_type_id)); static void gst_gio_src_finalize (GObject * object); @@ -98,26 +99,15 @@ static GInputStream *gst_gio_src_get_stream (GstGioBaseSrc * bsrc); static gboolean gst_gio_src_check_get_range (GstBaseSrc * base_src); static void -gst_gio_src_base_init (gpointer gclass) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); - - GST_DEBUG_CATEGORY_INIT (gst_gio_src_debug, "gio_src", 0, "GIO source"); - - gst_element_class_set_details_simple (element_class, "GIO source", - "Source/File", - "Read from any GIO-supported location", - "Ren\xc3\xa9 Stadler , " - "Sebastian Dröge "); -} - -static void gst_gio_src_class_init (GstGioSrcClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; + GstElementClass *gstelement_class = (GstElementClass *) klass; GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass; GstGioBaseSrcClass *gstgiobasesrc_class = (GstGioBaseSrcClass *) klass; + GST_DEBUG_CATEGORY_INIT (gst_gio_src_debug, "gio_src", 0, "GIO source"); + gobject_class->finalize = gst_gio_src_finalize; gobject_class->set_property = gst_gio_src_set_property; gobject_class->get_property = gst_gio_src_get_property; @@ -137,6 +127,12 @@ gst_gio_src_class_init (GstGioSrcClass * klass) g_param_spec_object ("file", "File", "GFile to read from", G_TYPE_FILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_element_class_set_details_simple (gstelement_class, "GIO source", + "Source/File", + "Read from any GIO-supported location", + "Ren\xc3\xa9 Stadler , " + "Sebastian Dröge "); + gstbasesrc_class->check_get_range = GST_DEBUG_FUNCPTR (gst_gio_src_check_get_range); @@ -145,7 +141,7 @@ gst_gio_src_class_init (GstGioSrcClass * klass) } static void -gst_gio_src_init (GstGioSrc * src, GstGioSrcClass * gclass) +gst_gio_src_init (GstGioSrc * src) { } diff --git a/ext/gio/gstgiostreamsink.c b/ext/gio/gstgiostreamsink.c index 02dac71..a76a1e2 100644 --- a/ext/gio/gstgiostreamsink.c +++ b/ext/gio/gstgiostreamsink.c @@ -83,8 +83,8 @@ enum PROP_STREAM }; -GST_BOILERPLATE (GstGioStreamSink, gst_gio_stream_sink, GstGioBaseSink, - GST_TYPE_GIO_BASE_SINK); +#define gst_gio_stream_sink_parent_class parent_class +G_DEFINE_TYPE (GstGioStreamSink, gst_gio_stream_sink, GST_TYPE_GIO_BASE_SINK); static void gst_gio_stream_sink_finalize (GObject * object); static void gst_gio_stream_sink_set_property (GObject * object, guint prop_id, @@ -94,25 +94,15 @@ static void gst_gio_stream_sink_get_property (GObject * object, guint prop_id, static GOutputStream *gst_gio_stream_sink_get_stream (GstGioBaseSink * bsink); static void -gst_gio_stream_sink_base_init (gpointer gclass) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); - - GST_DEBUG_CATEGORY_INIT (gst_gio_stream_sink_debug, "gio_stream_sink", 0, - "GIO stream sink"); - - gst_element_class_set_details_simple (element_class, "GIO stream sink", - "Sink", - "Write to any GIO stream", - "Sebastian Dröge "); -} - -static void gst_gio_stream_sink_class_init (GstGioStreamSinkClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; + GstElementClass *gstelement_class = (GstElementClass *) klass; GstGioBaseSinkClass *ggbsink_class = (GstGioBaseSinkClass *) klass; + GST_DEBUG_CATEGORY_INIT (gst_gio_stream_sink_debug, "gio_stream_sink", 0, + "GIO stream sink"); + gobject_class->finalize = gst_gio_stream_sink_finalize; gobject_class->set_property = gst_gio_stream_sink_set_property; gobject_class->get_property = gst_gio_stream_sink_get_property; @@ -121,13 +111,17 @@ gst_gio_stream_sink_class_init (GstGioStreamSinkClass * klass) g_param_spec_object ("stream", "Stream", "Stream to write to", G_TYPE_OUTPUT_STREAM, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_element_class_set_details_simple (gstelement_class, "GIO stream sink", + "Sink", + "Write to any GIO stream", + "Sebastian Dröge "); + ggbsink_class->get_stream = GST_DEBUG_FUNCPTR (gst_gio_stream_sink_get_stream); } static void -gst_gio_stream_sink_init (GstGioStreamSink * sink, - GstGioStreamSinkClass * gclass) +gst_gio_stream_sink_init (GstGioStreamSink * sink) { } diff --git a/ext/gio/gstgiostreamsrc.c b/ext/gio/gstgiostreamsrc.c index bd6c686..600f347 100644 --- a/ext/gio/gstgiostreamsrc.c +++ b/ext/gio/gstgiostreamsrc.c @@ -77,8 +77,8 @@ enum PROP_STREAM }; -GST_BOILERPLATE (GstGioStreamSrc, gst_gio_stream_src, GstGioBaseSrc, - GST_TYPE_GIO_BASE_SRC); +#define gst_gio_stream_src_parent_class parent_class +G_DEFINE_TYPE (GstGioStreamSrc, gst_gio_stream_src, GST_TYPE_GIO_BASE_SRC); static void gst_gio_stream_src_finalize (GObject * object); static void gst_gio_stream_src_set_property (GObject * object, guint prop_id, @@ -88,25 +88,15 @@ static void gst_gio_stream_src_get_property (GObject * object, guint prop_id, static GInputStream *gst_gio_stream_src_get_stream (GstGioBaseSrc * bsrc); static void -gst_gio_stream_src_base_init (gpointer gclass) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); - - GST_DEBUG_CATEGORY_INIT (gst_gio_stream_src_debug, "gio_stream_src", 0, - "GIO source"); - - gst_element_class_set_details_simple (element_class, "GIO stream source", - "Source", - "Read from any GIO stream", - "Sebastian Dröge "); -} - -static void gst_gio_stream_src_class_init (GstGioStreamSrcClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; + GstElementClass *gstelement_class = (GstElementClass *) klass; GstGioBaseSrcClass *gstgiobasesrc_class = (GstGioBaseSrcClass *) klass; + GST_DEBUG_CATEGORY_INIT (gst_gio_stream_src_debug, "gio_stream_src", 0, + "GIO source"); + gobject_class->finalize = gst_gio_stream_src_finalize; gobject_class->set_property = gst_gio_stream_src_set_property; gobject_class->get_property = gst_gio_stream_src_get_property; @@ -115,12 +105,17 @@ gst_gio_stream_src_class_init (GstGioStreamSrcClass * klass) g_param_spec_object ("stream", "Stream", "Stream to read from", G_TYPE_INPUT_STREAM, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_element_class_set_details_simple (gstelement_class, "GIO stream source", + "Source", + "Read from any GIO stream", + "Sebastian Dröge "); + gstgiobasesrc_class->get_stream = GST_DEBUG_FUNCPTR (gst_gio_stream_src_get_stream); } static void -gst_gio_stream_src_init (GstGioStreamSrc * src, GstGioStreamSrcClass * gclass) +gst_gio_stream_src_init (GstGioStreamSrc * src) { } diff --git a/ext/gnomevfs/gstgnomevfssink.c b/ext/gnomevfs/gstgnomevfssink.c index cd7a5dd..eac0322 100644 --- a/ext/gnomevfs/gstgnomevfssink.c +++ b/ext/gnomevfs/gstgnomevfssink.c @@ -123,21 +123,9 @@ gst_gnome_vfs_sink_do_init (GType type) "Gnome VFS sink element"); } -GST_BOILERPLATE_FULL (GstGnomeVFSSink, gst_gnome_vfs_sink, GstBaseSink, - GST_TYPE_BASE_SINK, gst_gnome_vfs_sink_do_init); - -static void -gst_gnome_vfs_sink_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sinktemplate)); - - gst_element_class_set_details_simple (element_class, - "GnomeVFS Sink", "Sink/File", - "Write a stream to a GnomeVFS URI", "Bastien Nocera "); -} +#define gst_gnome_vfs_sink_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstGnomeVFSSink, gst_gnome_vfs_sink, + GST_TYPE_BASE_SINK, gst_gnome_vfs_sink_do_init (g_define_type_id)); static gboolean _gst_boolean_allow_overwrite_accumulator (GSignalInvocationHint * ihint, @@ -157,9 +145,11 @@ static void gst_gnome_vfs_sink_class_init (GstGnomeVFSSinkClass * klass) { GstBaseSinkClass *basesink_class; + GstElementClass *gstelement_class; GObjectClass *gobject_class; gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; basesink_class = (GstBaseSinkClass *) klass; gobject_class->set_property = gst_gnome_vfs_sink_set_property; @@ -195,6 +185,13 @@ gst_gnome_vfs_sink_class_init (GstGnomeVFSSinkClass * klass) _gst_boolean_allow_overwrite_accumulator, NULL, gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, GST_TYPE_GNOME_VFS_URI); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sinktemplate)); + + gst_element_class_set_details_simple (gstelement_class, + "GnomeVFS Sink", "Sink/File", + "Write a stream to a GnomeVFS URI", "Bastien Nocera "); + basesink_class->stop = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_stop); basesink_class->start = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_start); basesink_class->event = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_handle_event); @@ -221,7 +218,7 @@ gst_gnome_vfs_sink_finalize (GObject * obj) } static void -gst_gnome_vfs_sink_init (GstGnomeVFSSink * sink, GstGnomeVFSSinkClass * klass) +gst_gnome_vfs_sink_init (GstGnomeVFSSink * sink) { gst_pad_set_query_function (GST_BASE_SINK_PAD (sink), GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_query)); diff --git a/ext/gnomevfs/gstgnomevfssrc.c b/ext/gnomevfs/gstgnomevfssrc.c index 7ad03ca..f6283d8 100644 --- a/ext/gnomevfs/gstgnomevfssrc.c +++ b/ext/gnomevfs/gstgnomevfssrc.c @@ -116,9 +116,6 @@ enum ARG_IRADIO_TITLE }; -static void gst_gnome_vfs_src_base_init (gpointer g_class); -static void gst_gnome_vfs_src_class_init (GstGnomeVFSSrcClass * klass); -static void gst_gnome_vfs_src_init (GstGnomeVFSSrc * gnomevfssrc); static void gst_gnome_vfs_src_finalize (GObject * object); static void gst_gnome_vfs_src_uri_handler_init (gpointer g_iface, gpointer iface_data); @@ -137,67 +134,24 @@ static GstFlowReturn gst_gnome_vfs_src_create (GstBaseSrc * basesrc, guint64 offset, guint size, GstBuffer ** buffer); static gboolean gst_gnome_vfs_src_query (GstBaseSrc * src, GstQuery * query); -static GstElementClass *parent_class = NULL; - -GType -gst_gnome_vfs_src_get_type (void) -{ - static GType gnomevfssrc_type = 0; - - if (!gnomevfssrc_type) { - static const GTypeInfo gnomevfssrc_info = { - sizeof (GstGnomeVFSSrcClass), - gst_gnome_vfs_src_base_init, - NULL, - (GClassInitFunc) gst_gnome_vfs_src_class_init, - NULL, - NULL, - sizeof (GstGnomeVFSSrc), - 0, - (GInstanceInitFunc) gst_gnome_vfs_src_init, - }; - static const GInterfaceInfo urihandler_info = { - gst_gnome_vfs_src_uri_handler_init, - NULL, - NULL - }; - - gnomevfssrc_type = - g_type_register_static (GST_TYPE_BASE_SRC, - "GstGnomeVFSSrc", &gnomevfssrc_info, 0); - g_type_add_interface_static (gnomevfssrc_type, GST_TYPE_URI_HANDLER, - &urihandler_info); - } - return gnomevfssrc_type; -} - -static void -gst_gnome_vfs_src_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&srctemplate)); - gst_element_class_set_details_simple (element_class, - "GnomeVFS Source", "Source/File", - "Read from any GnomeVFS-supported file", - "Bastien Nocera , " - "GStreamer maintainers "); - - GST_DEBUG_CATEGORY_INIT (gnomevfssrc_debug, "gnomevfssrc", 0, - "Gnome-VFS Source"); -} +#define gst_gnome_vfs_src_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstGnomeVFSSrc, gst_gnome_vfs_src, GST_TYPE_BASE_SRC, + G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, + gst_gnome_vfs_src_uri_handler_init)); static void gst_gnome_vfs_src_class_init (GstGnomeVFSSrcClass * klass) { GObjectClass *gobject_class; + GstElementClass *gstelement_class; GstBaseSrcClass *gstbasesrc_class; gobject_class = G_OBJECT_CLASS (klass); + gstelement_class = GST_ELEMENT_CLASS (klass); gstbasesrc_class = GST_BASE_SRC_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); + GST_DEBUG_CATEGORY_INIT (gnomevfssrc_debug, "gnomevfssrc", 0, + "Gnome-VFS Source"); gobject_class->finalize = gst_gnome_vfs_src_finalize; gobject_class->set_property = gst_gnome_vfs_src_set_property; @@ -239,6 +193,14 @@ gst_gnome_vfs_src_class_init (GstGnomeVFSSrcClass * klass) "Name of currently playing song", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&srctemplate)); + gst_element_class_set_details_simple (gstelement_class, + "GnomeVFS Source", "Source/File", + "Read from any GnomeVFS-supported file", + "Bastien Nocera , " + "GStreamer maintainers "); + gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_start); gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_stop); gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_get_size); diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index e084546..5050ce1 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1264,29 +1264,24 @@ static gboolean gst_ogg_demux_send_event (GstOggDemux * ogg, GstEvent * event); static void gst_ogg_print (GstOggDemux * demux); -GST_BOILERPLATE (GstOggDemux, gst_ogg_demux, GstElement, GST_TYPE_ELEMENT); +#define gst_ogg_demux_parent_class parent_class +G_DEFINE_TYPE (GstOggDemux, gst_ogg_demux, GST_TYPE_ELEMENT); static void -gst_ogg_demux_base_init (gpointer g_class) +gst_ogg_demux_class_init (GstOggDemuxClass * klass) { - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - gst_element_class_set_details_simple (element_class, + gst_element_class_set_details_simple (gstelement_class, "Ogg demuxer", "Codec/Demuxer", "demux ogg streams (info about ogg: http://xiph.org)", "Wim Taymans "); - gst_element_class_add_pad_template (element_class, + gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&ogg_demux_sink_template_factory)); - gst_element_class_add_pad_template (element_class, + gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&ogg_demux_src_template_factory)); -} - -static void -gst_ogg_demux_class_init (GstOggDemuxClass * klass) -{ - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gstelement_class->change_state = gst_ogg_demux_change_state; gstelement_class->send_event = gst_ogg_demux_receive_event; @@ -1295,7 +1290,7 @@ gst_ogg_demux_class_init (GstOggDemuxClass * klass) } static void -gst_ogg_demux_init (GstOggDemux * ogg, GstOggDemuxClass * g_class) +gst_ogg_demux_init (GstOggDemux * ogg) { /* create the sink pad */ ogg->sinkpad = @@ -3593,7 +3588,7 @@ gst_ogg_demux_change_state (GstElement * element, GstStateChange transition) break; } - result = parent_class->change_state (element, transition); + result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { case GST_STATE_CHANGE_PLAYING_TO_PAUSED: diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 80281e5..1a16e4a 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -110,9 +110,6 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d", "subtitle/x-kate; application/x-kate") ); -static void gst_ogg_mux_base_init (gpointer g_class); -static void gst_ogg_mux_class_init (GstOggMuxClass * klass); -static void gst_ogg_mux_init (GstOggMux * ogg_mux); static void gst_ogg_mux_finalize (GObject * object); static GstFlowReturn @@ -129,57 +126,10 @@ static void gst_ogg_mux_get_property (GObject * object, static GstStateChangeReturn gst_ogg_mux_change_state (GstElement * element, GstStateChange transition); -static GstElementClass *parent_class = NULL; - /*static guint gst_ogg_mux_signals[LAST_SIGNAL] = { 0 }; */ - -GType -gst_ogg_mux_get_type (void) -{ - static GType ogg_mux_type = 0; - - if (G_UNLIKELY (ogg_mux_type == 0)) { - static const GTypeInfo ogg_mux_info = { - sizeof (GstOggMuxClass), - gst_ogg_mux_base_init, - NULL, - (GClassInitFunc) gst_ogg_mux_class_init, - NULL, - NULL, - sizeof (GstOggMux), - 0, - (GInstanceInitFunc) gst_ogg_mux_init, - }; - static const GInterfaceInfo preset_info = { - NULL, - NULL, - NULL - }; - - ogg_mux_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstOggMux", &ogg_mux_info, - 0); - - g_type_add_interface_static (ogg_mux_type, GST_TYPE_PRESET, &preset_info); - } - return ogg_mux_type; -} - -static void -gst_ogg_mux_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&src_factory)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory)); - - gst_element_class_set_details_simple (element_class, - "Ogg muxer", "Codec/Muxer", - "mux ogg streams (info about ogg: http://xiph.org)", - "Wim Taymans "); -} +#define gst_ogg_mux_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstOggMux, gst_ogg_mux, GST_TYPE_ELEMENT, + G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL)); static void gst_ogg_mux_class_init (GstOggMuxClass * klass) @@ -190,12 +140,20 @@ gst_ogg_mux_class_init (GstOggMuxClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = gst_ogg_mux_finalize; gobject_class->get_property = gst_ogg_mux_get_property; gobject_class->set_property = gst_ogg_mux_set_property; + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&src_factory)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sink_factory)); + + gst_element_class_set_details_simple (gstelement_class, + "Ogg muxer", "Codec/Muxer", + "mux ogg streams (info about ogg: http://xiph.org)", + "Wim Taymans "); + gstelement_class->request_new_pad = gst_ogg_mux_request_new_pad; gstelement_class->release_pad = gst_ogg_mux_release_pad; diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index 7c45fa4..6767a51 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -309,6 +309,12 @@ gst_base_text_overlay_line_align_get_type (void) #define GST_BASE_TEXT_OVERLAY_SIGNAL(ov) (g_cond_signal (GST_BASE_TEXT_OVERLAY_GET_COND (ov))) #define GST_BASE_TEXT_OVERLAY_BROADCAST(ov)(g_cond_broadcast (GST_BASE_TEXT_OVERLAY_GET_COND (ov))) +static GstElementClass *parent_class = NULL; +static void gst_base_text_overlay_base_init (gpointer g_class); +static void gst_base_text_overlay_class_init (GstBaseTextOverlayClass * klass); +static void gst_base_text_overlay_init (GstBaseTextOverlay * overlay, + GstBaseTextOverlayClass * klass); + static GstStateChangeReturn gst_base_text_overlay_change_state (GstElement * element, GstStateChange transition); @@ -348,8 +354,31 @@ static void gst_base_text_overlay_adjust_values_with_fontdesc (GstBaseTextOverlay * overlay, PangoFontDescription * desc); -GST_BOILERPLATE (GstBaseTextOverlay, gst_base_text_overlay, GstElement, - GST_TYPE_ELEMENT); +GType +gst_base_text_overlay_get_type (void) +{ + static GType type = 0; + + if (g_once_init_enter ((gsize *) & type)) { + static const GTypeInfo info = { + sizeof (GstBaseTextOverlayClass), + (GBaseInitFunc) gst_base_text_overlay_base_init, + NULL, + (GClassInitFunc) gst_base_text_overlay_class_init, + NULL, + NULL, + sizeof (GstBaseTextOverlay), + 0, + (GInstanceInitFunc) gst_base_text_overlay_init, + }; + + g_once_init_leave ((gsize *) & type, + g_type_register_static (GST_TYPE_ELEMENT, "GstBaseTextOverlay", &info, + 0)); + } + + return type; +} static gchar * gst_base_text_overlay_get_text (GstBaseTextOverlay * overlay, @@ -385,6 +414,8 @@ gst_base_text_overlay_class_init (GstBaseTextOverlayClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; + parent_class = g_type_class_peek_parent (klass); + gobject_class->finalize = gst_base_text_overlay_finalize; gobject_class->set_property = gst_base_text_overlay_set_property; gobject_class->get_property = gst_base_text_overlay_get_property; diff --git a/ext/pango/gstclockoverlay.c b/ext/pango/gstclockoverlay.c index 922e485..6c770ce 100644 --- a/ext/pango/gstclockoverlay.c +++ b/ext/pango/gstclockoverlay.c @@ -60,20 +60,8 @@ enum PROP_LAST }; -GST_BOILERPLATE (GstClockOverlay, gst_clock_overlay, GstBaseTextOverlay, - GST_TYPE_BASE_TEXT_OVERLAY); - -static void -gst_clock_overlay_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_set_details_simple (element_class, "Clock overlay", - "Filter/Editor/Video", - "Overlays the current clock time on a video stream", - "Tim-Philipp Müller "); -} - +#define gst_clock_overlay_parent_class parent_class +G_DEFINE_TYPE (GstClockOverlay, gst_clock_overlay, GST_TYPE_BASE_TEXT_OVERLAY); static void gst_clock_overlay_finalize (GObject * object); static void gst_clock_overlay_set_property (GObject * object, guint prop_id, @@ -146,17 +134,24 @@ static void gst_clock_overlay_class_init (GstClockOverlayClass * klass) { GObjectClass *gobject_class; + GstElementClass *gstelement_class; GstBaseTextOverlayClass *gsttextoverlay_class; PangoContext *context; PangoFontDescription *font_description; gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; gsttextoverlay_class = (GstBaseTextOverlayClass *) klass; gobject_class->finalize = gst_clock_overlay_finalize; gobject_class->set_property = gst_clock_overlay_set_property; gobject_class->get_property = gst_clock_overlay_get_property; + gst_element_class_set_details_simple (gstelement_class, "Clock overlay", + "Filter/Editor/Video", + "Overlays the current clock time on a video stream", + "Tim-Philipp Müller "); + gsttextoverlay_class->get_text = gst_clock_overlay_get_text; g_object_class_install_property (gobject_class, PROP_TIMEFORMAT, @@ -197,7 +192,7 @@ gst_clock_overlay_finalize (GObject * object) static void -gst_clock_overlay_init (GstClockOverlay * overlay, GstClockOverlayClass * klass) +gst_clock_overlay_init (GstClockOverlay * overlay) { GstBaseTextOverlay *textoverlay; diff --git a/ext/pango/gsttextrender.c b/ext/pango/gsttextrender.c index 0c02ad2..764765b 100644 --- a/ext/pango/gsttextrender.c +++ b/ext/pango/gsttextrender.c @@ -162,7 +162,8 @@ gst_text_render_line_align_get_type (void) static void gst_text_render_adjust_values_with_fontdesc (GstTextRender * render, PangoFontDescription * desc); -GST_BOILERPLATE (GstTextRender, gst_text_render, GstElement, GST_TYPE_ELEMENT); +#define gst_text_render_parent_class parent_class +G_DEFINE_TYPE (GstTextRender, gst_text_render, GST_TYPE_ELEMENT); static void gst_text_render_finalize (GObject * object); static void gst_text_render_set_property (GObject * object, @@ -171,29 +172,14 @@ static void gst_text_render_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void -gst_text_render_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&src_template_factory)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_template_factory)); - - gst_element_class_set_details_simple (element_class, "Text renderer", - "Filter/Editor/Video", - "Renders a text string to an image bitmap", - "David Schleef , " - "GStreamer maintainers "); -} - -static void gst_text_render_class_init (GstTextRenderClass * klass) { GObjectClass *gobject_class; + GstElementClass *gstelement_class; PangoFontMap *fontmap; gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; parent_class = g_type_class_peek_parent (klass); @@ -201,6 +187,17 @@ gst_text_render_class_init (GstTextRenderClass * klass) gobject_class->set_property = gst_text_render_set_property; gobject_class->get_property = gst_text_render_get_property; + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&src_template_factory)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&sink_template_factory)); + + gst_element_class_set_details_simple (gstelement_class, "Text renderer", + "Filter/Editor/Video", + "Renders a text string to an image bitmap", + "David Schleef , " + "GStreamer maintainers "); + fontmap = pango_cairo_font_map_get_default (); klass->pango_context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); @@ -591,7 +588,7 @@ gst_text_render_finalize (GObject * object) } static void -gst_text_render_init (GstTextRender * render, GstTextRenderClass * klass) +gst_text_render_init (GstTextRender * render) { GstPadTemplate *template; diff --git a/ext/pango/gsttimeoverlay.c b/ext/pango/gsttimeoverlay.c index 536499f..3617361 100644 --- a/ext/pango/gsttimeoverlay.c +++ b/ext/pango/gsttimeoverlay.c @@ -50,19 +50,8 @@ #include -GST_BOILERPLATE (GstTimeOverlay, gst_time_overlay, GstBaseTextOverlay, - GST_TYPE_BASE_TEXT_OVERLAY); - -static void -gst_time_overlay_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_set_details_simple (element_class, "Time overlay", - "Filter/Editor/Video", - "Overlays buffer time stamps on a video stream", - "Tim-Philipp Müller "); -} +#define gst_time_overlay_parent_class parent_class +G_DEFINE_TYPE (GstTimeOverlay, gst_time_overlay, GST_TYPE_BASE_TEXT_OVERLAY); static gchar * gst_time_overlay_render_time (GstTimeOverlay * overlay, GstClockTime time) @@ -116,11 +105,18 @@ gst_time_overlay_get_text (GstBaseTextOverlay * overlay, static void gst_time_overlay_class_init (GstTimeOverlayClass * klass) { + GstElementClass *gstelement_class; GstBaseTextOverlayClass *gsttextoverlay_class; PangoContext *context; PangoFontDescription *font_description; gsttextoverlay_class = (GstBaseTextOverlayClass *) klass; + gstelement_class = (GstElementClass *) klass; + + gst_element_class_set_details_simple (gstelement_class, "Time overlay", + "Filter/Editor/Video", + "Overlays buffer time stamps on a video stream", + "Tim-Philipp Müller "); gsttextoverlay_class->get_text = gst_time_overlay_get_text; @@ -143,7 +139,7 @@ gst_time_overlay_class_init (GstTimeOverlayClass * klass) } static void -gst_time_overlay_init (GstTimeOverlay * overlay, GstTimeOverlayClass * klass) +gst_time_overlay_init (GstTimeOverlay * overlay) { GstBaseTextOverlay *textoverlay; diff --git a/ext/theora/gsttheoradec.c b/ext/theora/gsttheoradec.c index 50359af..e401364 100644 --- a/ext/theora/gsttheoradec.c +++ b/ext/theora/gsttheoradec.c @@ -81,7 +81,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS ("video/x-theora") ); -GST_BOILERPLATE (GstTheoraDec, gst_theora_dec, GstElement, GST_TYPE_ELEMENT); +#define gst_theora_dec_parent_class parent_class +G_DEFINE_TYPE (GstTheoraDec, gst_theora_dec, GST_TYPE_ELEMENT); static void theora_dec_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); @@ -107,22 +108,6 @@ static const GstEventMask *theora_get_event_masks (GstPad * pad); #endif static const GstQueryType *theora_get_query_types (GstPad * pad); - -static void -gst_theora_dec_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&theora_dec_src_factory)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&theora_dec_sink_factory)); - gst_element_class_set_details_simple (element_class, - "Theora video decoder", "Codec/Decoder/Video", - "decode raw theora streams to raw YUV video", - "Benjamin Otte , Wim Taymans "); -} - static gboolean gst_theora_dec_ctl_is_supported (int req) { @@ -188,13 +173,22 @@ gst_theora_dec_class_init (GstTheoraDecClass * klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&theora_dec_src_factory)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&theora_dec_sink_factory)); + gst_element_class_set_details_simple (gstelement_class, + "Theora video decoder", "Codec/Decoder/Video", + "decode raw theora streams to raw YUV video", + "Benjamin Otte , Wim Taymans "); + gstelement_class->change_state = theora_dec_change_state; GST_DEBUG_CATEGORY_INIT (theoradec_debug, "theoradec", 0, "Theora decoder"); } static void -gst_theora_dec_init (GstTheoraDec * dec, GstTheoraDecClass * g_class) +gst_theora_dec_init (GstTheoraDec * dec) { dec->sinkpad = gst_pad_new_from_static_template (&theora_dec_sink_factory, "sink"); @@ -1524,7 +1518,7 @@ theora_dec_change_state (GstElement * element, GstStateChange transition) break; } - ret = parent_class->change_state (element, transition); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { case GST_STATE_CHANGE_PLAYING_TO_PAUSED: diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index f32d230..9558b2b 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -243,21 +243,9 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_CAPS ("video/x-theora") ); -static void -_do_init (GType object_type) -{ - const GInterfaceInfo preset_interface_info = { - NULL, /* interface_init */ - NULL, /* interface_finalize */ - NULL /* interface_data */ - }; - - g_type_add_interface_static (object_type, GST_TYPE_PRESET, - &preset_interface_info); -} - -GST_BOILERPLATE_FULL (GstTheoraEnc, gst_theora_enc, GstElement, - GST_TYPE_ELEMENT, _do_init); +#define gst_theora_enc_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstTheoraEnc, gst_theora_enc, + GST_TYPE_ELEMENT, G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL)); static gboolean theora_enc_sink_event (GstPad * pad, GstEvent * event); static gboolean theora_enc_src_event (GstPad * pad, GstEvent * event); @@ -276,21 +264,6 @@ static gboolean theora_enc_write_multipass_cache (GstTheoraEnc * enc, gboolean begin, gboolean eos); static void -gst_theora_enc_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&theora_enc_src_factory)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&theora_enc_sink_factory)); - gst_element_class_set_details_simple (element_class, - "Theora video encoder", "Codec/Encoder/Video", - "encode raw YUV video to a theora stream", - "Wim Taymans "); -} - -static void gst_theora_enc_class_init (GstTheoraEncClass * klass) { GObjectClass *gobject_class = (GObjectClass *) klass; @@ -414,11 +387,20 @@ gst_theora_enc_class_init (GstTheoraEncClass * klass) THEORA_DEF_MULTIPASS_MODE, (GParamFlags) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&theora_enc_src_factory)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&theora_enc_sink_factory)); + gst_element_class_set_details_simple (gstelement_class, + "Theora video encoder", "Codec/Encoder/Video", + "encode raw YUV video to a theora stream", + "Wim Taymans "); + gstelement_class->change_state = theora_enc_change_state; } static void -gst_theora_enc_init (GstTheoraEnc * enc, GstTheoraEncClass * g_class) +gst_theora_enc_init (GstTheoraEnc * enc) { enc->sinkpad = gst_pad_new_from_static_template (&theora_enc_sink_factory, "sink"); @@ -1398,7 +1380,7 @@ theora_enc_change_state (GstElement * element, GstStateChange transition) break; } - ret = parent_class->change_state (element, transition); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { case GST_STATE_CHANGE_PLAYING_TO_PAUSED: diff --git a/ext/theora/gsttheoraparse.c b/ext/theora/gsttheoraparse.c index 4e99d9f..df9aeca 100644 --- a/ext/theora/gsttheoraparse.c +++ b/ext/theora/gsttheoraparse.c @@ -85,8 +85,8 @@ enum PROP_SYNCHRONIZATION_POINTS }; -GST_BOILERPLATE (GstTheoraParse, gst_theora_parse, GstElement, - GST_TYPE_ELEMENT); +#define gst_theora_parse_parent_class parent_class +G_DEFINE_TYPE (GstTheoraParse, gst_theora_parse, GST_TYPE_ELEMENT); static void theora_parse_dispose (GObject * object); static void theora_parse_get_property (GObject * object, guint prop_id, @@ -101,20 +101,6 @@ static gboolean theora_parse_sink_event (GstPad * pad, GstEvent * event); static gboolean theora_parse_src_query (GstPad * pad, GstQuery * query); static void -gst_theora_parse_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&theora_parse_src_factory)); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&theora_parse_sink_factory)); - gst_element_class_set_details_simple (element_class, - "Theora video parser", "Codec/Parser/Video", - "parse raw theora streams", "Andy Wingo "); -} - -static void gst_theora_parse_class_init (GstTheoraParseClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); @@ -140,6 +126,15 @@ gst_theora_parse_class_init (GstTheoraParseClass * klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS), G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&theora_parse_src_factory)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&theora_parse_sink_factory)); + gst_element_class_set_details_simple (gstelement_class, + "Theora video parser", "Codec/Parser/Video", + "parse raw theora streams", "Andy Wingo "); + gstelement_class->change_state = theora_parse_change_state; GST_DEBUG_CATEGORY_INIT (theoraparse_debug, "theoraparse", 0, @@ -147,7 +142,7 @@ gst_theora_parse_class_init (GstTheoraParseClass * klass) } static void -gst_theora_parse_init (GstTheoraParse * parse, GstTheoraParseClass * g_class) +gst_theora_parse_init (GstTheoraParse * parse) { parse->sinkpad = gst_pad_new_from_static_template (&theora_parse_sink_factory, "sink"); @@ -919,7 +914,7 @@ theora_parse_change_state (GstElement * element, GstStateChange transition) break; } - ret = parent_class->change_state (element, transition); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: diff --git a/ext/vorbis/gstvorbisdec.c b/ext/vorbis/gstvorbisdec.c index f6c5bda..78fc79a 100644 --- a/ext/vorbis/gstvorbisdec.c +++ b/ext/vorbis/gstvorbisdec.c @@ -64,8 +64,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS ("audio/x-vorbis") ); -GST_BOILERPLATE (GST_VORBIS_DEC_GLIB_TYPE_NAME, gst_vorbis_dec, GstElement, - GST_TYPE_ELEMENT); +#define gst_vorbis_dec_parent_class parent_class +G_DEFINE_TYPE (GST_VORBIS_DEC_GLIB_TYPE_NAME, gst_vorbis_dec, GST_TYPE_ELEMENT); static void vorbis_dec_finalize (GObject * object); static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event); @@ -86,30 +86,23 @@ static gboolean vorbis_dec_convert (GstPad * pad, static gboolean vorbis_dec_sink_query (GstPad * pad, GstQuery * query); static void -gst_vorbis_dec_base_init (gpointer g_class) +gst_vorbis_dec_class_init (GstVorbisDecClass * klass) { - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - GstPadTemplate *src_template, *sink_template; + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - src_template = gst_static_pad_template_get (&vorbis_dec_src_factory); - gst_element_class_add_pad_template (element_class, src_template); + gobject_class->finalize = vorbis_dec_finalize; - sink_template = gst_static_pad_template_get (&vorbis_dec_sink_factory); - gst_element_class_add_pad_template (element_class, sink_template); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&vorbis_dec_src_factory)); - gst_element_class_set_details_simple (element_class, + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&vorbis_dec_sink_factory)); + + gst_element_class_set_details_simple (gstelement_class, "Vorbis audio decoder", "Codec/Decoder/Audio", GST_VORBIS_DEC_DESCRIPTION, "Benjamin Otte , Chris Lord "); -} - -static void -gst_vorbis_dec_class_init (GstVorbisDecClass * klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - - gobject_class->finalize = vorbis_dec_finalize; gstelement_class->change_state = GST_DEBUG_FUNCPTR (vorbis_dec_change_state); } @@ -128,7 +121,7 @@ vorbis_get_query_types (GstPad * pad) } static void -gst_vorbis_dec_init (GstVorbisDec * dec, GstVorbisDecClass * g_class) +gst_vorbis_dec_init (GstVorbisDec * dec) { dec->sinkpad = gst_pad_new_from_static_template (&vorbis_dec_sink_factory, "sink"); @@ -1276,7 +1269,7 @@ vorbis_dec_change_state (GstElement * element, GstStateChange transition) break; } - res = parent_class->change_state (element, transition); + res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { case GST_STATE_CHANGE_PLAYING_TO_PAUSED: diff --git a/ext/vorbis/gstvorbisenc.c b/ext/vorbis/gstvorbisenc.c index 79825c6..1670cf4 100644 --- a/ext/vorbis/gstvorbisenc.c +++ b/ext/vorbis/gstvorbisenc.c @@ -132,8 +132,9 @@ static GstStateChangeReturn gst_vorbis_enc_change_state (GstElement * element, GstStateChange transition); static void gst_vorbis_enc_add_interfaces (GType vorbisenc_type); -GST_BOILERPLATE_FULL (GstVorbisEnc, gst_vorbis_enc, GstElement, - GST_TYPE_ELEMENT, gst_vorbis_enc_add_interfaces); +#define gst_vorbis_enc_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstVorbisEnc, gst_vorbis_enc, + GST_TYPE_ELEMENT, gst_vorbis_enc_add_interfaces (g_define_type_id)); static void gst_vorbis_enc_add_interfaces (GType vorbisenc_type) @@ -147,24 +148,6 @@ gst_vorbis_enc_add_interfaces (GType vorbisenc_type) } static void -gst_vorbis_enc_base_init (gpointer g_class) -{ - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); - GstPadTemplate *src_template, *sink_template; - - - src_template = gst_static_pad_template_get (&vorbis_enc_src_factory); - gst_element_class_add_pad_template (element_class, src_template); - - sink_template = gst_static_pad_template_get (&vorbis_enc_sink_factory); - gst_element_class_add_pad_template (element_class, sink_template); - gst_element_class_set_details_simple (element_class, - "Vorbis audio encoder", "Codec/Encoder/Audio", - "Encodes audio in Vorbis format", - "Monty , " "Wim Taymans "); -} - -static void gst_vorbis_enc_class_init (GstVorbisEncClass * klass) { GObjectClass *gobject_class; @@ -208,6 +191,15 @@ gst_vorbis_enc_class_init (GstVorbisEncClass * klass) "The last status message", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&vorbis_enc_src_factory)); + gst_element_class_add_pad_template (gstelement_class, + gst_static_pad_template_get (&vorbis_enc_sink_factory)); + gst_element_class_set_details_simple (gstelement_class, + "Vorbis audio encoder", "Codec/Encoder/Audio", + "Encodes audio in Vorbis format", + "Monty , " "Wim Taymans "); + gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_vorbis_enc_change_state); } @@ -570,7 +562,7 @@ error: } static void -gst_vorbis_enc_init (GstVorbisEnc * vorbisenc, GstVorbisEncClass * klass) +gst_vorbis_enc_init (GstVorbisEnc * vorbisenc) { vorbisenc->sinkpad = gst_pad_new_from_static_template (&vorbis_enc_sink_factory, "sink"); diff --git a/ext/vorbis/gstvorbisparse.c b/ext/vorbis/gstvorbisparse.c index 99f1d2e..5a7a576 100644 --- a/ext/vorbis/gstvorbisparse.c +++ b/ext/vorbis/gstvorbisparse.c @@ -72,8 +72,8 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_CAPS ("audio/x-vorbis") ); -GST_BOILERPLATE (GstVorbisParse, gst_vorbis_parse, GstElement, - GST_TYPE_ELEMENT); +#define gst_vorbis_parse_parent_class parent_class +G_DEFINE_TYPE (GstVorbisParse, gst_vorbis_parse, GST_TYPE_ELEMENT); static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstBuffer * buffer); static GstStateChangeReturn vorbis_parse_change_state (GstElement * element, @@ -87,32 +87,26 @@ static GstFlowReturn vorbis_parse_parse_packet (GstVorbisParse * parse, GstBuffer * buf); static void -gst_vorbis_parse_base_init (gpointer g_class) +gst_vorbis_parse_class_init (GstVorbisParseClass * klass) { - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); + + gstelement_class->change_state = vorbis_parse_change_state; - gst_element_class_add_pad_template (element_class, + gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&vorbis_parse_src_factory)); - gst_element_class_add_pad_template (element_class, + gst_element_class_add_pad_template (gstelement_class, gst_static_pad_template_get (&vorbis_parse_sink_factory)); - gst_element_class_set_details_simple (element_class, + gst_element_class_set_details_simple (gstelement_class, "VorbisParse", "Codec/Parser/Audio", "parse raw vorbis streams", "Thomas Vander Stichele "); -} - -static void -gst_vorbis_parse_class_init (GstVorbisParseClass * klass) -{ - GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); - - gstelement_class->change_state = vorbis_parse_change_state; klass->parse_packet = GST_DEBUG_FUNCPTR (vorbis_parse_parse_packet); } static void -gst_vorbis_parse_init (GstVorbisParse * parse, GstVorbisParseClass * g_class) +gst_vorbis_parse_init (GstVorbisParse * parse) { parse->sinkpad = gst_pad_new_from_static_template (&vorbis_parse_sink_factory, "sink"); @@ -655,7 +649,7 @@ vorbis_parse_change_state (GstElement * element, GstStateChange transition) break; } - ret = parent_class->change_state (element, transition); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: diff --git a/ext/vorbis/gstvorbistag.c b/ext/vorbis/gstvorbistag.c index 0553f6a..60dc485 100644 --- a/ext/vorbis/gstvorbistag.c +++ b/ext/vorbis/gstvorbistag.c @@ -63,41 +63,25 @@ GST_DEBUG_CATEGORY_EXTERN (vorbisparse_debug); static GstFlowReturn gst_vorbis_tag_parse_packet (GstVorbisParse * parse, GstBuffer * buffer); -#define _do_init(type) \ - G_STMT_START{ \ - static const GInterfaceInfo tag_setter_info = { \ - NULL, \ - NULL, \ - NULL \ - }; \ - g_type_add_interface_static (type, GST_TYPE_TAG_SETTER, \ - &tag_setter_info); \ - }G_STMT_END - -GST_BOILERPLATE_FULL (GstVorbisTag, gst_vorbis_tag, GstVorbisParse, - GST_TYPE_VORBIS_PARSE, _do_init); - +#define gst_vorbis_tag_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstVorbisTag, gst_vorbis_tag, + GST_TYPE_VORBIS_PARSE, G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL)); static void -gst_vorbis_tag_base_init (gpointer g_class) +gst_vorbis_tag_class_init (GstVorbisTagClass * klass) { - GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); + GstVorbisParseClass *vorbisparse_class = GST_VORBIS_PARSE_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); gst_element_class_set_details_simple (element_class, "VorbisTag", "Formatter/Metadata", "Retags vorbis streams", "James Livingston "); -} - -static void -gst_vorbis_tag_class_init (GstVorbisTagClass * klass) -{ - GstVorbisParseClass *vorbisparse_class = GST_VORBIS_PARSE_CLASS (klass); vorbisparse_class->parse_packet = gst_vorbis_tag_parse_packet; } static void -gst_vorbis_tag_init (GstVorbisTag * tagger, GstVorbisTagClass * g_class) +gst_vorbis_tag_init (GstVorbisTag * tagger) { /* nothing to do */ } -- 2.7.4