gst/tcp/gsttcpclientsrc.c (gst_tcpclientsrc_get): Make sure that the pad is negotiated.
authorJohan Dahlin <johan@gnome.org>
Mon, 26 Jul 2004 10:12:00 +0000 (10:12 +0000)
committerJohan Dahlin <johan@gnome.org>
Mon, 26 Jul 2004 10:12:00 +0000 (10:12 +0000)
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
gst/ffmpegcolorspace/gstffmpegcolorspace.c
gst/tcp/gsttcpclientsrc.c

index 76e9753..2967187 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-26  Johan Dahlin  <johan@gnome.org>
+
+       * 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  <steve.lhomme@free.fr>
 
        * gst-libs/gst/colorbalance/colorbalance.vcproj:
index ee3fbb7..486f342 100644 (file)
@@ -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"));
index e66f723..21574b7 100644 (file)
@@ -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;