From 85df5648bbc82c6810295d6f5c51fe37656807f1 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Wed, 6 Jan 2016 13:20:17 +1100 Subject: [PATCH] applemedia: avfvideosrc: small negotiation fix Fix negotiation when GLMemory is requested but a context is not available --- sys/applemedia/avfvideosrc.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m index 6d3390d2c1..ab6b836eab 100644 --- a/sys/applemedia/avfvideosrc.m +++ b/sys/applemedia/avfvideosrc.m @@ -1006,6 +1006,13 @@ caps_filter_out_gl_memory (GstCapsFeatures * features, GstStructure * structure, else gst_object_unref (context); + /* this can happen if video/x-raw(memory:GLMemory) is forced but a context is + * not available */ + if (gst_caps_is_empty (new_caps)) { + GST_WARNING_OBJECT (element, "GLMemory requested but no context available"); + return new_caps; + } + new_caps = gst_caps_truncate (new_caps); structure = gst_caps_get_structure (new_caps, 0); /* crank up to 11. This is what the presets do, but we don't use the presets