From aff648ab66d22e217f36cd91775bda181b56e2ee Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 29 Nov 2005 15:12:22 +0000 Subject: [PATCH] gst/base/gstbasetransform.c: Treat a pad alloc with new caps the same as if we were not negotiated, in order to allow... 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 | 8 ++++++++ gst/base/gstbasetransform.c | 10 ++++++++++ libs/gst/base/gstbasetransform.c | 10 ++++++++++ 3 files changed, 28 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0df7606..7ff9514 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-11-29 Jan Schmidt + + * 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 * 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 * gst/gstregistryxml.c: (load_plugin): diff --git a/gst/base/gstbasetransform.c b/gst/base/gstbasetransform.c index 7c286b5..28e4660 100644 --- a/gst/base/gstbasetransform.c +++ b/gst/base/gstbasetransform.c @@ -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)) { diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 7c286b5..28e4660 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -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)) { -- 2.7.4