debugutils: Switch from GST_BOILERPLATE to G_DEFINE_TYPE

This commit is contained in:
Edward Hervey 2011-06-07 12:06:08 +02:00
parent 8c02b650c9
commit a8effacf82
10 changed files with 151 additions and 217 deletions

View file

@ -45,6 +45,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_break_my_data_debug);
#define GST_IS_BREAK_MY_DATA_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BREAK_MY_DATA))
GType gst_break_my_data_get_type (void);
enum
{
ARG_0,
@ -95,40 +97,24 @@ GstStaticPadTemplate bmd_sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
#define gst_break_my_data_parent_class parent_class
G_DEFINE_TYPE (GstBreakMyData, gst_break_my_data, GST_TYPE_BASE_TRANSFORM);
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_break_my_data_debug, "breakmydata", 0, \
"debugging category for breakmydata element");
GType gst_break_my_data_get_type (void);
GST_BOILERPLATE_FULL (GstBreakMyData, gst_break_my_data, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
static void
gst_break_my_data_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&bmd_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&bmd_src_template));
gst_element_class_set_details_simple (gstelement_class, "Break my data",
"Testing",
"randomly change data in the stream", "Benjamin Otte <otte@gnome>");
}
static void
gst_break_my_data_class_init (GstBreakMyDataClass * klass)
{
GstBaseTransformClass *gstbasetrans_class;
GstElementClass *gstelement_class;
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gstelement_class = GST_ELEMENT_CLASS (klass);
gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass);
GST_DEBUG_CATEGORY_INIT (gst_break_my_data_debug, "breakmydata", 0,
"debugging category for breakmydata element");
gobject_class->set_property = gst_break_my_data_set_property;
gobject_class->get_property = gst_break_my_data_get_property;
@ -152,6 +138,15 @@ gst_break_my_data_class_init (GstBreakMyDataClass * klass)
"probability for each byte in the buffer to be changed", 0.0, 1.0,
0.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&bmd_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&bmd_src_template));
gst_element_class_set_details_simple (gstelement_class, "Break my data",
"Testing",
"randomly change data in the stream", "Benjamin Otte <otte@gnome>");
gstbasetrans_class->transform_ip =
GST_DEBUG_FUNCPTR (gst_break_my_data_transform_ip);
gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_break_my_data_start);
@ -159,7 +154,7 @@ gst_break_my_data_class_init (GstBreakMyDataClass * klass)
}
static void
gst_break_my_data_init (GstBreakMyData * bmd, GstBreakMyDataClass * g_class)
gst_break_my_data_init (GstBreakMyData * bmd)
{
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (bmd), TRUE);
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (bmd), TRUE);

View file

@ -50,24 +50,8 @@ static GstFlowReturn gst_cpu_report_transform_ip (GstBaseTransform * trans,
static gboolean gst_cpu_report_start (GstBaseTransform * trans);
static gboolean gst_cpu_report_stop (GstBaseTransform * trans);
GST_BOILERPLATE (GstCpuReport, gst_cpu_report, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM);
static void
gst_cpu_report_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 (&cpu_report_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&cpu_report_src_template));
gst_element_class_set_details_simple (element_class, "CPU report",
"Testing",
"Post cpu usage information every buffer",
"Zaheer Abbas Merali <zaheerabbas at merali dot org>");
}
#define gst_cpu_report_parent_class parent_class
G_DEFINE_TYPE (GstCpuReport, gst_cpu_report, GST_TYPE_BASE_TRANSFORM);
static void
gst_cpu_report_finalize (GObject * obj)
@ -79,13 +63,25 @@ static void
gst_cpu_report_class_init (GstCpuReportClass * g_class)
{
GstBaseTransformClass *gstbasetrans_class;
GstElementClass *element_class;
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (g_class);
element_class = GST_ELEMENT_CLASS (g_class);
gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (g_class);
gobject_class->finalize = gst_cpu_report_finalize;
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&cpu_report_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&cpu_report_src_template));
gst_element_class_set_details_simple (element_class, "CPU report",
"Testing",
"Post cpu usage information every buffer",
"Zaheer Abbas Merali <zaheerabbas at merali dot org>");
gstbasetrans_class->transform_ip =
GST_DEBUG_FUNCPTR (gst_cpu_report_transform_ip);
gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_cpu_report_start);
@ -93,7 +89,7 @@ gst_cpu_report_class_init (GstCpuReportClass * g_class)
}
static void
gst_cpu_report_init (GstCpuReport * report, GstCpuReportClass * g_class)
gst_cpu_report_init (GstCpuReport * report)
{
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (report), TRUE);

