Commit 99fc3296 authored by Andy Wingo's avatar Andy Wingo
Browse files

Updates for two-arg init from GST_BOILERPLATE.

Original commit message from CVS:
2005-08-28  Andy Wingo  <wingo@pobox.com>

* Updates for two-arg init from GST_BOILERPLATE.

* ext/ladspa/gstsignalprocessor.c (gst_signal_processor_init): Use
the second arg for the class, because G_OBJECT_GET_CLASS (self)
returns the wrong thing.
(gst_signal_processor_add_pad_from_template): Make pads of the
right type.

* ext/ladspa/gstladspa.c (gst_ladspa_class_get_param_spec): Make
writable param specs G_PARAM_CONSTRUCT so default values work.
(gst_ladspa_init): Use the second arg for the class.
parent b5c9e103
2005-08-28 Andy Wingo <wingo@pobox.com>
* Updates for two-arg init from GST_BOILERPLATE.
* ext/ladspa/gstsignalprocessor.c (gst_signal_processor_init): Use
the second arg for the class, because G_OBJECT_GET_CLASS (self)
returns the wrong thing.
(gst_signal_processor_add_pad_from_template): Make pads of the
right type.
* ext/ladspa/gstladspa.c (gst_ladspa_class_get_param_spec): Make
writable param specs G_PARAM_CONSTRUCT so default values work.
(gst_ladspa_init): Use the second arg for the class.
2005-08-26 Andy Wingo <wingo@pobox.com>
 
