diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2002-03-30 17:06:26 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2002-03-30 17:06:26 +0000 |
commit | 13d9e8d35227337a04b0cd24a0dda7c0c3961289 (patch) | |
tree | 9a4e6fa918604e74a46251b50d2f26d7c0d2d024 /ext | |
parent | c5e4b06ff518ca83a403c175e22a802ee73714f1 (diff) |
Changed to the new props API
Original commit message from CVS:
Changed to the new props API
Other small tuff.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/aalib/gstaasink.c | 4 | ||||
-rw-r--r-- | ext/dv/gstdvdec.c | 6 | ||||
-rw-r--r-- | ext/esd/esdsink.c | 6 | ||||
-rw-r--r-- | ext/flac/gstflacenc.c | 6 | ||||
-rw-r--r-- | ext/ladspa/gstladspa.c | 22 | ||||
-rw-r--r-- | ext/mikmod/gstmikmod.c | 23 |
6 files changed, 40 insertions, 27 deletions
diff --git a/ext/aalib/gstaasink.c b/ext/aalib/gstaasink.c index b19623e9b..2a3f75473 100644 --- a/ext/aalib/gstaasink.c +++ b/ext/aalib/gstaasink.c @@ -242,8 +242,8 @@ gst_aasink_sinkconnect (GstPad *pad, GstCaps *caps) if (!GST_CAPS_IS_FIXED (caps)) return GST_PAD_CONNECT_DELAYED; - aasink->width = gst_caps_get_int (caps, "width"); - aasink->height = gst_caps_get_int (caps, "height"); + gst_caps_get_int (caps, "width", &aasink->width); + gst_caps_get_int (caps, "height", &aasink->height); print_format = GULONG_FROM_LE (aasink->format); diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index 57a7bacab..bf52497e1 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -317,8 +317,12 @@ gst_dvdec_loop (GstElement *element) /* try each format */ if (gst_pad_try_set_caps (dvdec->videosrcpad, to_try)) { + guint32 fourcc; + /* it worked, try to find what it was again */ - if (gst_caps_get_fourcc_int (to_try, "format") == GST_STR_FOURCC ("RGB ")) { + gst_caps_get_fourcc_int (to_try, "format", &fourcc); + + if (fourcc == GST_STR_FOURCC ("RGB ")) { dvdec->space = e_dv_color_rgb; dvdec->bpp = 3; } diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c index b22e69d4c..63b4a10d7 100644 --- a/ext/esd/esdsink.c +++ b/ext/esd/esdsink.c @@ -227,9 +227,9 @@ gst_esdsink_sinkconnect (GstPad *pad, GstCaps *caps) if (!GST_CAPS_IS_FIXED (caps)) return GST_PAD_CONNECT_DELAYED; - esdsink->depth = gst_caps_get_int (caps, "depth"); - esdsink->channels = gst_caps_get_int (caps, "channels"); - esdsink->frequency = gst_caps_get_int (caps, "rate"); + gst_caps_get_int (caps, "depth", &esdsink->depth); + gst_caps_get_int (caps, "channels", &esdsink->channels); + gst_caps_get_int (caps, "rate", &esdsink->frequency); if (gst_esdsink_sync_parms (esdsink)) return GST_PAD_CONNECT_OK; diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index a1f06b282..ac8759b0a 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -110,9 +110,9 @@ gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps) if (!GST_CAPS_IS_FIXED (caps)) return GST_PAD_CONNECT_DELAYED; - flacenc->channels = gst_caps_get_int (caps, "channels"); - flacenc->depth = gst_caps_get_int (caps, "depth"); - flacenc->sample_rate = gst_caps_get_int (caps, "rate"); + gst_caps_get_int (caps, "channels", &flacenc->channels); + gst_caps_get_int (caps, "depth", &flacenc->depth); + gst_caps_get_int (caps, "rate", &flacenc->sample_rate); FLAC__stream_encoder_set_bits_per_sample (flacenc->encoder, flacenc->depth); FLAC__stream_encoder_set_sample_rate (flacenc->encoder, flacenc->sample_rate); diff --git a/ext/ladspa/gstladspa.c b/ext/ladspa/gstladspa.c index 69eeed53b..bb49547bd 100644 --- a/ext/ladspa/gstladspa.c +++ b/ext/ladspa/gstladspa.c @@ -109,7 +109,7 @@ gst_ladspa_get_bufferpool (GstPad *pad) { gint i; GstBufferPool *bp; - GstLADSPA *ladspa = gst_pad_get_parent (pad); + GstLADSPA *ladspa = (GstLADSPA *) gst_pad_get_parent (pad); GstLADSPAClass *oclass = (GstLADSPAClass *) (G_OBJECT_GET_CLASS (ladspa)); if (oclass->numsrcpads > 0) @@ -394,7 +394,7 @@ gst_ladspa_init (GstLADSPA *ladspa) } ladspa->loopbased = TRUE; - gst_element_set_loop_function (ladspa, gst_ladspa_loop); + gst_element_set_loop_function (GST_ELEMENT (ladspa), gst_ladspa_loop); } gst_ladspa_instantiate(ladspa); @@ -406,13 +406,15 @@ gst_ladspa_connect (GstPad *pad, GstCaps *caps) GstLADSPA *ladspa = (GstLADSPA *) GST_PAD_PARENT (pad); GstLADSPAClass *oclass = (GstLADSPAClass *) (G_OBJECT_GET_CLASS (ladspa)); guint i; + gint rate; g_return_val_if_fail (caps != NULL, GST_PAD_CONNECT_DELAYED); g_return_val_if_fail (pad != NULL, GST_PAD_CONNECT_DELAYED); + gst_caps_get_int (caps, "rate", &rate); /* have to instantiate ladspa plugin when samplerate changes (groan) */ - if (ladspa->samplerate != gst_caps_get_int (caps, "rate")){ - ladspa->samplerate = gst_caps_get_int (caps, "rate"); + if (ladspa->samplerate != rate){ + ladspa->samplerate = rate; if (! gst_ladspa_instantiate(ladspa)) return GST_PAD_CONNECT_REFUSED; } @@ -434,12 +436,15 @@ static GstPadConnectReturn gst_ladspa_connect_get (GstPad *pad, GstCaps *caps) { GstLADSPA *ladspa = (GstLADSPA*)GST_OBJECT_PARENT (pad); + gint rate; g_return_val_if_fail (caps != NULL, GST_PAD_CONNECT_DELAYED); g_return_val_if_fail (pad != NULL, GST_PAD_CONNECT_DELAYED); - if (ladspa->samplerate != gst_caps_get_int (caps, "rate")) { - ladspa->samplerate = gst_caps_get_int (caps, "rate"); + gst_caps_get_int (caps, "rate", &rate); + + if (ladspa->samplerate != rate) { + ladspa->samplerate = rate; if (! gst_ladspa_instantiate(ladspa)) return GST_PAD_CONNECT_REFUSED; } @@ -674,7 +679,7 @@ gst_ladspa_deactivate(GstLADSPA *ladspa) static void gst_ladspa_loop (GstElement *element) { - gint8 *raw_in, *zero_out, i, cur_buf; + gint8 *raw_in, *zero_out, i; GstBuffer **buffers_out; GstEvent *event = NULL; guint32 waiting; @@ -703,7 +708,8 @@ gst_ladspa_loop (GstElement *element) /* first get all the necessary data from the input ports */ for (i=0;i<oclass->numsinkpads;i++){ - GST_DEBUG (0, "pulling %d bytes through channel %d's bytestream", i); + GST_DEBUG (0, "pulling %d bytes through channel %d'sbytestream\n", + ladspa->buffersize * sizeof (LADSPA_Data), i); raw_in = gst_bytestream_peek_bytes (ladspa->bytestreams[i], ladspa->buffersize * sizeof (LADSPA_Data)); if (raw_in == NULL) { diff --git a/ext/mikmod/gstmikmod.c b/ext/mikmod/gstmikmod.c index 801c81649..088e4337a 100644 --- a/ext/mikmod/gstmikmod.c +++ b/ext/mikmod/gstmikmod.c @@ -47,7 +47,7 @@ enum { ARG_REVERB, ARG_SNDFXVOLUME, ARG_VOLUME, - ARG_FIXFREQ, + ARG_MIXFREQ, ARG_INTERP, ARG_REVERSE, ARG_SURROUND, @@ -226,10 +226,10 @@ gst_mikmod_class_init (GstMikModClass *klass) g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_SONGNAME, g_param_spec_string("songname","songname","songname", - "", G_PARAM_READABLE)); + NULL, G_PARAM_READABLE)); g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_MODTYPE, g_param_spec_string("modtype", "modtype", "modtype", - "", G_PARAM_READABLE )); + NULL, G_PARAM_READABLE )); g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_MUSICVOLUME, g_param_spec_int("musicvolume", "musivolume", "musicvolume", 0, 128, 128, G_PARAM_READWRITE )); @@ -245,7 +245,7 @@ gst_mikmod_class_init (GstMikModClass *klass) g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_VOLUME, g_param_spec_int("volume", "volume", "volume", 0, 128, 96, G_PARAM_READWRITE )); - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FIXFREQ, + g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_MIXFREQ, g_param_spec_enum("mixfreq", "mixfreq", "mixfreq", GST_TYPE_MIKMOD_MIXFREQ, 3,G_PARAM_READWRITE )); g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_INTERP, @@ -305,6 +305,8 @@ gst_mikmod_init (GstMikMod *filter) filter->musicvolume = 128; filter->volume = 96; filter->sndfxvolume = 128; + filter->songname = NULL; + filter->modtype = NULL; } @@ -314,7 +316,6 @@ gst_mikmod_loop (GstElement *element) GstMikMod *mikmod; GstBuffer *buffer_in; gint mode16bits; - gint first = 0; g_return_if_fail (element != NULL); g_return_if_fail (GST_IS_MIKMOD (element)); @@ -487,10 +488,12 @@ gst_mikmod_set_property (GObject *object, guint id, const GValue *value, GParamS switch (id) { case ARG_SONGNAME: - filter->songname = g_value_get_string (value); + g_free (filter->songname); + filter->songname = g_strdup (g_value_get_string (value)); break; case ARG_MODTYPE: - filter->modtype = g_value_get_string (value); + g_free (filter->modtype); + filter->modtype = g_strdup (g_value_get_string (value)); break; case ARG_MUSICVOLUME: filter->musicvolume = g_value_get_int (value); @@ -507,7 +510,7 @@ gst_mikmod_set_property (GObject *object, guint id, const GValue *value, GParamS case ARG_VOLUME: filter->volume = g_value_get_int (value); break; - case ARG_FIXFREQ: + case ARG_MIXFREQ: filter->mixfreq = g_value_get_enum (value); break; case ARG_INTERP: @@ -565,8 +568,8 @@ gst_mikmod_get_property (GObject *object, guint id, GValue *value, GParamSpec *p case ARG_VOLUME: g_value_set_int (value, filter->volume); break; - case ARG_FIXFREQ: - g_value_set_int (value, filter->mixfreq); + case ARG_MIXFREQ: + g_value_set_enum (value, filter->mixfreq); break; case ARG_INTERP: g_value_set_boolean (value, filter->interp); |