ext: Use G_DEFINE_TYPE instead of GST_BOILERPLATE

This commit is contained in:
Sebastian Dröge 2011-04-19 14:11:32 +02:00
parent 8336e2027d
commit 353186aec8
26 changed files with 333 additions and 513 deletions

View file

@ -36,9 +36,10 @@ enum
}; };
static void gst_alsa_mixer_element_init_interfaces (GType type); static void gst_alsa_mixer_element_init_interfaces (GType type);
#define gst_alsa_mixer_element_parent_class parent_class
GST_BOILERPLATE_FULL (GstAlsaMixerElement, gst_alsa_mixer_element, G_DEFINE_TYPE_WITH_CODE (GstAlsaMixerElement, gst_alsa_mixer_element,
GstElement, GST_TYPE_ELEMENT, gst_alsa_mixer_element_init_interfaces); GST_TYPE_ELEMENT,
gst_alsa_mixer_element_init_interfaces (g_define_type_id));
/* massive macro that takes care of all the GstMixer stuff */ /* massive macro that takes care of all the GstMixer stuff */
GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaMixerElement, gst_alsa_mixer_element); GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaMixerElement, gst_alsa_mixer_element);
@ -90,15 +91,6 @@ gst_alsa_mixer_element_init_interfaces (GType type)
gst_alsa_type_add_device_property_probe_interface (type); gst_alsa_type_add_device_property_probe_interface (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 <leif@ambient.2y.net>");
}
static void static void
gst_alsa_mixer_element_class_init (GstAlsaMixerElementClass * klass) gst_alsa_mixer_element_class_init (GstAlsaMixerElementClass * klass)
{ {
@ -122,6 +114,11 @@ gst_alsa_mixer_element_class_init (GstAlsaMixerElementClass * klass)
"Human-readable name of the sound device", "Human-readable name of the sound device",
DEFAULT_PROP_DEVICE_NAME, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); 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 <leif@ambient.2y.net>");
element_class->change_state = element_class->change_state =
GST_DEBUG_FUNCPTR (gst_alsa_mixer_element_change_state); GST_DEBUG_FUNCPTR (gst_alsa_mixer_element_change_state);
} }
@ -137,8 +134,7 @@ gst_alsa_mixer_element_finalize (GObject * obj)
} }
static void static void
gst_alsa_mixer_element_init (GstAlsaMixerElement * this, gst_alsa_mixer_element_init (GstAlsaMixerElement * this)
GstAlsaMixerElementClass * klass)
{ {
this->mixer = NULL; this->mixer = NULL;
this->device = g_strdup (DEFAULT_PROP_DEVICE); this->device = g_strdup (DEFAULT_PROP_DEVICE);

View file

@ -170,7 +170,8 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t * element,
GST_LOG ("[%s] created new mixer track %p", name, track); GST_LOG ("[%s] created new mixer track %p", name, track);
/* This reflects the assumptions used for GstAlsaMixerTrack */ /* 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!"); GST_ERROR ("Mixer track must be either output or input!");
g_return_val_if_reached (NULL); g_return_val_if_reached (NULL);
} }

View file

@ -69,9 +69,9 @@ enum
}; };
static void gst_alsasink_init_interfaces (GType type); static void gst_alsasink_init_interfaces (GType type);
#define gst_alsasink_parent_class parent_class
GST_BOILERPLATE_FULL (GstAlsaSink, gst_alsasink, GstAudioSink, G_DEFINE_TYPE_WITH_CODE (GstAlsaSink, gst_alsasink,
GST_TYPE_AUDIO_SINK, gst_alsasink_init_interfaces); GST_TYPE_AUDIO_SINK, gst_alsasink_init_interfaces (g_define_type_id));
static void gst_alsasink_finalise (GObject * object); static void gst_alsasink_finalise (GObject * object);
static void gst_alsasink_set_property (GObject * object, static void gst_alsasink_set_property (GObject * object,
@ -163,27 +163,16 @@ gst_alsasink_init_interfaces (GType type)
gst_alsa_type_add_device_property_probe_interface (type); gst_alsa_type_add_device_property_probe_interface (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 <wim@fluendo.com>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&alsasink_sink_factory));
}
static void static void
gst_alsasink_class_init (GstAlsaSinkClass * klass) gst_alsasink_class_init (GstAlsaSinkClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class; GstBaseSinkClass *gstbasesink_class;
GstAudioSinkClass *gstaudiosink_class; GstAudioSinkClass *gstaudiosink_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass;
gstaudiosink_class = (GstAudioSinkClass *) 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->get_property = gst_alsasink_get_property;
gobject_class->set_property = gst_alsasink_set_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 <wim@fluendo.com>");
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); gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_alsasink_getcaps);
gstaudiosink_class->open = GST_DEBUG_FUNCPTR (gst_alsasink_open); gstaudiosink_class->open = GST_DEBUG_FUNCPTR (gst_alsasink_open);
@ -271,7 +267,7 @@ gst_alsasink_get_property (GObject * object, guint prop_id,
} }
static void static void
gst_alsasink_init (GstAlsaSink * alsasink, GstAlsaSinkClass * g_class) gst_alsasink_init (GstAlsaSink * alsasink)
{ {
GST_DEBUG_OBJECT (alsasink, "initializing alsasink"); GST_DEBUG_OBJECT (alsasink, "initializing alsasink");

View file

@ -65,9 +65,9 @@ enum
}; };
static void gst_alsasrc_init_interfaces (GType type); static void gst_alsasrc_init_interfaces (GType type);
#define gst_alsasrc_parent_class parent_class
GST_BOILERPLATE_FULL (GstAlsaSrc, gst_alsasrc, GstAudioSrc, G_DEFINE_TYPE_WITH_CODE (GstAlsaSrc, gst_alsasrc,
GST_TYPE_AUDIO_SRC, gst_alsasrc_init_interfaces); GST_TYPE_AUDIO_SRC, gst_alsasrc_init_interfaces (g_define_type_id));
GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaSrc, gst_alsasrc_mixer); GST_IMPLEMENT_ALSA_MIXER_METHODS (GstAlsaSrc, gst_alsasrc_mixer);
@ -182,27 +182,16 @@ gst_alsasrc_init_interfaces (GType type)
gst_alsa_type_add_device_property_probe_interface (type); gst_alsa_type_add_device_property_probe_interface (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 <wim@fluendo.com>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&alsasrc_src_factory));
}
static void static void
gst_alsasrc_class_init (GstAlsaSrcClass * klass) gst_alsasrc_class_init (GstAlsaSrcClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSrcClass *gstbasesrc_class; GstBaseSrcClass *gstbasesrc_class;
GstAudioSrcClass *gstaudiosrc_class; GstAudioSrcClass *gstaudiosrc_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasesrc_class = (GstBaseSrcClass *) klass; gstbasesrc_class = (GstBaseSrcClass *) klass;
gstaudiosrc_class = (GstAudioSrcClass *) 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->get_property = gst_alsasrc_get_property;
gobject_class->set_property = gst_alsasrc_set_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 <wim@fluendo.com>");
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); gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_alsasrc_getcaps);
gstaudiosrc_class->open = GST_DEBUG_FUNCPTR (gst_alsasrc_open); gstaudiosrc_class->open = GST_DEBUG_FUNCPTR (gst_alsasrc_open);
@ -287,7 +283,7 @@ gst_alsasrc_get_property (GObject * object, guint prop_id,
} }
static void static void
gst_alsasrc_init (GstAlsaSrc * alsasrc, GstAlsaSrcClass * g_class) gst_alsasrc_init (GstAlsaSrc * alsasrc)
{ {
GST_DEBUG_OBJECT (alsasrc, "initializing"); GST_DEBUG_OBJECT (alsasrc, "initializing");

View file

@ -56,8 +56,8 @@ enum
GST_DEBUG_CATEGORY_STATIC (gst_cd_paranoia_src_debug); GST_DEBUG_CATEGORY_STATIC (gst_cd_paranoia_src_debug);
#define GST_CAT_DEFAULT gst_cd_paranoia_src_debug #define GST_CAT_DEFAULT gst_cd_paranoia_src_debug
GST_BOILERPLATE (GstCdParanoiaSrc, gst_cd_paranoia_src, GstCddaBaseSrc, #define gst_cd_paranoia_src_parent_class parent_class
GST_TYPE_CDDA_BASE_SRC); 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_finalize (GObject * obj);
static void gst_cd_paranoia_src_get_property (GObject * object, guint prop_id, 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 static void
gst_cd_paranoia_src_base_init (gpointer g_class) gst_cd_paranoia_src_init (GstCdParanoiaSrc * src)
{
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 <omega@cse.ogi.edu>, Wim Taymans <wim@fluendo.com>");
}
static void
gst_cd_paranoia_src_init (GstCdParanoiaSrc * src, GstCdParanoiaSrcClass * klass)
{ {
src->d = NULL; src->d = NULL;
src->p = NULL; src->p = NULL;
@ -131,12 +120,18 @@ static void
gst_cd_paranoia_src_class_init (GstCdParanoiaSrcClass * klass) gst_cd_paranoia_src_class_init (GstCdParanoiaSrcClass * klass)
{ {
GstCddaBaseSrcClass *cddabasesrc_class = GST_CDDA_BASE_SRC_CLASS (klass); GstCddaBaseSrcClass *cddabasesrc_class = GST_CDDA_BASE_SRC_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->set_property = gst_cd_paranoia_src_set_property; gobject_class->set_property = gst_cd_paranoia_src_set_property;
gobject_class->get_property = gst_cd_paranoia_src_get_property; gobject_class->get_property = gst_cd_paranoia_src_get_property;
gobject_class->finalize = gst_cd_paranoia_src_finalize; 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 <omega@cse.ogi.edu>, Wim Taymans <wim@fluendo.com>");
cddabasesrc_class->open = gst_cd_paranoia_src_open; cddabasesrc_class->open = gst_cd_paranoia_src_open;
cddabasesrc_class->close = gst_cd_paranoia_src_close; cddabasesrc_class->close = gst_cd_paranoia_src_close;
cddabasesrc_class->read_sector = gst_cd_paranoia_src_read_sector; cddabasesrc_class->read_sector = gst_cd_paranoia_src_read_sector;

View file

@ -33,8 +33,8 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY); GST_STATIC_CAPS_ANY);
GST_BOILERPLATE (GstGioBaseSink, gst_gio_base_sink, GstBaseSink, #define gst_gio_base_sink_parent_class parent_class
GST_TYPE_BASE_SINK); G_DEFINE_TYPE (GstGioBaseSink, gst_gio_base_sink, GST_TYPE_BASE_SINK);
static void gst_gio_base_sink_finalize (GObject * object); static void gst_gio_base_sink_finalize (GObject * object);
static gboolean gst_gio_base_sink_start (GstBaseSink * base_sink); 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 gboolean gst_gio_base_sink_query (GstPad * pad, GstQuery * query);
static void static void
gst_gio_base_sink_base_init (gpointer gclass) gst_gio_base_sink_class_init (GstGioBaseSinkClass * klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); 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, GST_DEBUG_CATEGORY_INIT (gst_gio_base_sink_debug, "gio_base_sink", 0,
"GIO base sink"); "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;
GstBaseSinkClass *gstbasesink_class = (GstBaseSinkClass *) klass;
gobject_class->finalize = gst_gio_base_sink_finalize; 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->start = GST_DEBUG_FUNCPTR (gst_gio_base_sink_start);
gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_sink_stop); gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_sink_stop);
gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_gio_base_sink_unlock); 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 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_pad_set_query_function (GST_BASE_SINK_PAD (sink),
GST_DEBUG_FUNCPTR (gst_gio_base_sink_query)); GST_DEBUG_FUNCPTR (gst_gio_base_sink_query));

View file

@ -35,8 +35,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY); GST_STATIC_CAPS_ANY);
GST_BOILERPLATE (GstGioBaseSrc, gst_gio_base_src, GstBaseSrc, #define gst_gio_base_src_parent_class parent_class
GST_TYPE_BASE_SRC); G_DEFINE_TYPE (GstGioBaseSrc, gst_gio_base_src, GST_TYPE_BASE_SRC);
static void gst_gio_base_src_finalize (GObject * object); 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); GstQuery * query);
static void static void
gst_gio_base_src_base_init (gpointer gclass) gst_gio_base_src_class_init (GstGioBaseSrcClass * klass)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); 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, GST_DEBUG_CATEGORY_INIT (gst_gio_base_src_debug, "gio_base_src", 0,
"GIO base source"); "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;
GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass;
gobject_class->finalize = gst_gio_base_src_finalize; 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->start = GST_DEBUG_FUNCPTR (gst_gio_base_src_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_src_stop); gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gio_base_src_stop);
gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gio_base_src_get_size); 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 static void
gst_gio_base_src_init (GstGioBaseSrc * src, GstGioBaseSrcClass * gclass) gst_gio_base_src_init (GstGioBaseSrc * src)
{ {
src->cancel = g_cancellable_new (); src->cancel = g_cancellable_new ();
} }

View file

@ -92,8 +92,9 @@ enum
PROP_FILE PROP_FILE
}; };
GST_BOILERPLATE_FULL (GstGioSink, gst_gio_sink, GstGioBaseSink, #define gst_gio_sink_parent_class parent_class
GST_TYPE_GIO_BASE_SINK, gst_gio_uri_handler_do_init); 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_finalize (GObject * object);
static void gst_gio_sink_set_property (GObject * object, guint prop_id, static void gst_gio_sink_set_property (GObject * object, guint prop_id,
@ -102,26 +103,15 @@ static void gst_gio_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static GOutputStream *gst_gio_sink_get_stream (GstGioBaseSink * base_sink); 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 <mail@renestadler.de>, "
"Sebastian Dröge <sebastian.droege@collabora.co.uk>");
}
static void static void
gst_gio_sink_class_init (GstGioSinkClass * klass) gst_gio_sink_class_init (GstGioSinkClass * klass)
{ {
GObjectClass *gobject_class = (GObjectClass *) klass; GObjectClass *gobject_class = (GObjectClass *) klass;
GstElementClass *gstelement_class = (GstElementClass *) klass;
GstGioBaseSinkClass *gstgiobasesink_class = (GstGioBaseSinkClass *) 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->finalize = gst_gio_sink_finalize;
gobject_class->set_property = gst_gio_sink_set_property; gobject_class->set_property = gst_gio_sink_set_property;
gobject_class->get_property = gst_gio_sink_get_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_param_spec_object ("file", "File", "GFile to write to",
G_TYPE_FILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); 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 <mail@renestadler.de>, "
"Sebastian Dröge <sebastian.droege@collabora.co.uk>");
gstgiobasesink_class->get_stream = gstgiobasesink_class->get_stream =
GST_DEBUG_FUNCPTR (gst_gio_sink_get_stream); GST_DEBUG_FUNCPTR (gst_gio_sink_get_stream);
gstgiobasesink_class->close_on_stop = TRUE; gstgiobasesink_class->close_on_stop = TRUE;
} }
static void static void
gst_gio_sink_init (GstGioSink * sink, GstGioSinkClass * gclass) gst_gio_sink_init (GstGioSink * sink)
{ {
} }

View file

@ -83,8 +83,9 @@ enum
PROP_FILE PROP_FILE
}; };
GST_BOILERPLATE_FULL (GstGioSrc, gst_gio_src, GstGioBaseSrc, #define gst_gio_src_parent_class parent_class
GST_TYPE_GIO_BASE_SRC, gst_gio_uri_handler_do_init); 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); static void gst_gio_src_finalize (GObject * object);
@ -97,27 +98,16 @@ static GInputStream *gst_gio_src_get_stream (GstGioBaseSrc * bsrc);
static gboolean gst_gio_src_check_get_range (GstBaseSrc * base_src); 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 <mail@renestadler.de>, "
"Sebastian Dröge <sebastian.droege@collabora.co.uk>");
}
static void static void
gst_gio_src_class_init (GstGioSrcClass * klass) gst_gio_src_class_init (GstGioSrcClass * klass)
{ {
GObjectClass *gobject_class = (GObjectClass *) klass; GObjectClass *gobject_class = (GObjectClass *) klass;
GstElementClass *gstelement_class = (GstElementClass *) klass;
GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass; GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass;
GstGioBaseSrcClass *gstgiobasesrc_class = (GstGioBaseSrcClass *) 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->finalize = gst_gio_src_finalize;
gobject_class->set_property = gst_gio_src_set_property; gobject_class->set_property = gst_gio_src_set_property;
gobject_class->get_property = gst_gio_src_get_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_param_spec_object ("file", "File", "GFile to read from",
G_TYPE_FILE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); 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 <mail@renestadler.de>, "
"Sebastian Dröge <sebastian.droege@collabora.co.uk>");
gstbasesrc_class->check_get_range = gstbasesrc_class->check_get_range =
GST_DEBUG_FUNCPTR (gst_gio_src_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 static void
gst_gio_src_init (GstGioSrc * src, GstGioSrcClass * gclass) gst_gio_src_init (GstGioSrc * src)
{ {
} }

View file

@ -83,8 +83,8 @@ enum
PROP_STREAM PROP_STREAM
}; };
GST_BOILERPLATE (GstGioStreamSink, gst_gio_stream_sink, GstGioBaseSink, #define gst_gio_stream_sink_parent_class parent_class
GST_TYPE_GIO_BASE_SINK); 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_finalize (GObject * object);
static void gst_gio_stream_sink_set_property (GObject * object, guint prop_id, static void gst_gio_stream_sink_set_property (GObject * object, guint prop_id,
@ -93,26 +93,16 @@ static void gst_gio_stream_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static GOutputStream *gst_gio_stream_sink_get_stream (GstGioBaseSink * bsink); 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 <sebastian.droege@collabora.co.uk>");
}
static void static void
gst_gio_stream_sink_class_init (GstGioStreamSinkClass * klass) gst_gio_stream_sink_class_init (GstGioStreamSinkClass * klass)
{ {
GObjectClass *gobject_class = (GObjectClass *) klass; GObjectClass *gobject_class = (GObjectClass *) klass;
GstElementClass *gstelement_class = (GstElementClass *) klass;
GstGioBaseSinkClass *ggbsink_class = (GstGioBaseSinkClass *) 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->finalize = gst_gio_stream_sink_finalize;
gobject_class->set_property = gst_gio_stream_sink_set_property; gobject_class->set_property = gst_gio_stream_sink_set_property;
gobject_class->get_property = gst_gio_stream_sink_get_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_param_spec_object ("stream", "Stream", "Stream to write to",
G_TYPE_OUTPUT_STREAM, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); 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 <sebastian.droege@collabora.co.uk>");
ggbsink_class->get_stream = ggbsink_class->get_stream =
GST_DEBUG_FUNCPTR (gst_gio_stream_sink_get_stream); GST_DEBUG_FUNCPTR (gst_gio_stream_sink_get_stream);
} }
static void static void
gst_gio_stream_sink_init (GstGioStreamSink * sink, gst_gio_stream_sink_init (GstGioStreamSink * sink)
GstGioStreamSinkClass * gclass)
{ {
} }

View file

@ -77,8 +77,8 @@ enum
PROP_STREAM PROP_STREAM
}; };
GST_BOILERPLATE (GstGioStreamSrc, gst_gio_stream_src, GstGioBaseSrc, #define gst_gio_stream_src_parent_class parent_class
GST_TYPE_GIO_BASE_SRC); 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_finalize (GObject * object);
static void gst_gio_stream_src_set_property (GObject * object, guint prop_id, static void gst_gio_stream_src_set_property (GObject * object, guint prop_id,
@ -87,26 +87,16 @@ static void gst_gio_stream_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static GInputStream *gst_gio_stream_src_get_stream (GstGioBaseSrc * bsrc); 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 <sebastian.droege@collabora.co.uk>");
}
static void static void
gst_gio_stream_src_class_init (GstGioStreamSrcClass * klass) gst_gio_stream_src_class_init (GstGioStreamSrcClass * klass)
{ {
GObjectClass *gobject_class = (GObjectClass *) klass; GObjectClass *gobject_class = (GObjectClass *) klass;
GstElementClass *gstelement_class = (GstElementClass *) klass;
GstGioBaseSrcClass *gstgiobasesrc_class = (GstGioBaseSrcClass *) 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->finalize = gst_gio_stream_src_finalize;
gobject_class->set_property = gst_gio_stream_src_set_property; gobject_class->set_property = gst_gio_stream_src_set_property;
gobject_class->get_property = gst_gio_stream_src_get_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_param_spec_object ("stream", "Stream", "Stream to read from",
G_TYPE_INPUT_STREAM, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); 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 <sebastian.droege@collabora.co.uk>");
gstgiobasesrc_class->get_stream = gstgiobasesrc_class->get_stream =
GST_DEBUG_FUNCPTR (gst_gio_stream_src_get_stream); GST_DEBUG_FUNCPTR (gst_gio_stream_src_get_stream);
} }
static void static void
gst_gio_stream_src_init (GstGioStreamSrc * src, GstGioStreamSrcClass * gclass) gst_gio_stream_src_init (GstGioStreamSrc * src)
{ {
} }

View file

@ -123,21 +123,9 @@ gst_gnome_vfs_sink_do_init (GType type)
"Gnome VFS sink element"); "Gnome VFS sink element");
} }
GST_BOILERPLATE_FULL (GstGnomeVFSSink, gst_gnome_vfs_sink, GstBaseSink, #define gst_gnome_vfs_sink_parent_class parent_class
GST_TYPE_BASE_SINK, gst_gnome_vfs_sink_do_init); 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 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 <hadess@hadess.net>");
}
static gboolean static gboolean
_gst_boolean_allow_overwrite_accumulator (GSignalInvocationHint * ihint, _gst_boolean_allow_overwrite_accumulator (GSignalInvocationHint * ihint,
@ -157,9 +145,11 @@ static void
gst_gnome_vfs_sink_class_init (GstGnomeVFSSinkClass * klass) gst_gnome_vfs_sink_class_init (GstGnomeVFSSinkClass * klass)
{ {
GstBaseSinkClass *basesink_class; GstBaseSinkClass *basesink_class;
GstElementClass *gstelement_class;
GObjectClass *gobject_class; GObjectClass *gobject_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
basesink_class = (GstBaseSinkClass *) klass; basesink_class = (GstBaseSinkClass *) klass;
gobject_class->set_property = gst_gnome_vfs_sink_set_property; 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_boolean_allow_overwrite_accumulator, NULL,
gst_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, GST_TYPE_GNOME_VFS_URI); 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 <hadess@hadess.net>");
basesink_class->stop = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_stop); basesink_class->stop = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_stop);
basesink_class->start = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_start); basesink_class->start = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_start);
basesink_class->event = GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_handle_event); 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 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_pad_set_query_function (GST_BASE_SINK_PAD (sink),
GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_query)); GST_DEBUG_FUNCPTR (gst_gnome_vfs_sink_query));

View file

@ -116,9 +116,6 @@ enum
ARG_IRADIO_TITLE 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_finalize (GObject * object);
static void gst_gnome_vfs_src_uri_handler_init (gpointer g_iface, static void gst_gnome_vfs_src_uri_handler_init (gpointer g_iface,
gpointer iface_data); gpointer iface_data);
@ -137,67 +134,24 @@ static GstFlowReturn gst_gnome_vfs_src_create (GstBaseSrc * basesrc,
guint64 offset, guint size, GstBuffer ** buffer); guint64 offset, guint size, GstBuffer ** buffer);
static gboolean gst_gnome_vfs_src_query (GstBaseSrc * src, GstQuery * query); static gboolean gst_gnome_vfs_src_query (GstBaseSrc * src, GstQuery * query);
static GstElementClass *parent_class = NULL; #define gst_gnome_vfs_src_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstGnomeVFSSrc, gst_gnome_vfs_src, GST_TYPE_BASE_SRC,
GType G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
gst_gnome_vfs_src_get_type (void) gst_gnome_vfs_src_uri_handler_init));
{
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 <hadess@hadess.net>, "
"GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>");
GST_DEBUG_CATEGORY_INIT (gnomevfssrc_debug, "gnomevfssrc", 0,
"Gnome-VFS Source");
}
static void static void
gst_gnome_vfs_src_class_init (GstGnomeVFSSrcClass * klass) gst_gnome_vfs_src_class_init (GstGnomeVFSSrcClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSrcClass *gstbasesrc_class; GstBaseSrcClass *gstbasesrc_class;
gobject_class = G_OBJECT_CLASS (klass); gobject_class = G_OBJECT_CLASS (klass);
gstelement_class = GST_ELEMENT_CLASS (klass);
gstbasesrc_class = GST_BASE_SRC_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->finalize = gst_gnome_vfs_src_finalize;
gobject_class->set_property = gst_gnome_vfs_src_set_property; 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, "Name of currently playing song", NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); 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 <hadess@hadess.net>, "
"GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>");
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_start); gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_stop); gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_stop);
gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_get_size); gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_get_size);

View file

@ -1264,23 +1264,8 @@ static gboolean gst_ogg_demux_send_event (GstOggDemux * ogg, GstEvent * event);
static void gst_ogg_print (GstOggDemux * demux); 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)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details_simple (element_class,
"Ogg demuxer", "Codec/Demuxer",
"demux ogg streams (info about ogg: http://xiph.org)",
"Wim Taymans <wim@fluendo.com>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&ogg_demux_sink_template_factory));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&ogg_demux_src_template_factory));
}
static void static void
gst_ogg_demux_class_init (GstOggDemuxClass * klass) gst_ogg_demux_class_init (GstOggDemuxClass * klass)
@ -1288,6 +1273,16 @@ gst_ogg_demux_class_init (GstOggDemuxClass * klass)
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gst_element_class_set_details_simple (gstelement_class,
"Ogg demuxer", "Codec/Demuxer",
"demux ogg streams (info about ogg: http://xiph.org)",
"Wim Taymans <wim@fluendo.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&ogg_demux_sink_template_factory));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&ogg_demux_src_template_factory));
gstelement_class->change_state = gst_ogg_demux_change_state; gstelement_class->change_state = gst_ogg_demux_change_state;
gstelement_class->send_event = gst_ogg_demux_receive_event; gstelement_class->send_event = gst_ogg_demux_receive_event;
@ -1295,7 +1290,7 @@ gst_ogg_demux_class_init (GstOggDemuxClass * klass)
} }
static void static void
gst_ogg_demux_init (GstOggDemux * ogg, GstOggDemuxClass * g_class) gst_ogg_demux_init (GstOggDemux * ogg)
{ {
/* create the sink pad */ /* create the sink pad */
ogg->sinkpad = ogg->sinkpad =
@ -3593,7 +3588,7 @@ gst_ogg_demux_change_state (GstElement * element, GstStateChange transition)
break; break;
} }
result = parent_class->change_state (element, transition); result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:

