vaapidecode: only expose supported profiles when needed.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 12 Nov 2014 06:46:53 +0000 (07:46 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 14 Nov 2014 14:26:07 +0000 (15:26 +0100)
JPEG and VP8 codecs do not really support the concept of "profile". So,
don't try to expose any set that wouldn't be supported by jpegparse, or
ivfparse for instance.

https://bugzilla.gnome.org/show_bug.cgi?id=739713
https://bugzilla.gnome.org/show_bug.cgi?id=739714

gst-libs/gst/vaapi/gstvaapiprofile.c
gst/vaapi/gstvaapidecode.c

index c50ca2b..6337fe9 100644 (file)
@@ -131,12 +131,13 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = {
     },
 #if VA_CHECK_VERSION(0,32,0)
     { GST_VAAPI_PROFILE_JPEG_BASELINE, VAProfileJPEGBaseline,
-      "image/jpeg", "baseline"
+      "image/jpeg", NULL
     },
 #endif
 #if VA_CHECK_VERSION(0,35,0)
-    {GST_VAAPI_PROFILE_VP8, VAProfileVP8Version0_3,
-      "video/x-vp8", "Version0_3"},
+    { GST_VAAPI_PROFILE_VP8, VAProfileVP8Version0_3,
+      "video/x-vp8", NULL
+    },
 #endif
     { 0, }
 };
index 11ae6bb..deef49a 100644 (file)
@@ -924,15 +924,15 @@ gst_vaapidecode_ensure_allowed_caps(GstVaapiDecode *decode)
         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);
+
+        profile_name = gst_vaapi_profile_get_name(profile);
+        if (profile_name)
+            gst_structure_set(structure, "profile", G_TYPE_STRING,
+                profile_name, NULL);
 
         allowed_caps = gst_caps_merge(allowed_caps, caps);
     }