audioencoder: Use GST_BOILERPLATE instead of custom GObject boilerplate code

This commit is contained in:
Sebastian Dröge 2011-09-26 15:34:54 +02:00
parent abafb030ac
commit 11e375486e

View file

@ -245,45 +245,6 @@ struct _GstAudioEncoderPrivate
GstTagList *tags;
};
static GstElementClass *parent_class = NULL;
static void gst_audio_encoder_class_init (GstAudioEncoderClass * klass);
static void gst_audio_encoder_init (GstAudioEncoder * parse,
GstAudioEncoderClass * klass);
GType
gst_audio_encoder_get_type (void)
{
static GType audio_encoder_type = 0;
if (!audio_encoder_type) {
static const GTypeInfo audio_encoder_info = {
sizeof (GstAudioEncoderClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gst_audio_encoder_class_init,
NULL,
NULL,
sizeof (GstAudioEncoder),
0,
(GInstanceInitFunc) gst_audio_encoder_init,
};
const GInterfaceInfo preset_interface_info = {
NULL, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
audio_encoder_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstAudioEncoder", &audio_encoder_info, G_TYPE_FLAG_ABSTRACT);
g_type_add_interface_static (audio_encoder_type, GST_TYPE_PRESET,
&preset_interface_info);
}
return audio_encoder_type;
}
static void gst_audio_encoder_finalize (GObject * object);
static void gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full);
@ -303,6 +264,20 @@ static gboolean gst_audio_encoder_sink_query (GstPad * pad, GstQuery * query);
static const GstQueryType *gst_audio_encoder_get_query_types (GstPad * pad);
static GstCaps *gst_audio_encoder_sink_getcaps (GstPad * pad);
static void
do_init (GType gtype)
{
const GInterfaceInfo preset_interface_info = {
NULL, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
g_type_add_interface_static (gtype, GST_TYPE_PRESET, &preset_interface_info);
}
GST_BOILERPLATE_FULL (GstAudioEncoder, gst_audio_encoder, GstElement,
GST_TYPE_ELEMENT, do_init);
static void
gst_audio_encoder_class_init (GstAudioEncoderClass * klass)
@ -310,7 +285,6 @@ gst_audio_encoder_class_init (GstAudioEncoderClass * klass)
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
GST_DEBUG_CATEGORY_INIT (gst_audio_encoder_debug, "audioencoder", 0,
"audio encoder base class");
@ -342,6 +316,11 @@ gst_audio_encoder_class_init (GstAudioEncoderClass * klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
gst_audio_encoder_base_init (gpointer g_class)
{
}
static void
gst_audio_encoder_init (GstAudioEncoder * enc, GstAudioEncoderClass * bclass)
{