defunc _buffer_alloc when direct_rendering is not supported
authorZhao Halley <halley.zhao@intel.com>
Fri, 19 Apr 2013 11:06:51 +0000 (19:06 +0800)
committerZhao Halley <halley.zhao@intel.com>
Fri, 19 Apr 2013 11:06:51 +0000 (19:06 +0800)
When SW decoder request buffer to write to avoid additional memory copy,
it is NOT ok when SW decoder and HW renering have different stride for
the same video frame size (direct_rendering=0).

gst/vaapi/gstvaapisink.c

index 6a02f5f..f13cb4e 100755 (executable)
@@ -1056,6 +1056,10 @@ gst_vaapisink_buffer_alloc(
     if (!gst_vaapi_uploader_ensure_caps(sink->uploader, caps, NULL))
         return GST_FLOW_NOT_SUPPORTED;
 
+    if (!gst_vaapi_uploader_has_direct_rendering(sink->uploader)) {
+        return GST_FLOW_OK;
+    }
+
     buf = gst_vaapi_uploader_get_buffer(sink->uploader);
     if (!buf) {
         GST_WARNING("failed to allocate resources for raw YUV buffer");