From 766c5b22edd13defab4c48df7a3f03b6b4abcf81 Mon Sep 17 00:00:00 2001 From: Dirk Van Haerenborgh Date: Fri, 1 Feb 2013 14:33:41 +0100 Subject: [PATCH] capssetter: Pass any or filter caps upstream capsetter accepts anything and just forwards different caps, as such it should return ANY caps on the sinkpad. https://bugzilla.gnome.org/show_bug.cgi?id=693005 --- gst/debugutils/gstcapssetter.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gst/debugutils/gstcapssetter.c b/gst/debugutils/gstcapssetter.c index 316bf5f762..fd2e1e2df6 100644 --- a/gst/debugutils/gstcapssetter.c +++ b/gst/debugutils/gstcapssetter.c @@ -192,17 +192,28 @@ gst_caps_setter_transform_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps, GstCaps * cfilter) { GstCapsSetter *filter = GST_CAPS_SETTER (trans); - GstCaps *ret, *filter_caps; + GstCaps *ret = NULL, *filter_caps = NULL; GstStructure *structure, *merge; const gchar *name; gint i, j; - GST_DEBUG_OBJECT (trans, "receiving caps: %" GST_PTR_FORMAT, caps); + GST_DEBUG_OBJECT (trans, + "receiving caps: %" GST_PTR_FORMAT ", with filter: %" GST_PTR_FORMAT, + caps, cfilter); + + /* pass filter caps upstream, or any if no filter */ + if (direction != GST_PAD_SINK) { + if (!cfilter || gst_caps_is_empty (cfilter)) { + return gst_caps_new_any (); + } else { + return gst_caps_copy (cfilter); + } + } ret = gst_caps_copy (caps); /* this function is always called with a simple caps */ - if (!GST_CAPS_IS_SIMPLE (ret) || direction != GST_PAD_SINK) + if (!GST_CAPS_IS_SIMPLE (ret)) return ret; structure = gst_caps_get_structure (ret, 0);