From: Johan Dahlin Date: Mon, 26 Jul 2004 10:12:00 +0000 (+0000) Subject: gst/tcp/gsttcpclientsrc.c (gst_tcpclientsrc_get): Make sure that the pad is negotiated. X-Git-Tag: BRANCH-GSTREAMER-0_8-ROOT~814 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c1bc99dee350b9e7bdb51869df6c70afc26a622;p=platform%2Fupstream%2Fgst-plugins-base.git gst/tcp/gsttcpclientsrc.c (gst_tcpclientsrc_get): Make sure that the pad is negotiated. Original commit message from CVS: * gst/tcp/gsttcpclientsrc.c (gst_tcpclientsrc_get): Make sure that the pad is negotiated. * gst/ffmpegcolorspace/gstffmpegcolorspace.c (gst_ffmpegcolorspace_chain): Ditto --- diff --git a/ChangeLog b/ChangeLog index 76e9753..2967187 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-07-26 Johan Dahlin + + * gst/tcp/gsttcpclientsrc.c (gst_tcpclientsrc_get): Make sure that + the pad is negotiated. + + * gst/ffmpegcolorspace/gstffmpegcolorspace.c (gst_ffmpegcolorspace_chain): Ditto + 2004-07-26 Steve Lhomme * gst-libs/gst/colorbalance/colorbalance.vcproj: diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index ee3fbb7..486f342 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -192,6 +192,7 @@ gst_ffmpegcolorspace_pad_link (GstPad * pad, const GstCaps * caps) return GST_PAD_LINK_REFUSED; } + /* set the size on the otherpad */ othercaps = gst_pad_get_negotiated_caps (otherpad); if (othercaps) { @@ -309,6 +310,14 @@ gst_ffmpegcolorspace_chain (GstPad * pad, GstData * data) return; } + if (!gst_pad_is_negotiated (space->srcpad)) { + if (GST_PAD_LINK_FAILED (gst_pad_renegotiate (space->srcpad))) { + GST_ELEMENT_ERROR (space, CORE, NEGOTIATION, (NULL), GST_ERROR_SYSTEM); + gst_buffer_unref (inbuf); + return; + } + } + if (space->from_pixfmt == PIX_FMT_NB || space->to_pixfmt == PIX_FMT_NB) { GST_ELEMENT_ERROR (space, CORE, NOT_IMPLEMENTED, (NULL), ("attempting to convert colorspaces between unknown formats")); diff --git a/gst/tcp/gsttcpclientsrc.c b/gst/tcp/gsttcpclientsrc.c index e66f723..21574b7 100644 --- a/gst/tcp/gsttcpclientsrc.c +++ b/gst/tcp/gsttcpclientsrc.c @@ -218,6 +218,15 @@ gst_tcpclientsrc_get (GstPad * pad) src = GST_TCPCLIENTSRC (GST_OBJECT_PARENT (pad)); g_return_val_if_fail (GST_FLAG_IS_SET (src, GST_TCPCLIENTSRC_OPEN), NULL); + /* try to negotiate here */ + if (!gst_pad_is_negotiated (pad)) { + if (GST_PAD_LINK_FAILED (gst_pad_renegotiate (pad))) { + GST_ELEMENT_ERROR (src, CORE, NEGOTIATION, (NULL), GST_ERROR_SYSTEM); + gst_buffer_unref (buf); + return GST_DATA (gst_event_new (GST_EVENT_EOS)); + } + } + /* if we have a left over buffer after a discont, return that */ if (src->buffer_after_discont) { buf = src->buffer_after_discont;