View file

@ -110,9 +110,6 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d",
"subtitle/x-kate; application/x-kate") "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 void gst_ogg_mux_finalize (GObject * object);
static GstFlowReturn static GstFlowReturn
@ -129,57 +126,10 @@ static void gst_ogg_mux_get_property (GObject * object,
static GstStateChangeReturn gst_ogg_mux_change_state (GstElement * element, static GstStateChangeReturn gst_ogg_mux_change_state (GstElement * element,
GstStateChange transition); GstStateChange transition);
static GstElementClass *parent_class = NULL;
/*static guint gst_ogg_mux_signals[LAST_SIGNAL] = { 0 }; */ /*static guint gst_ogg_mux_signals[LAST_SIGNAL] = { 0 }; */
#define gst_ogg_mux_parent_class parent_class
GType G_DEFINE_TYPE_WITH_CODE (GstOggMux, gst_ogg_mux, GST_TYPE_ELEMENT,
gst_ogg_mux_get_type (void) G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL));
{
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 <wim@fluendo.com>");
}
static void static void
gst_ogg_mux_class_init (GstOggMuxClass * klass) gst_ogg_mux_class_init (GstOggMuxClass * klass)
@ -190,12 +140,20 @@ gst_ogg_mux_class_init (GstOggMuxClass * klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = gst_ogg_mux_finalize; gobject_class->finalize = gst_ogg_mux_finalize;
gobject_class->get_property = gst_ogg_mux_get_property; gobject_class->get_property = gst_ogg_mux_get_property;
gobject_class->set_property = gst_ogg_mux_set_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 <wim@fluendo.com>");
gstelement_class->request_new_pad = gst_ogg_mux_request_new_pad; gstelement_class->request_new_pad = gst_ogg_mux_request_new_pad;
gstelement_class->release_pad = gst_ogg_mux_release_pad; gstelement_class->release_pad = gst_ogg_mux_release_pad;

View file

@ -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_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))) #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 * static GstStateChangeReturn gst_base_text_overlay_change_state (GstElement *
element, GstStateChange transition); element, GstStateChange transition);
@ -348,8 +354,31 @@ static void
gst_base_text_overlay_adjust_values_with_fontdesc (GstBaseTextOverlay * overlay, gst_base_text_overlay_adjust_values_with_fontdesc (GstBaseTextOverlay * overlay,
PangoFontDescription * desc); PangoFontDescription * desc);
GST_BOILERPLATE (GstBaseTextOverlay, gst_base_text_overlay, GstElement, GType
GST_TYPE_ELEMENT); 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 * static gchar *
gst_base_text_overlay_get_text (GstBaseTextOverlay * overlay, gst_base_text_overlay_get_text (GstBaseTextOverlay * overlay,
@ -385,6 +414,8 @@ gst_base_text_overlay_class_init (GstBaseTextOverlayClass * klass)
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_peek_parent (klass);
gobject_class->finalize = gst_base_text_overlay_finalize; gobject_class->finalize = gst_base_text_overlay_finalize;
gobject_class->set_property = gst_base_text_overlay_set_property; gobject_class->set_property = gst_base_text_overlay_set_property;
gobject_class->get_property = gst_base_text_overlay_get_property; gobject_class->get_property = gst_base_text_overlay_get_property;

View file

@ -60,20 +60,8 @@ enum
PROP_LAST PROP_LAST
}; };
GST_BOILERPLATE (GstClockOverlay, gst_clock_overlay, GstBaseTextOverlay, #define gst_clock_overlay_parent_class parent_class
GST_TYPE_BASE_TEXT_OVERLAY); G_DEFINE_TYPE (GstClockOverlay, gst_clock_overlay, 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 <tim@centricular.net>");
}
static void gst_clock_overlay_finalize (GObject * object); static void gst_clock_overlay_finalize (GObject * object);
static void gst_clock_overlay_set_property (GObject * object, guint prop_id, 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) gst_clock_overlay_class_init (GstClockOverlayClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseTextOverlayClass *gsttextoverlay_class; GstBaseTextOverlayClass *gsttextoverlay_class;
PangoContext *context; PangoContext *context;
PangoFontDescription *font_description; PangoFontDescription *font_description;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gsttextoverlay_class = (GstBaseTextOverlayClass *) klass; gsttextoverlay_class = (GstBaseTextOverlayClass *) klass;
gobject_class->finalize = gst_clock_overlay_finalize; gobject_class->finalize = gst_clock_overlay_finalize;
gobject_class->set_property = gst_clock_overlay_set_property; gobject_class->set_property = gst_clock_overlay_set_property;
gobject_class->get_property = gst_clock_overlay_get_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 <tim@centricular.net>");
gsttextoverlay_class->get_text = gst_clock_overlay_get_text; gsttextoverlay_class->get_text = gst_clock_overlay_get_text;
g_object_class_install_property (gobject_class, PROP_TIMEFORMAT, g_object_class_install_property (gobject_class, PROP_TIMEFORMAT,
@ -197,7 +192,7 @@ gst_clock_overlay_finalize (GObject * object)
static void static void
gst_clock_overlay_init (GstClockOverlay * overlay, GstClockOverlayClass * klass) gst_clock_overlay_init (GstClockOverlay * overlay)
{ {
GstBaseTextOverlay *textoverlay; GstBaseTextOverlay *textoverlay;

View file

@ -162,7 +162,8 @@ gst_text_render_line_align_get_type (void)
static void gst_text_render_adjust_values_with_fontdesc (GstTextRender * static void gst_text_render_adjust_values_with_fontdesc (GstTextRender *
render, PangoFontDescription * desc); 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_finalize (GObject * object);
static void gst_text_render_set_property (GObject * object, static void gst_text_render_set_property (GObject * object,
@ -170,30 +171,15 @@ static void gst_text_render_set_property (GObject * object,
static void gst_text_render_get_property (GObject * object, static void gst_text_render_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec); 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 <ds@schleef.org>, "
"GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>");
}
static void static void
gst_text_render_class_init (GstTextRenderClass * klass) gst_text_render_class_init (GstTextRenderClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class;
PangoFontMap *fontmap; PangoFontMap *fontmap;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_peek_parent (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->set_property = gst_text_render_set_property;
gobject_class->get_property = gst_text_render_get_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 <ds@schleef.org>, "
"GStreamer maintainers <gstreamer-devel@lists.sourceforge.net>");
fontmap = pango_cairo_font_map_get_default (); fontmap = pango_cairo_font_map_get_default ();
klass->pango_context = klass->pango_context =
pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap)); pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
@ -591,7 +588,7 @@ gst_text_render_finalize (GObject * object)
} }
static void static void
gst_text_render_init (GstTextRender * render, GstTextRenderClass * klass) gst_text_render_init (GstTextRender * render)
{ {
GstPadTemplate *template; GstPadTemplate *template;

View file

@ -50,19 +50,8 @@
#include <gsttimeoverlay.h> #include <gsttimeoverlay.h>
GST_BOILERPLATE (GstTimeOverlay, gst_time_overlay, GstBaseTextOverlay, #define gst_time_overlay_parent_class parent_class
GST_TYPE_BASE_TEXT_OVERLAY); G_DEFINE_TYPE (GstTimeOverlay, gst_time_overlay, 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 <tim@centricular.net>");
}
static gchar * static gchar *
gst_time_overlay_render_time (GstTimeOverlay * overlay, GstClockTime time) gst_time_overlay_render_time (GstTimeOverlay * overlay, GstClockTime time)
@ -116,11 +105,18 @@ gst_time_overlay_get_text (GstBaseTextOverlay * overlay,
static void static void
gst_time_overlay_class_init (GstTimeOverlayClass * klass) gst_time_overlay_class_init (GstTimeOverlayClass * klass)
{ {
GstElementClass *gstelement_class;
GstBaseTextOverlayClass *gsttextoverlay_class; GstBaseTextOverlayClass *gsttextoverlay_class;
PangoContext *context; PangoContext *context;
PangoFontDescription *font_description; PangoFontDescription *font_description;
gsttextoverlay_class = (GstBaseTextOverlayClass *) klass; 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 <tim@centricular.net>");
gsttextoverlay_class->get_text = gst_time_overlay_get_text; gsttextoverlay_class->get_text = gst_time_overlay_get_text;
@ -143,7 +139,7 @@ gst_time_overlay_class_init (GstTimeOverlayClass * klass)
} }
static void static void
gst_time_overlay_init (GstTimeOverlay * overlay, GstTimeOverlayClass * klass) gst_time_overlay_init (GstTimeOverlay * overlay)
{ {
GstBaseTextOverlay *textoverlay; GstBaseTextOverlay *textoverlay;

View file

@ -81,7 +81,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS ("video/x-theora") 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, static void theora_dec_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
@ -107,22 +108,6 @@ static const GstEventMask *theora_get_event_masks (GstPad * pad);
#endif #endif
static const GstQueryType *theora_get_query_types (GstPad * pad); 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 <otte@gnome.org>, Wim Taymans <wim@fluendo.com>");
}
static gboolean static gboolean
gst_theora_dec_ctl_is_supported (int req) 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)); 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 <otte@gnome.org>, Wim Taymans <wim@fluendo.com>");
gstelement_class->change_state = theora_dec_change_state; gstelement_class->change_state = theora_dec_change_state;
GST_DEBUG_CATEGORY_INIT (theoradec_debug, "theoradec", 0, "Theora decoder"); GST_DEBUG_CATEGORY_INIT (theoradec_debug, "theoradec", 0, "Theora decoder");
} }
static void static void
gst_theora_dec_init (GstTheoraDec * dec, GstTheoraDecClass * g_class) gst_theora_dec_init (GstTheoraDec * dec)
{ {
dec->sinkpad = dec->sinkpad =
gst_pad_new_from_static_template (&theora_dec_sink_factory, "sink"); gst_pad_new_from_static_template (&theora_dec_sink_factory, "sink");
@ -1524,7 +1518,7 @@ theora_dec_change_state (GstElement * element, GstStateChange transition)
break; break;
} }
ret = parent_class->change_state (element, transition); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:

View file

@ -243,21 +243,9 @@ GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS ("video/x-theora") GST_STATIC_CAPS ("video/x-theora")
); );
static void #define gst_theora_enc_parent_class parent_class
_do_init (GType object_type) G_DEFINE_TYPE_WITH_CODE (GstTheoraEnc, gst_theora_enc,
{ GST_TYPE_ELEMENT, G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL));
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);
static gboolean theora_enc_sink_event (GstPad * pad, GstEvent * event); static gboolean theora_enc_sink_event (GstPad * pad, GstEvent * event);
static gboolean theora_enc_src_event (GstPad * pad, GstEvent * event); static gboolean theora_enc_src_event (GstPad * pad, GstEvent * event);
@ -275,21 +263,6 @@ static void theora_enc_finalize (GObject * object);
static gboolean theora_enc_write_multipass_cache (GstTheoraEnc * enc, static gboolean theora_enc_write_multipass_cache (GstTheoraEnc * enc,
gboolean begin, gboolean eos); 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 <wim@fluendo.com>");
}
static void static void
gst_theora_enc_class_init (GstTheoraEncClass * klass) gst_theora_enc_class_init (GstTheoraEncClass * klass)
{ {
@ -414,11 +387,20 @@ gst_theora_enc_class_init (GstTheoraEncClass * klass)
THEORA_DEF_MULTIPASS_MODE, THEORA_DEF_MULTIPASS_MODE,
(GParamFlags) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); (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 <wim@fluendo.com>");
gstelement_class->change_state = theora_enc_change_state; gstelement_class->change_state = theora_enc_change_state;
} }
static void static void
gst_theora_enc_init (GstTheoraEnc * enc, GstTheoraEncClass * g_class) gst_theora_enc_init (GstTheoraEnc * enc)
{ {
enc->sinkpad = enc->sinkpad =
gst_pad_new_from_static_template (&theora_enc_sink_factory, "sink"); gst_pad_new_from_static_template (&theora_enc_sink_factory, "sink");
@ -1398,7 +1380,7 @@ theora_enc_change_state (GstElement * element, GstStateChange transition)
break; break;
} }
ret = parent_class->change_state (element, transition); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:

View file

@ -85,8 +85,8 @@ enum
PROP_SYNCHRONIZATION_POINTS PROP_SYNCHRONIZATION_POINTS
}; };
GST_BOILERPLATE (GstTheoraParse, gst_theora_parse, GstElement, #define gst_theora_parse_parent_class parent_class
GST_TYPE_ELEMENT); G_DEFINE_TYPE (GstTheoraParse, gst_theora_parse, GST_TYPE_ELEMENT);
static void theora_parse_dispose (GObject * object); static void theora_parse_dispose (GObject * object);
static void theora_parse_get_property (GObject * object, guint prop_id, static void theora_parse_get_property (GObject * object, guint prop_id,
@ -100,20 +100,6 @@ static GstStateChangeReturn theora_parse_change_state (GstElement * element,
static gboolean theora_parse_sink_event (GstPad * pad, GstEvent * event); static gboolean theora_parse_sink_event (GstPad * pad, GstEvent * event);
static gboolean theora_parse_src_query (GstPad * pad, GstQuery * query); 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 <wingo@pobox.com>");
}
static void static void
gst_theora_parse_class_init (GstTheoraParseClass * klass) gst_theora_parse_class_init (GstTheoraParseClass * 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),
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 <wingo@pobox.com>");
gstelement_class->change_state = theora_parse_change_state; gstelement_class->change_state = theora_parse_change_state;
GST_DEBUG_CATEGORY_INIT (theoraparse_debug, "theoraparse", 0, GST_DEBUG_CATEGORY_INIT (theoraparse_debug, "theoraparse", 0,
@ -147,7 +142,7 @@ gst_theora_parse_class_init (GstTheoraParseClass * klass)
} }
static void static void
gst_theora_parse_init (GstTheoraParse * parse, GstTheoraParseClass * g_class) gst_theora_parse_init (GstTheoraParse * parse)
{ {
parse->sinkpad = parse->sinkpad =
gst_pad_new_from_static_template (&theora_parse_sink_factory, "sink"); gst_pad_new_from_static_template (&theora_parse_sink_factory, "sink");
@ -919,7 +914,7 @@ theora_parse_change_state (GstElement * element, GstStateChange transition)
break; break;
} }
ret = parent_class->change_state (element, transition); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:

View file

@ -64,8 +64,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS ("audio/x-vorbis") GST_STATIC_CAPS ("audio/x-vorbis")
); );
GST_BOILERPLATE (GST_VORBIS_DEC_GLIB_TYPE_NAME, gst_vorbis_dec, GstElement, #define gst_vorbis_dec_parent_class parent_class
GST_TYPE_ELEMENT); G_DEFINE_TYPE (GST_VORBIS_DEC_GLIB_TYPE_NAME, gst_vorbis_dec, GST_TYPE_ELEMENT);
static void vorbis_dec_finalize (GObject * object); static void vorbis_dec_finalize (GObject * object);
static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event); static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event);
@ -85,24 +85,6 @@ static gboolean vorbis_dec_convert (GstPad * pad,
static gboolean vorbis_dec_sink_query (GstPad * pad, GstQuery * query); static gboolean vorbis_dec_sink_query (GstPad * pad, GstQuery * query);
static void
gst_vorbis_dec_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_dec_src_factory);
gst_element_class_add_pad_template (element_class, src_template);
sink_template = gst_static_pad_template_get (&vorbis_dec_sink_factory);
gst_element_class_add_pad_template (element_class, sink_template);
gst_element_class_set_details_simple (element_class,
"Vorbis audio decoder", "Codec/Decoder/Audio",
GST_VORBIS_DEC_DESCRIPTION,
"Benjamin Otte <otte@gnome.org>, Chris Lord <chris@openedhand.com>");
}
static void static void
gst_vorbis_dec_class_init (GstVorbisDecClass * klass) gst_vorbis_dec_class_init (GstVorbisDecClass * klass)
{ {
@ -111,6 +93,17 @@ gst_vorbis_dec_class_init (GstVorbisDecClass * klass)
gobject_class->finalize = vorbis_dec_finalize; gobject_class->finalize = vorbis_dec_finalize;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&vorbis_dec_src_factory));
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 <otte@gnome.org>, Chris Lord <chris@openedhand.com>");
gstelement_class->change_state = GST_DEBUG_FUNCPTR (vorbis_dec_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR (vorbis_dec_change_state);
} }
@ -128,7 +121,7 @@ vorbis_get_query_types (GstPad * pad)
} }
static void 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, dec->sinkpad = gst_pad_new_from_static_template (&vorbis_dec_sink_factory,
"sink"); "sink");
@ -1276,7 +1269,7 @@ vorbis_dec_change_state (GstElement * element, GstStateChange transition)
break; break;
} }
res = parent_class->change_state (element, transition); res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:

