From b58bdd1a1239c2996c42b417db31632d596de9c4 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Wed, 29 Oct 2014 15:46:47 +0200 Subject: [PATCH] vaapidecode: Expose the supported profiles as caps to upstream This will allows the playbin to fallback to Software Decoder if the Hardware Decoder does not support a particular profile. https://bugzilla.gnome.org/show_bug.cgi?id=730997 --- gst/vaapi/gstvaapidecode.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 989f7a19c8..11ae6bb743 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -917,17 +917,26 @@ gst_vaapidecode_ensure_allowed_caps(GstVaapiDecode *decode) const GstVaapiProfile profile = g_array_index(profiles, GstVaapiProfile, i); const gchar *media_type_name; + const gchar *profile_name; + GstStructure *structure; media_type_name = gst_vaapi_profile_get_media_type_name(profile); if (!media_type_name) continue; + profile_name = gst_vaapi_profile_get_name(profile); + if (!profile_name) + continue; + caps = gst_caps_from_string(media_type_name); if (!caps) continue; + structure = gst_caps_get_structure (caps, 0); + gst_structure_set (structure, "profile", G_TYPE_STRING, profile_name, NULL); + allowed_caps = gst_caps_merge(allowed_caps, caps); } - decode->allowed_caps = allowed_caps; + decode->allowed_caps = gst_caps_simplify (allowed_caps); g_array_unref(profiles); return TRUE;