Revert "Revert "basetransform: Use check for subsets and not non-empty intersection to check if caps are compatible""

This reverts commit 0bc6d49c95.

Conflicts:

	libs/gst/base/gstbasetransform.c
This commit is contained in:
Sebastian Dröge 2011-09-08 14:39:30 +02:00
parent 7476186217
commit a44271899c

View file

@ -919,7 +919,6 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
GstBaseTransformClass *klass; GstBaseTransformClass *klass;
GstPad *otherpad, *otherpeer; GstPad *otherpad, *otherpeer;
GstCaps *othercaps; GstCaps *othercaps;
gboolean peer_checked = FALSE;
gboolean is_fixed; gboolean is_fixed;
/* caps must be fixed here, this is a programming error if it's not */ /* caps must be fixed here, this is a programming error if it's not */
@ -1000,7 +999,6 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
gst_caps_unref (othercaps); gst_caps_unref (othercaps);
othercaps = intersection; othercaps = intersection;
is_fixed = gst_caps_is_fixed (othercaps); is_fixed = gst_caps_is_fixed (othercaps);
peer_checked = TRUE;
} else { } else {
GST_DEBUG_OBJECT (trans, "no peer, doing passthrough"); GST_DEBUG_OBJECT (trans, "no peer, doing passthrough");
gst_caps_unref (othercaps); gst_caps_unref (othercaps);
@ -1024,7 +1022,6 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
/* FIXME: when fixating using the vmethod, it might make sense to fixate /* FIXME: when fixating using the vmethod, it might make sense to fixate
* each of the caps; but Wim doesn't see a use case for that yet */ * each of the caps; but Wim doesn't see a use case for that yet */
gst_caps_truncate (othercaps); gst_caps_truncate (othercaps);
peer_checked = FALSE;
if (klass->fixate_caps) { if (klass->fixate_caps) {
GST_DEBUG_OBJECT (trans, "trying to fixate %" GST_PTR_FORMAT GST_DEBUG_OBJECT (trans, "trying to fixate %" GST_PTR_FORMAT
@ -1064,9 +1061,8 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
if (!is_fixed) if (!is_fixed)
goto could_not_fixate; goto could_not_fixate;
/* and peer should accept, don't check again if we already checked the /* and peer should accept */
* othercaps against the peer. */ if (!gst_pad_accept_caps (otherpeer, othercaps))
if (!peer_checked && otherpeer && !gst_pad_accept_caps (otherpeer, othercaps))
goto peer_no_accept; goto peer_no_accept;
GST_DEBUG_OBJECT (trans, "Input caps were %" GST_PTR_FORMAT GST_DEBUG_OBJECT (trans, "Input caps were %" GST_PTR_FORMAT
@ -1148,7 +1144,7 @@ gst_base_transform_acceptcaps_default (GstBaseTransform * trans,
GST_DEBUG_OBJECT (trans, "allowed caps %" GST_PTR_FORMAT, allowed); GST_DEBUG_OBJECT (trans, "allowed caps %" GST_PTR_FORMAT, allowed);
/* intersect with the requested format */ /* intersect with the requested format */
ret = gst_caps_can_intersect (allowed, caps); ret = gst_caps_is_subset (caps, allowed);
gst_caps_unref (allowed); gst_caps_unref (allowed);
if (!ret) if (!ret)