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
This commit is contained in:
Sreerenj Balachandran 2014-10-29 15:46:47 +02:00
parent 7f3795c9fb
commit b58bdd1a12

View file

@ -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;