From 86db595f563c3b5da4427055f4afc439c12036b5 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 6 Mar 2004 00:42:20 +0000 Subject: ext/faad/gstfaad.c: Fix negotiation. Original commit message from CVS: * ext/faad/gstfaad.c: (gst_faad_init), (gst_faad_srcgetcaps), (gst_faad_chain): Fix negotiation. * ext/librfb/gstrfbsrc.c: (gst_rfbsrc_handle_src_event): Add key and button events. * gst-libs/gst/floatcast/floatcast.h: Fix a minor bug in this dung heap of code. * gst-libs/gst/gconf/gstreamer-gconf-uninstalled.pc.in: gstgconf depends on gconf * gst-libs/gst/gconf/gstreamer-gconf.pc.in: same * gst-libs/gst/play/play.c: (gst_play_pipeline_setup), (gst_play_video_fixate), (gst_play_audio_fixate): Add a fixate function to encourage better negotiation, particularly between audioconvert and osssink. * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain): * gst/qtdemux/qtdemux.c: (qtdemux_parse_trak): Make some debugging more important. * gst/typefind/gsttypefindfunctions.c: Fix mistake in flash typefinding. * gst/vbidec/vbiscreen.c: Add glib header * pkgconfig/gstreamer-play.pc.in: Depends on gst-interfaces. --- ext/faad/gstfaad.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'ext/faad/gstfaad.c') diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c index bb804cb2..6e272974 100644 --- a/ext/faad/gstfaad.c +++ b/ext/faad/gstfaad.c @@ -148,11 +148,7 @@ gst_faad_init (GstFaad *faad) gst_element_add_pad (GST_ELEMENT (faad), faad->srcpad); gst_pad_set_link_function (faad->srcpad, gst_faad_srcconnect); - /* This was originally intended as a getcaps() function, but - * in the end, we needed a srcconnect() function, so this is - * not really useful. However, srcconnect() uses it, so it is - * still there... */ - /*gst_pad_set_getcaps_function (faad->srcpad, gst_faad_srcgetcaps);*/ + gst_pad_set_getcaps_function (faad->srcpad, gst_faad_srcgetcaps); } static GstPadLinkReturn @@ -244,7 +240,7 @@ gst_faad_srcgetcaps (GstPad *pad) return caps; } - return GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad)); + return gst_caps_copy (GST_PAD_TEMPLATE_CAPS (GST_PAD_PAD_TEMPLATE (pad))); } static GstPadLinkReturn @@ -357,12 +353,16 @@ gst_faad_chain (GstPad *pad, &samplerate, &channels); faad->samplerate = samplerate; faad->channels = channels; + + gst_pad_renegotiate (faad->srcpad); +#if 0 if (gst_faad_srcconnect (faad->srcpad, gst_pad_get_allowed_caps (faad->srcpad)) <= 0) { GST_ELEMENT_ERROR (faad, CORE, NEGOTIATION, (NULL), (NULL)); gst_buffer_unref (buf); return; } +#endif } out = faacDecDecode (faad->handle, &info, @@ -379,12 +379,19 @@ gst_faad_chain (GstPad *pad, info.channels != faad->channels) { faad->samplerate = info.samplerate; faad->channels = info.channels; + gst_pad_renegotiate (faad->srcpad); +#if 0 if (gst_faad_srcconnect (faad->srcpad, gst_pad_get_allowed_caps (faad->srcpad)) <= 0) { GST_ELEMENT_ERROR (faad, CORE, NEGOTIATION, (NULL), (NULL)); gst_buffer_unref (buf); return; } +#endif + } + + if (info.samples == 0) { + return; } /* FIXME: did it handle the whole buffer? */ -- cgit v1.2.1