mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
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
This commit is contained in:
parent
4d0542220e
commit
766c5b22ed
1 changed files with 14 additions and 3 deletions
|
@ -192,17 +192,28 @@ gst_caps_setter_transform_caps (GstBaseTransform * trans,
|
||||||
GstPadDirection direction, GstCaps * caps, GstCaps * cfilter)
|
GstPadDirection direction, GstCaps * caps, GstCaps * cfilter)
|
||||||
{
|
{
|
||||||
GstCapsSetter *filter = GST_CAPS_SETTER (trans);
|
GstCapsSetter *filter = GST_CAPS_SETTER (trans);
|
||||||
GstCaps *ret, *filter_caps;
|
GstCaps *ret = NULL, *filter_caps = NULL;
|
||||||
GstStructure *structure, *merge;
|
GstStructure *structure, *merge;
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
gint i, j;
|
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);
|
ret = gst_caps_copy (caps);
|
||||||
|
|
||||||
/* this function is always called with a simple 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;
|
return ret;
|
||||||
|
|
||||||
structure = gst_caps_get_structure (ret, 0);
|
structure = gst_caps_get_structure (ret, 0);
|
||||||
|
|
Loading…
Reference in a new issue