diff options
author | Jan Schmidt <jan@centricular.com> | 2015-09-17 00:01:58 +1000 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2015-09-17 00:49:58 +1000 |
commit | 86a8ff50c0bba46bfefe6859cda971438625dc91 (patch) | |
tree | 910bf892a642333eb8243008e06bec64f056cb28 /gst | |
parent | 50400fa2a660839c672b222094385018995aede7 (diff) | |
download | gstreamer-plugins-bad-86a8ff50c0bba46bfefe6859cda971438625dc91.tar.gz |
dvbsuboverlay: Check if downstream supports GstVideoOverlayComposition.
Fix the negotiation of GstVideoOverlayComposition by checking
intersection with the peer caps, rather than just accept-caps,
which might only check the pad template.
https://bugzilla.gnome.org/show_bug.cgi?id=755113
Diffstat (limited to 'gst')
-rw-r--r-- | gst/dvbsuboverlay/gstdvbsuboverlay.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c index 8a429eb2e..882bfa771 100644 --- a/gst/dvbsuboverlay/gstdvbsuboverlay.c +++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c @@ -686,6 +686,7 @@ gst_dvbsub_overlay_negotiate (GstDVBSubOverlay * overlay, GstCaps * caps) || !gst_caps_features_contains (f, GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION)) { GstCaps *overlay_caps; + GstCaps *peercaps; /* In this case we added the meta, but we can work without it * so preserve the original caps so we can use it as a fallback */ @@ -695,9 +696,18 @@ gst_dvbsub_overlay_negotiate (GstDVBSubOverlay * overlay, GstCaps * caps) gst_caps_features_add (f, GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION); - ret = gst_pad_peer_query_accept_caps (overlay->srcpad, overlay_caps); - GST_DEBUG_OBJECT (overlay, "Downstream accepts the overlay meta: %d", ret); - if (ret) { + /* 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_OBJECT (overlay, "Downstream accepts the overlay meta: %d", + caps_has_meta); + if (caps_has_meta) { gst_caps_unref (caps); caps = overlay_caps; |