From 5830db7050d452fdf250898458e706636c764a4f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 28 Jul 2015 13:57:20 +0300 Subject: [PATCH] textoverlay: Query downstream caps for checking if caps features are supported, not just accept-caps accept-caps is not recursive and might stop at the next downstream element, while caps queries are generally recursive. The next element might accept any capsfeatures we want, but that doesn't mean that further downstream it will also work. Additionally for the future: We should probably check if downstream *prefers* the overlay meta, and only enforce usage of it if we can't handle the format ourselves and thus would have to drop the overlays. Otherwise we should prefer what downstream wants here. --- ext/pango/gstbasetextoverlay.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index 96b66f1..54d9d1a 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -727,6 +727,8 @@ gst_base_text_overlay_negotiate (GstBaseTextOverlay * overlay, GstCaps * caps) if (upstream_has_meta) { overlay_caps = gst_caps_ref (caps); } else { + GstCaps *peercaps; + /* BaseTransform requires caps for the allocation query to work */ overlay_caps = gst_caps_copy (caps); f = gst_caps_get_features (overlay_caps, 0); @@ -734,8 +736,14 @@ gst_base_text_overlay_negotiate (GstBaseTextOverlay * overlay, GstCaps * caps) GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION); /* Then check if downstream accept overlay composition in caps */ - caps_has_meta = gst_pad_peer_query_accept_caps (overlay->srcpad, - overlay_caps); + /* FIXME: We should probably check if downstream *prefers* the + * overlay meta, and only enforce usage of it if we can't handle + * the format ourselves and thus would have to drop the overlays. + * Otherwise we should prefer what downstream wants here. + */ + peercaps = gst_pad_peer_query_caps (overlay->srcpad, NULL); + caps_has_meta = gst_caps_can_intersect (peercaps, overlay_caps); + gst_caps_unref (peercaps); GST_DEBUG ("caps have overlay meta %d", caps_has_meta); } -- 2.7.4