View file

@ -132,8 +132,9 @@ static GstStateChangeReturn gst_vorbis_enc_change_state (GstElement * element,
GstStateChange transition); GstStateChange transition);
static void gst_vorbis_enc_add_interfaces (GType vorbisenc_type); static void gst_vorbis_enc_add_interfaces (GType vorbisenc_type);
GST_BOILERPLATE_FULL (GstVorbisEnc, gst_vorbis_enc, GstElement, #define gst_vorbis_enc_parent_class parent_class
GST_TYPE_ELEMENT, gst_vorbis_enc_add_interfaces); G_DEFINE_TYPE_WITH_CODE (GstVorbisEnc, gst_vorbis_enc,
GST_TYPE_ELEMENT, gst_vorbis_enc_add_interfaces (g_define_type_id));
static void static void
gst_vorbis_enc_add_interfaces (GType vorbisenc_type) gst_vorbis_enc_add_interfaces (GType vorbisenc_type)
@ -146,24 +147,6 @@ gst_vorbis_enc_add_interfaces (GType vorbisenc_type)
g_type_add_interface_static (vorbisenc_type, GST_TYPE_PRESET, &preset_info); g_type_add_interface_static (vorbisenc_type, GST_TYPE_PRESET, &preset_info);
} }
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 <monty@xiph.org>, " "Wim Taymans <wim@fluendo.com>");
}
static void static void
gst_vorbis_enc_class_init (GstVorbisEncClass * klass) gst_vorbis_enc_class_init (GstVorbisEncClass * klass)
{ {
@ -208,6 +191,15 @@ gst_vorbis_enc_class_init (GstVorbisEncClass * klass)
"The last status message", NULL, "The last status message", NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); 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 <monty@xiph.org>, " "Wim Taymans <wim@fluendo.com>");
gstelement_class->change_state = gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_vorbis_enc_change_state); GST_DEBUG_FUNCPTR (gst_vorbis_enc_change_state);
} }
@ -570,7 +562,7 @@ error:
} }
static void static void
gst_vorbis_enc_init (GstVorbisEnc * vorbisenc, GstVorbisEncClass * klass) gst_vorbis_enc_init (GstVorbisEnc * vorbisenc)
{ {
vorbisenc->sinkpad = vorbisenc->sinkpad =
gst_pad_new_from_static_template (&vorbis_enc_sink_factory, "sink"); gst_pad_new_from_static_template (&vorbis_enc_sink_factory, "sink");

View file

@ -72,8 +72,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS ("audio/x-vorbis") GST_STATIC_CAPS ("audio/x-vorbis")
); );
GST_BOILERPLATE (GstVorbisParse, gst_vorbis_parse, GstElement, #define gst_vorbis_parse_parent_class parent_class
GST_TYPE_ELEMENT); G_DEFINE_TYPE (GstVorbisParse, gst_vorbis_parse, GST_TYPE_ELEMENT);
static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstBuffer * buffer); static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstBuffer * buffer);
static GstStateChangeReturn vorbis_parse_change_state (GstElement * element, static GstStateChangeReturn vorbis_parse_change_state (GstElement * element,
@ -86,21 +86,6 @@ static gboolean vorbis_parse_convert (GstPad * pad,
static GstFlowReturn vorbis_parse_parse_packet (GstVorbisParse * parse, static GstFlowReturn vorbis_parse_parse_packet (GstVorbisParse * parse,
GstBuffer * buf); GstBuffer * buf);
static void
gst_vorbis_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 (&vorbis_parse_src_factory));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&vorbis_parse_sink_factory));
gst_element_class_set_details_simple (element_class,
"VorbisParse", "Codec/Parser/Audio",
"parse raw vorbis streams",
"Thomas Vander Stichele <thomas at apestaart dot org>");
}
static void static void
gst_vorbis_parse_class_init (GstVorbisParseClass * klass) gst_vorbis_parse_class_init (GstVorbisParseClass * klass)
{ {
@ -108,11 +93,20 @@ gst_vorbis_parse_class_init (GstVorbisParseClass * klass)
gstelement_class->change_state = vorbis_parse_change_state; gstelement_class->change_state = vorbis_parse_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&vorbis_parse_src_factory));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&vorbis_parse_sink_factory));
gst_element_class_set_details_simple (gstelement_class,
"VorbisParse", "Codec/Parser/Audio",
"parse raw vorbis streams",
"Thomas Vander Stichele <thomas at apestaart dot org>");
klass->parse_packet = GST_DEBUG_FUNCPTR (vorbis_parse_parse_packet); klass->parse_packet = GST_DEBUG_FUNCPTR (vorbis_parse_parse_packet);
} }
static void static void
gst_vorbis_parse_init (GstVorbisParse * parse, GstVorbisParseClass * g_class) gst_vorbis_parse_init (GstVorbisParse * parse)
{ {
parse->sinkpad = parse->sinkpad =
gst_pad_new_from_static_template (&vorbis_parse_sink_factory, "sink"); gst_pad_new_from_static_template (&vorbis_parse_sink_factory, "sink");
@ -655,7 +649,7 @@ vorbis_parse_change_state (GstElement * element, GstStateChange transition)
break; break;
} }
ret = parent_class->change_state (element, transition); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:

