vaapipostproc: fix support for raw YUV data upload on GStreamer 1.0.
authorWind Yuan <feng.yuan@intel.com>
Fri, 1 Nov 2013 05:43:11 +0000 (13:43 +0800)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 18 Nov 2013 14:05:25 +0000 (15:05 +0100)
commitb62bd57bda595fb98a9fdc918df3ab5938c8e9f0
tree17a09f64888d3ad302d717d80e58138d648de7eb
parentcc055b72ce222ea07b7617ee800e9998554ace7a
vaapipostproc: fix support for raw YUV data upload on GStreamer 1.0.

Fix raw YUV data uploaded as in the following pipeline:
$ gst-launch-1.0 filesrc video.yuv ! videoparse ! vaapipostproc ! vaapisink

The main reason why it failed was that the videoparse element simply
allocates GstBuffer with raw data chunk'ed off the sink pad without
any prior knowledge of the actual frame info. i.e. it basically just
calls gst_adapter_take_buffer().

We could avoid the extra copy performed in vaapipostproc if the videoparse
element was aware of the downstream pool and bothers copying line by
line, for each plane. This means that, for a single frame per buffer,
the optimizatin will be to allocate the video buffer downstream, map
it, and copy each line that is coming through until we need to fills
in the successive planes.

Still, optimized raw YUV uploads already worked with the following:
$ gst-launch-1.0 videotestsrc ! vaapipostproc ! vaapisink

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

[clean-ups, fixed error cases to unmap and unref outbuf]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
gst/vaapi/gstvaapipostproc.c