vaapipostproc: no format convert on GL tex upload meta
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Thu, 2 Jul 2015 15:49:25 +0000 (17:49 +0200)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Fri, 3 Jul 2015 11:31:47 +0000 (13:31 +0200)
When GL texture upload meta is negotiated, vaapipostproc shall not modify the
color format of the buffer.

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

gst/vaapi/gstvaapipostproc.c

index 427d8ad..d80d091 100644 (file)
@@ -1109,7 +1109,6 @@ gst_vaapipostproc_transform_caps_impl (GstBaseTransform * trans,
       peer_caps = gst_caps_fixate (peer_caps);
     gst_video_info_from_caps (&peer_vi, peer_caps);
     out_format = GST_VIDEO_INFO_FORMAT (&peer_vi);
-    postproc->format = out_format;
     if (peer_caps)
       gst_caps_unref (peer_caps);
   }
@@ -1129,6 +1128,13 @@ gst_vaapipostproc_transform_caps_impl (GstBaseTransform * trans,
       gst_caps_set_features (out_caps, 0,
           gst_caps_features_new (feature_str, NULL));
   }
+
+  /* we don't need to do format conversion if GL_TEXTURE_UPLOAD_META
+   * is negotiated */
+  if (feature != GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META &&
+      postproc->format != out_format) {
+    postproc->format = out_format;
+  }
   return out_caps;
 }