View file

@ -63,41 +63,25 @@ GST_DEBUG_CATEGORY_EXTERN (vorbisparse_debug);
static GstFlowReturn gst_vorbis_tag_parse_packet (GstVorbisParse * parse, static GstFlowReturn gst_vorbis_tag_parse_packet (GstVorbisParse * parse,
GstBuffer * buffer); GstBuffer * buffer);
#define _do_init(type) \ #define gst_vorbis_tag_parent_class parent_class
G_STMT_START{ \ G_DEFINE_TYPE_WITH_CODE (GstVorbisTag, gst_vorbis_tag,
static const GInterfaceInfo tag_setter_info = { \ GST_TYPE_VORBIS_PARSE, G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL));
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);
static void
gst_vorbis_tag_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details_simple (element_class,
"VorbisTag", "Formatter/Metadata",
"Retags vorbis streams", "James Livingston <doclivingston@gmail.com>");
}
static void static void
gst_vorbis_tag_class_init (GstVorbisTagClass * klass) gst_vorbis_tag_class_init (GstVorbisTagClass * klass)
{ {
GstVorbisParseClass *vorbisparse_class = GST_VORBIS_PARSE_CLASS (klass); 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 <doclivingston@gmail.com>");
vorbisparse_class->parse_packet = gst_vorbis_tag_parse_packet; vorbisparse_class->parse_packet = gst_vorbis_tag_parse_packet;
} }
static void static void
gst_vorbis_tag_init (GstVorbisTag * tagger, GstVorbisTagClass * g_class) gst_vorbis_tag_init (GstVorbisTag * tagger)
{ {
/* nothing to do */ /* nothing to do */
} }