View file

@ -61,26 +61,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
/* class initialization */
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_caps_debug_debug, "capsdebug", 0, \
"debug category for capsdebug element");
GST_BOILERPLATE_FULL (GstCapsDebug, gst_caps_debug, GstElement,
GST_TYPE_ELEMENT, DEBUG_INIT);
static void
gst_caps_debug_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 (&gst_caps_debug_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_caps_debug_sink_template));
gst_element_class_set_details_simple (element_class, "Caps debug",
"Generic", "Debug caps negotiation", "David Schleef <ds@schleef.org>");
}
#define gst_caps_debug_parent_class parent_class
G_DEFINE_TYPE (GstCapsDebug, gst_caps_debug, GST_TYPE_ELEMENT);
static void
gst_caps_debug_class_init (GstCapsDebugClass * klass)
@ -92,11 +74,20 @@ gst_caps_debug_class_init (GstCapsDebugClass * klass)
gobject_class->finalize = gst_caps_debug_finalize;
element_class->change_state = GST_DEBUG_FUNCPTR (gst_caps_debug_change_state);
GST_DEBUG_CATEGORY_INIT (gst_caps_debug_debug, "capsdebug", 0,
"debug category for capsdebug element");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_caps_debug_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_caps_debug_sink_template));
gst_element_class_set_details_simple (element_class, "Caps debug",
"Generic", "Debug caps negotiation", "David Schleef <ds@schleef.org>");
}
static void
gst_caps_debug_init (GstCapsDebug * capsdebug,
GstCapsDebugClass * capsdebug_class)
gst_caps_debug_init (GstCapsDebug * capsdebug)
{
capsdebug->srcpad =

View file

@ -111,29 +111,14 @@ static void gst_caps_setter_set_property (GObject * object, guint prop_id,
static void gst_caps_setter_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstCapsSetter, gst_caps_setter, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM);
static void
gst_caps_setter_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details_simple (element_class, "CapsSetter",
"Generic",
"Set/merge caps on stream",
"Mark Nauwelaerts <mnauw@users.sourceforge.net>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_caps_setter_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_caps_setter_src_template));
}
#define gst_caps_setter_parent_class parent_class
G_DEFINE_TYPE (GstCapsSetter, gst_caps_setter, GST_TYPE_BASE_TRANSFORM);
static void
gst_caps_setter_class_init (GstCapsSetterClass * g_class)
{
GObjectClass *gobject_class = (GObjectClass *) g_class;
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
GstBaseTransformClass *trans_class = (GstBaseTransformClass *) g_class;
GST_DEBUG_CATEGORY_INIT (caps_setter_debug, "capssetter", 0, "capssetter");
@ -156,6 +141,16 @@ gst_caps_setter_class_init (GstCapsSetterClass * g_class)
"Drop fields of incoming caps", DEFAULT_REPLACE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_set_details_simple (element_class, "CapsSetter",
"Generic",
"Set/merge caps on stream",
"Mark Nauwelaerts <mnauw@users.sourceforge.net>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_caps_setter_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_caps_setter_src_template));
trans_class->transform_size =
GST_DEBUG_FUNCPTR (gst_caps_setter_transform_size);
trans_class->transform_caps =
@ -165,7 +160,7 @@ gst_caps_setter_class_init (GstCapsSetterClass * g_class)
}
static void
gst_caps_setter_init (GstCapsSetter * filter, GstCapsSetterClass * g_class)
gst_caps_setter_init (GstCapsSetter * filter)
{
filter->caps = gst_caps_new_any ();
filter->join = DEFAULT_JOIN;

View file

@ -60,32 +60,18 @@ static void gst_navseek_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
GType gst_navseek_get_type (void);
GST_BOILERPLATE (GstNavSeek, gst_navseek, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM);
static void
gst_navseek_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 (&navseek_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&navseek_src_template));
gst_element_class_set_details_simple (element_class,
"Seek based on left-right arrows", "Filter/Video",
"Seek based on navigation keys left-right",
"Jan Schmidt <thaytan@mad.scientist.com>");
}
#define gst_navseek_parent_class parent_class
G_DEFINE_TYPE (GstNavSeek, gst_navseek, GST_TYPE_BASE_TRANSFORM);
static void
gst_navseek_class_init (GstNavSeekClass * klass)
{
GstBaseTransformClass *gstbasetrans_class;
GstElementClass *element_class;
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
element_class = GST_ELEMENT_CLASS (klass);
gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass);
gobject_class->set_property = gst_navseek_set_property;
@ -96,6 +82,16 @@ gst_navseek_class_init (GstNavSeekClass * klass)
"Time in seconds to seek by", 0.0, G_MAXDOUBLE, 5.0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&navseek_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&navseek_src_template));
gst_element_class_set_details_simple (element_class,
"Seek based on left-right arrows", "Filter/Video",
"Seek based on navigation keys left-right",
"Jan Schmidt <thaytan@mad.scientist.com>");
gstbasetrans_class->event = GST_DEBUG_FUNCPTR (gst_navseek_event);
gstbasetrans_class->transform_ip =
GST_DEBUG_FUNCPTR (gst_navseek_transform_ip);
@ -104,7 +100,7 @@ gst_navseek_class_init (GstNavSeekClass * klass)
}
static void
gst_navseek_init (GstNavSeek * navseek, GstNavSeekClass * g_class)
gst_navseek_init (GstNavSeek * navseek)
{
gst_pad_set_event_function (GST_BASE_TRANSFORM (navseek)->srcpad,
GST_DEBUG_FUNCPTR (gst_navseek_handle_src_event));

View file

@ -55,38 +55,11 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
static void gst_push_file_src_uri_handler_init (gpointer g_iface,
gpointer iface_data);
static void gst_file_push_src_add_uri_handler (GType type);
GST_BOILERPLATE_FULL (GstPushFileSrc, gst_push_file_src, GstBin, GST_TYPE_BIN,
gst_file_push_src_add_uri_handler);
static void
gst_file_push_src_add_uri_handler (GType type)
{
static const GInterfaceInfo info = {
gst_push_file_src_uri_handler_init,
NULL,
NULL
};
g_type_add_interface_static (type, GST_TYPE_URI_HANDLER, &info);
GST_DEBUG_CATEGORY_INIT (pushfilesrc_debug, "pushfilesrc", 0,
"pushfilesrc element");
}
static void
gst_push_file_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, "Push File Source",
"Testing",
"Implements pushfile:// URI-handler for push-based file access",
"Tim-Philipp Müller <tim centricular net>");
}
#define gst_push_file_src_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstPushFileSrc, gst_push_file_src, GST_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
gst_push_file_src_uri_handler_init));
static void
gst_push_file_src_dispose (GObject * obj)
@ -109,10 +82,23 @@ static void
gst_push_file_src_class_init (GstPushFileSrcClass * g_class)
{
GObjectClass *gobject_class;
GstElementClass *element_class;
gobject_class = G_OBJECT_CLASS (g_class);
element_class = GST_ELEMENT_CLASS (g_class);
GST_DEBUG_CATEGORY_INIT (pushfilesrc_debug, "pushfilesrc", 0,
"pushfilesrc element");
gobject_class->dispose = gst_push_file_src_dispose;
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_set_details_simple (element_class, "Push File Source",
"Testing",
"Implements pushfile:// URI-handler for push-based file access",
"Tim-Philipp Müller <tim centricular net>");
}
static gboolean
@ -122,7 +108,7 @@ gst_push_file_src_ghostpad_checkgetrange (GstPad * pad)
}
static void
gst_push_file_src_init (GstPushFileSrc * src, GstPushFileSrcClass * g_class)
gst_push_file_src_init (GstPushFileSrc * src)
{
src->filesrc = gst_element_factory_make ("filesrc", "real-filesrc");
if (src->filesrc) {

View file

@ -62,11 +62,8 @@ enum
};
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_tag_inject_debug, "taginject", 0, "tag inject element");
GST_BOILERPLATE_FULL (GstTagInject, gst_tag_inject, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM, DEBUG_INIT);
#define gst_tag_inject_parent_class parent_class
G_DEFINE_TYPE (GstTagInject, gst_tag_inject, GST_TYPE_BASE_TRANSFORM);
static void gst_tag_inject_finalize (GObject * object);
static void gst_tag_inject_set_property (GObject * object, guint prop_id,
@ -79,20 +76,6 @@ static GstFlowReturn gst_tag_inject_transform_ip (GstBaseTransform * trans,
static gboolean gst_tag_inject_start (GstBaseTransform * trans);
static void
gst_tag_inject_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details_simple (gstelement_class,
"TagInject",
"Generic", "inject metadata tags", "Stefan Kost <ensonic@users.sf.net>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
}
static void
gst_tag_inject_finalize (GObject * object)
{
@ -110,11 +93,16 @@ static void
gst_tag_inject_class_init (GstTagInjectClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseTransformClass *gstbasetrans_class;
gobject_class = G_OBJECT_CLASS (klass);
gstelement_class = GST_ELEMENT_CLASS (klass);
gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass);
GST_DEBUG_CATEGORY_INIT (gst_tag_inject_debug, "taginject", 0,
"tag inject element");
gobject_class->set_property = gst_tag_inject_set_property;
gobject_class->get_property = gst_tag_inject_get_property;
@ -125,6 +113,14 @@ gst_tag_inject_class_init (GstTagInjectClass * klass)
gobject_class->finalize = gst_tag_inject_finalize;
gst_element_class_set_details_simple (gstelement_class,
"TagInject",
"Generic", "inject metadata tags", "Stefan Kost <ensonic@users.sf.net>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gstbasetrans_class->transform_ip =
GST_DEBUG_FUNCPTR (gst_tag_inject_transform_ip);
@ -132,7 +128,7 @@ gst_tag_inject_class_init (GstTagInjectClass * klass)
}
static void
gst_tag_inject_init (GstTagInject * self, GstTagInjectClass * g_class)
gst_tag_inject_init (GstTagInject * self)
{
self->tags = NULL;
}

View file

@ -115,24 +115,8 @@ static GstFlowReturn gst_progress_report_transform_ip (GstBaseTransform * trans,
static gboolean gst_progress_report_start (GstBaseTransform * trans);
static gboolean gst_progress_report_stop (GstBaseTransform * trans);
GST_BOILERPLATE (GstProgressReport, gst_progress_report, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM);
static void
gst_progress_report_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 (&progress_report_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&progress_report_src_template));
gst_element_class_set_details_simple (element_class, "Progress report",
"Testing",
"Periodically query and report on processing progress",
"Jan Schmidt <thaytan@mad.scientist.com>");
}
#define gst_progress_report_parent_class parent_class
G_DEFINE_TYPE (GstProgressReport, gst_progress_report, GST_TYPE_BASE_TRANSFORM);
static void
gst_progress_report_finalize (GObject * obj)
@ -149,9 +133,11 @@ static void
gst_progress_report_class_init (GstProgressReportClass * g_class)
{
GstBaseTransformClass *gstbasetrans_class;
GstElementClass *element_class;
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (g_class);
element_class = GST_ELEMENT_CLASS (g_class);
gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (g_class);
gobject_class->finalize = gst_progress_report_finalize;
@ -179,6 +165,16 @@ gst_progress_report_class_init (GstProgressReportClass * g_class)
"Format to use for the querying", DEFAULT_FORMAT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&progress_report_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&progress_report_src_template));
gst_element_class_set_details_simple (element_class, "Progress report",
"Testing",
"Periodically query and report on processing progress",
"Jan Schmidt <thaytan@mad.scientist.com>");
gstbasetrans_class->event = GST_DEBUG_FUNCPTR (gst_progress_report_event);
gstbasetrans_class->transform_ip =
GST_DEBUG_FUNCPTR (gst_progress_report_transform_ip);
@ -187,8 +183,7 @@ gst_progress_report_class_init (GstProgressReportClass * g_class)
}
static void
gst_progress_report_init (GstProgressReport * report,
GstProgressReportClass * g_class)
gst_progress_report_init (GstProgressReport * report)
{
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (report), TRUE);

