From 6c1bc99dee350b9e7bdb51869df6c70afc26a622 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Mon, 26 Jul 2004 10:12:00 +0000 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ gst/ffmpegcolorspace/gstffmpegcolorspace.c | 9 +++++++++ gst/tcp/gsttcpclientsrc.c | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 76e975300b..29671876f8 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 ee3fbb7a1f..486f3424cf 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 e66f723f64..21574b7824 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;