gstreamer: pad: Print a g_warning() if pad accept caps that are not a subset of its caps
Sebastian Dröge
slomo at kemper.freedesktop.org
Thu Sep 8 04:42:58 PDT 2011
Module: gstreamer
Branch: master
Commit: 79b5e89015eadae378152a9d23ab9d3bf3b98b7a
URL: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=79b5e89015eadae378152a9d23ab9d3bf3b98b7a
Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date: Thu Sep 8 13:40:06 2011 +0200
pad: Print a g_warning() if pad accept caps that are not a subset of its caps
In 0.11 only subsets are supported again as documented instead of also
allowing non-empty intersections.
---
gst/gstpad.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 6c1ef51..4c0b8e9 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -2610,6 +2610,27 @@ gst_pad_accept_caps (GstPad * pad, GstCaps * caps)
result = gst_pad_acceptcaps_default (pad, caps);
GST_DEBUG_OBJECT (pad, "default acceptcaps returned %d", result);
}
+
+#ifndef G_DISABLE_ASSERT
+ {
+ GstCaps *padcaps;
+
+ padcaps = gst_pad_get_caps_reffed (pad);
+ if (!gst_caps_is_subset (caps, padcaps)) {
+ gchar *padcaps_str, *caps_str;
+
+ padcaps_str = gst_caps_to_string (padcaps);
+ caps_str = gst_caps_to_string (caps);
+ g_warning ("pad %s:%s accepted caps %s although "
+ "they are not a subset of its caps %s",
+ GST_DEBUG_PAD_NAME (pad), caps_str, padcaps_str);
+ g_free (padcaps_str);
+ g_free (caps_str);
+ }
+ gst_caps_unref (padcaps);
+ }
+#endif
+
return result;
is_same_caps:
More information about the gstreamer-commits
mailing list