View file

@ -92,19 +92,22 @@ static void gst_rnd_buffer_size_loop (GstRndBufferSize * self);
static GstStateChangeReturn gst_rnd_buffer_size_change_state (GstElement *
element, GstStateChange transition);
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_rnd_buffer_size_debug, "rndbuffersize", 0, \
"rndbuffersize element");
GType gst_rnd_buffer_size_get_type (void);
GST_BOILERPLATE_FULL (GstRndBufferSize, gst_rnd_buffer_size, GstElement,
GST_TYPE_ELEMENT, DEBUG_INIT);
#define gst_rnd_buffer_size_parent_class parent_class
G_DEFINE_TYPE (GstRndBufferSize, gst_rnd_buffer_size, GST_TYPE_ELEMENT);
static void
gst_rnd_buffer_size_base_init (gpointer g_class)
gst_rnd_buffer_size_class_init (GstRndBufferSizeClass * klass)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
GST_DEBUG_CATEGORY_INIT (gst_rnd_buffer_size_debug, "rndbuffersize", 0,
"rndbuffersize element");
gobject_class->set_property = gst_rnd_buffer_size_set_property;
gobject_class->get_property = gst_rnd_buffer_size_get_property;
gobject_class->finalize = gst_rnd_buffer_size_finalize;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sink_template));
@ -114,18 +117,6 @@ gst_rnd_buffer_size_base_init (gpointer g_class)
gst_element_class_set_details_simple (gstelement_class, "Random buffer size",
"Testing", "pull random sized buffers",
"Stefan Kost <stefan.kost@nokia.com>");
}
static void
gst_rnd_buffer_size_class_init (GstRndBufferSizeClass * klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
gobject_class->set_property = gst_rnd_buffer_size_set_property;
gobject_class->get_property = gst_rnd_buffer_size_get_property;
gobject_class->finalize = gst_rnd_buffer_size_finalize;
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_change_state);
@ -149,8 +140,7 @@ gst_rnd_buffer_size_class_init (GstRndBufferSizeClass * klass)
}
static void
gst_rnd_buffer_size_init (GstRndBufferSize * self,
GstRndBufferSizeClass * g_class)
gst_rnd_buffer_size_init (GstRndBufferSize * self)
{
self->sinkpad = gst_pad_new_from_static_template (&sink_template, "sink");
gst_pad_set_activate_function (self->sinkpad,

View file

@ -80,34 +80,22 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
#define DEBUG_INIT(bla) \
GST_DEBUG_CATEGORY_INIT (gst_test_debug, "testsink", 0, \
"debugging category for testsink element");
GType gst_test_get_type (void);
GST_BOILERPLATE_FULL (GstTest, gst_test, GstBaseSink, GST_TYPE_BASE_SINK,
DEBUG_INIT);
#define gst_test_parent_class parent_class
G_DEFINE_TYPE (GstTest, gst_test, GST_TYPE_BASE_SINK);
static void
gst_test_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_set_details_simple (gstelement_class, "Test plugin",
"Testing", "perform a number of tests", "Benjamin Otte <otte@gnome>");
}
static void
gst_test_class_init (GstTestClass * klass)
{
GstBaseSinkClass *basesink_class = GST_BASE_SINK_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
guint i;
GST_DEBUG_CATEGORY_INIT (gst_test_debug, "testsink", 0,
"debugging category for testsink element");
object_class->set_property = gst_test_set_property;
object_class->get_property = gst_test_get_property;
@ -124,6 +112,12 @@ gst_test_class_init (GstTestClass * klass)
g_object_class_install_property (object_class, 2 * i + 2, spec);
}
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_set_details_simple (gstelement_class, "Test plugin",
"Testing", "perform a number of tests", "Benjamin Otte <otte@gnome>");
basesink_class->render = GST_DEBUG_FUNCPTR (gst_test_render_buffer);
basesink_class->event = GST_DEBUG_FUNCPTR (gst_test_sink_event);
basesink_class->start = GST_DEBUG_FUNCPTR (gst_test_start);
@ -131,7 +125,7 @@ gst_test_class_init (GstTestClass * klass)
}
static void
gst_test_init (GstTest * test, GstTestClass * g_class)
gst_test_init (GstTest * test)
{
GstTestClass *klass;
guint i;