vaapidecode: warns if driver will do color conversions
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 18 Apr 2016 15:17:58 +0000 (17:17 +0200)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 18 Apr 2016 16:28:43 +0000 (18:28 +0200)
If the downstream feature is system memory, the surface has to be mapped,
hence a warning message is logged saying that the driver has to do color
conversions. This might be troublesome because not all the color conversion
combinations are supported by the VA-API drivers, and there is not a reliable
way to know them before hand.

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

gst/vaapi/gstvaapidecode.c

index fd2ca11..27ff062 100644 (file)
@@ -259,6 +259,14 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
   if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
     return FALSE;
 
+  if ((feature == GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY ||
+          feature == GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE)
+      && format != GST_VIDEO_INFO_FORMAT (&decode->decoded_info)) {
+    GST_FIXME_OBJECT (decode, "validate if driver can convert from %s to %s",
+        gst_video_format_to_string (GST_VIDEO_INFO_FORMAT
+            (&decode->decoded_info)), gst_video_format_to_string (format));
+  }
+
   switch (feature) {
 #if (USE_GLX || USE_EGL)
     case GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META: