gst/base/gstbasetransform.c: Treat a pad alloc with new caps the same as if we were...
authorJan Schmidt <thaytan@mad.scientist.com>
Tue, 29 Nov 2005 15:12:22 +0000 (15:12 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Tue, 29 Nov 2005 15:12:22 +0000 (15:12 +0000)
Original commit message from CVS:
* gst/base/gstbasetransform.c: (gst_base_transform_buffer_alloc):
Treat a pad alloc with new caps the same as if we were not
negotiated, in order to allow a changing upstream output
to produce a new format of data.

ChangeLog
gst/base/gstbasetransform.c
libs/gst/base/gstbasetransform.c

index 0df7606..7ff9514 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-11-29  Jan Schmidt  <thaytan@mad.scientist.com>
+
+       * gst/base/gstbasetransform.c: (gst_base_transform_buffer_alloc):
+         Treat a pad alloc with new caps the same as if we were not
+         negotiated, in order to allow a changing upstream output
+         to produce a new format of data.
+
 2005-11-29  Edward Hervey  <edward@fluendo.com>
 
        * gst/base/gstbasetransform.c: (gst_base_transform_class_init),
@@ -22,6 +29,7 @@
        * gst/gstghostpad.c: (gst_proxy_pad_get_target):
          Don't ref NULL target pad (#322751). Improve docs.
 
+>>>>>>> 1.2041
 2005-11-29  Michael Smith  <msmith@fluendo.com>
 
        * gst/gstregistryxml.c: (load_plugin):
index 7c286b5..28e4660 100644 (file)
@@ -960,10 +960,20 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
   } else {
     /* if we are configured, request a buffer with the src caps */
     GstCaps *srccaps = gst_pad_get_negotiated_caps (trans->srcpad);
+    GstCaps *sinkcaps = gst_pad_get_negotiated_caps (trans->sinkpad);
 
     if (!srccaps)
       goto not_configured;
 
+    if (sinkcaps != NULL) {
+      if (sinkcaps != caps || !gst_caps_is_equal (sinkcaps, caps)) {
+        gst_caps_unref (sinkcaps);
+        gst_caps_unref (srccaps);
+        goto not_configured;
+      }
+      gst_caps_unref (sinkcaps);
+    }
+
     GST_DEBUG_OBJECT (trans, "calling transform_size");
     if (!gst_base_transform_transform_size (trans,
             GST_PAD_DIRECTION (pad), caps, size, srccaps, &new_size)) {
index 7c286b5..28e4660 100644 (file)
@@ -960,10 +960,20 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
   } else {
     /* if we are configured, request a buffer with the src caps */
     GstCaps *srccaps = gst_pad_get_negotiated_caps (trans->srcpad);
+    GstCaps *sinkcaps = gst_pad_get_negotiated_caps (trans->sinkpad);
 
     if (!srccaps)
       goto not_configured;
 
+    if (sinkcaps != NULL) {
+      if (sinkcaps != caps || !gst_caps_is_equal (sinkcaps, caps)) {
+        gst_caps_unref (sinkcaps);
+        gst_caps_unref (srccaps);
+        goto not_configured;
+      }
+      gst_caps_unref (sinkcaps);
+    }
+
     GST_DEBUG_OBJECT (trans, "calling transform_size");
     if (!gst_base_transform_transform_size (trans,
             GST_PAD_DIRECTION (pad), caps, size, srccaps, &new_size)) {