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;