smpte: use some more boilerplate

This commit is contained in:
Mark Nauwelaerts 2012-04-13 16:54:53 +02:00
parent 93f61c47b9
commit 6d9a84b1cf
2 changed files with 4 additions and 28 deletions

View file

@ -146,8 +146,6 @@ gst_smpte_transition_type_get_type (void)
} }
static void gst_smpte_class_init (GstSMPTEClass * klass);
static void gst_smpte_init (GstSMPTE * smpte);
static void gst_smpte_finalize (GstSMPTE * smpte); static void gst_smpte_finalize (GstSMPTE * smpte);
static GstFlowReturn gst_smpte_collected (GstCollectPads2 * pads, static GstFlowReturn gst_smpte_collected (GstCollectPads2 * pads,
@ -161,33 +159,10 @@ static void gst_smpte_get_property (GObject * object, guint prop_id,
static GstStateChangeReturn gst_smpte_change_state (GstElement * element, static GstStateChangeReturn gst_smpte_change_state (GstElement * element,
GstStateChange transition); GstStateChange transition);
static GstElementClass *parent_class = NULL;
/*static guint gst_smpte_signals[LAST_SIGNAL] = { 0 }; */ /*static guint gst_smpte_signals[LAST_SIGNAL] = { 0 }; */
static GType #define gst_smpte_parent_class parent_class
gst_smpte_get_type (void) G_DEFINE_TYPE (GstSMPTE, gst_smpte, GST_TYPE_ELEMENT);
{
static GType smpte_type = 0;
if (!smpte_type) {
static const GTypeInfo smpte_info = {
sizeof (GstSMPTEClass),
NULL,
NULL,
(GClassInitFunc) gst_smpte_class_init,
NULL,
NULL,
sizeof (GstSMPTE),
0,
(GInstanceInitFunc) gst_smpte_init,
};
smpte_type =
g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0);
}
return smpte_type;
}
static void static void
gst_smpte_class_init (GstSMPTEClass * klass) gst_smpte_class_init (GstSMPTEClass * klass)
@ -694,7 +669,7 @@ gst_smpte_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

@ -79,6 +79,7 @@ struct _GstSMPTEClass {
GstElementClass parent_class; GstElementClass parent_class;
}; };
GType gst_smpte_get_type (void);
gboolean gst_smpte_plugin_init (GstPlugin * plugin); gboolean gst_smpte_plugin_init (GstPlugin * plugin);
G_END_DECLS G_END_DECLS