* ext/ladspa/gstladspa.c:
......
......@@ -167,7 +167,7 @@ gst_dvdec_class_init (GstDVDecClass * klass)
}
static void
gst_dvdec_init (GstDVDec * dvdec)
gst_dvdec_init (GstDVDec * dvdec, GstDVDecClass * g_class)
{
dvdec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get (&sink_temp),
......
......@@ -162,7 +162,7 @@ gst_dvdemux_class_init (GstDVDemuxClass * klass)
}
static void
gst_dvdemux_init (GstDVDemux * dvdemux)
gst_dvdemux_init (GstDVDemux * dvdemux, GstDVDemuxClass * g_class)
{
gint i;
......
......@@ -84,7 +84,8 @@ gst_gconf_audio_sink_reset (GstGConfAudioSink * sink)
}
static void
gst_gconf_audio_sink_init (GstGConfAudioSink * sink)
gst_gconf_audio_sink_init (GstGConfAudioSink * sink,
GstGConfAudioSinkClass * g_class)
{
sink->pad = gst_ghost_pad_new_notarget ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (sink), sink->pad);
......
......@@ -84,7 +84,8 @@ gst_gconf_video_sink_reset (GstGConfVideoSink * sink)
}
static void
gst_gconf_video_sink_init (GstGConfVideoSink * sink)
gst_gconf_video_sink_init (GstGConfVideoSink * sink,
GstGConfVideoSinkClass * g_class)
{
sink->pad = gst_ghost_pad_new_notarget ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (sink), sink->pad);
......
......@@ -70,6 +70,8 @@ gst_ladspa_base_init (gpointer g_class)
LADSPA_Descriptor *desc;
gint j, sinkcount, srccount;
GST_DEBUG ("base_init %p", g_class);
desc = g_hash_table_lookup (ladspa_descriptors,
GINT_TO_POINTER (G_TYPE_FROM_CLASS (klass)));
if (!desc)
......@@ -186,7 +188,7 @@ gst_ladspa_class_get_param_spec (GstLADSPAClass * klass, gint portnum)
name = gst_ladspa_class_get_param_name (klass, portnum);
perms = G_PARAM_READABLE;
if (LADSPA_IS_PORT_INPUT (desc->PortDescriptors[portnum]))
perms |= G_PARAM_WRITABLE;
perms |= G_PARAM_WRITABLE | G_PARAM_CONSTRUCT;
/* short name for hint descriptor */
hintdesc = desc->PortRangeHints[portnum].HintDescriptor;
......@@ -283,6 +285,8 @@ gst_ladspa_class_init (GstLADSPAClass * klass)
LADSPA_Descriptor *desc;
gint i, control_in_count, control_out_count;
GST_DEBUG ("class_init %p", klass);
gobject_class = (GObjectClass *) klass;
gobject_class->set_property = gst_ladspa_set_property;
gobject_class->get_property = gst_ladspa_get_property;
......@@ -349,12 +353,11 @@ gst_ladspa_class_init (GstLADSPAClass * klass)
}
static void
gst_ladspa_init (GstLADSPA * ladspa)
gst_ladspa_init (GstLADSPA * ladspa, GstLADSPAClass * klass)
{
/* whoopee, nothing to do */
ladspa->descriptor =
((GstLADSPAClass *) G_OBJECT_GET_CLASS (ladspa))->descriptor;
ladspa->descriptor = klass->descriptor;
ladspa->activated = FALSE;
ladspa->inplace_broken =
LADSPA_IS_INPLACE_BROKEN (ladspa->descriptor->Properties);
......
......@@ -186,8 +186,9 @@ gst_signal_processor_add_pad_from_template (GstSignalProcessor * self,
{
GstPad *new;
new = g_object_new (GST_TYPE_PAD, "name", GST_OBJECT_NAME (templ),
"direction", templ->direction, "template", templ, NULL);
new = g_object_new (GST_TYPE_SIGNAL_PROCESSOR_PAD,
"name", GST_OBJECT_NAME (templ), "direction", templ->direction,
"template", templ, NULL);
GST_SIGNAL_PROCESSOR_PAD (new)->index =
GST_SIGNAL_PROCESSOR_PAD_TEMPLATE (templ)->index;
......@@ -212,17 +213,13 @@ gst_signal_processor_add_pad_from_template (GstSignalProcessor * self,
}
static void
gst_signal_processor_init (GstSignalProcessor * self)
gst_signal_processor_init (GstSignalProcessor * self,
GstSignalProcessorClass * klass)
{
GstSignalProcessorClass *klass;
GList *templates;
klass = GST_SIGNAL_PROCESSOR_GET_CLASS (self);
GST_DEBUG ("gst_signal_processor_init");
templates =
gst_element_class_get_pad_template_list (GST_ELEMENT_GET_CLASS (self));
gst_element_class_get_pad_template_list (GST_ELEMENT_CLASS (klass));
while (templates) {
GstPadTemplate *templ = GST_PAD_TEMPLATE (templates->data);
......
......@@ -174,7 +174,7 @@ gst_pngenc_setcaps (GstPad * pad, GstCaps * caps)
}
static void
gst_pngenc_init (GstPngEnc * pngenc)
gst_pngenc_init (GstPngEnc * pngenc, GstPngEncClass * g_class)
{
/* sinkpad */
pngenc->sinkpad = gst_pad_new_from_template
......
......@@ -124,7 +124,7 @@ speex_get_query_types (GstPad * pad)
}
static void
gst_speex_dec_init (GstSpeexDec * dec)
gst_speex_dec_init (GstSpeexDec * dec, GstSpeexDecClass * g_class)
{
dec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get
......
......@@ -83,7 +83,8 @@ gst_auto_audio_sink_reset (GstAutoAudioSink * sink)
}
static void
gst_auto_audio_sink_init (GstAutoAudioSink * sink)
gst_auto_audio_sink_init (GstAutoAudioSink * sink,
GstAutoAudioSinkClass * g_class)
{
sink->pad = gst_ghost_pad_new_notarget ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (sink), sink->pad);
......
......@@ -83,7 +83,8 @@ gst_auto_video_sink_reset (GstAutoVideoSink * sink)
}
static void
gst_auto_video_sink_init (GstAutoVideoSink * sink)
gst_auto_video_sink_init (GstAutoVideoSink * sink,
GstAutoVideoSinkClass * g_class)
{
sink->pad = gst_ghost_pad_new_notarget ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (sink), sink->pad);
......
......@@ -253,7 +253,7 @@ gst_break_my_data_change_state (GstElement * element)
}
gboolean
gst_break_my_data_plugin_init (GstPlugin * plugin)
gst_break_my_data_plugin_init (GstPlugin * plugin, GstPluginClass * g_class)
{
if (!gst_element_register (plugin, "breakmydata", GST_RANK_NONE,
GST_TYPE_BREAK_MY_DATA))
......
......@@ -128,7 +128,8 @@ gst_progressreport_class_init (GstProgressReportClass * g_class)
}
static void
gst_progressreport_init (GstProgressReport * instance)
gst_progressreport_init (GstProgressReport * instance,
GstProgressReportClass * g_class)
{
GstProgressReport *progressreport = GST_PROGRESSREPORT (instance);
......@@ -274,7 +275,7 @@ gst_progressreport_chain (GstPad * pad, GstData * _data)
}
gboolean
gst_progressreport_plugin_init (GstPlugin * plugin)
gst_progressreport_plugin_init (GstPlugin * plugin, GstPluginClass * g_class)
{
return gst_element_register (plugin, "progressreport", GST_RANK_NONE,
GST_TYPE_PROGRESSREPORT);
......
......@@ -105,7 +105,7 @@ gst_test_class_init (GstTestClass * klass)
}
static void
gst_test_init (GstTest * test)
gst_test_init (GstTest * test, GstTestClass * g_class)
{
GstTestClass *klass;
guint i;
......@@ -249,7 +249,7 @@ gst_test_get_property (GObject * object, guint prop_id, GValue * value,
}
gboolean
gst_test_plugin_init (GstPlugin * plugin)
gst_test_plugin_init (GstPlugin * plugin, GstPluginClass * g_class)
{
if (!gst_element_register (plugin, "testsink", GST_RANK_NONE, GST_TYPE_TEST))
return FALSE;
......
......@@ -134,7 +134,7 @@ gst_fdsrc_class_init (GstFdSrcClass * klass)
}
static void
gst_fdsrc_init (GstFdSrc * fdsrc)
gst_fdsrc_init (GstFdSrc * fdsrc, GstFdSrcClass * g_class)
{
// TODO set live only if it's actually a live source
gst_base_src_set_live (GST_BASE_SRC (fdsrc), TRUE);
......
......@@ -135,7 +135,7 @@ gst_level_class_init (GstLevelClass * klass)
}
static void
gst_level_init (GstLevel * filter)
gst_level_init (GstLevel * filter, GstLevelClass * g_class)
{
filter->CS = NULL;
filter->peak = NULL;
......
......@@ -152,7 +152,8 @@ gst_multipart_demux_class_init (GstMultipartDemuxClass * klass)
}
static void
gst_multipart_demux_init (GstMultipartDemux * multipart)
gst_multipart_demux_init (GstMultipartDemux * multipart,
GstMultipartDemuxClass * g_class)
{
/* create the sink pad */
multipart->sinkpad =
......@@ -368,7 +369,7 @@ gst_multipart_demux_change_state (GstElement * element)
}
gboolean
gst_multipart_demux_plugin_init (GstPlugin * plugin)
gst_multipart_demux_plugin_init (GstPlugin * plugin, GstPluginClass * g_class)
{
GST_DEBUG_CATEGORY_INIT (gst_multipart_demux_debug,
"multipartdemux", 0, "multipart demuxer");
......
......@@ -161,7 +161,7 @@ gst_aggregator_class_init (GstAggregatorClass * klass)
}
static void
gst_aggregator_init (GstAggregator * aggregator)
gst_aggregator_init (GstAggregator * aggregator, GstAggregatorClass * g_class)
{
aggregator->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate),
......
......@@ -97,7 +97,7 @@ gst_fdsink_class_init (GstFdSinkClass * klass)
}
static void
gst_fdsink_init (GstFdSink * fdsink)
gst_fdsink_init (GstFdSink * fdsink, GstFdSinkClass * g_class)
{
fdsink->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate),
......
......@@ -125,7 +125,8 @@ gst_multifilesrc_class_init (GstMultiFileSrcClass * klass)
}
static void
gst_multifilesrc_init (GstMultiFileSrc * multifilesrc)
gst_multifilesrc_init (GstMultiFileSrc * multifilesrc,
GstMultiFileSrcClass * g_class)
{
/* GST_FLAG_SET (filesrc, GST_SRC_); */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment