GNOME Bugzilla – Bug 711250
vaapipostproc doesn't support raw yuv data upload on gstreamer-1.0
Last modified: 2013-11-18 14:07:43 UTC
vaapipostproc doesn't support raw yuv data upload on gstreamer-1.0. failed in $ gst-launch-1.0 filesrc location=blue_sky_1080p.yuv ! videoparse format=i420 width=1920 height=1080 ! queue ! vaapipostproc ! vaapisink $ gst-launch-1.0 v4l2src device="/dev/video0" num-buffers=500 ! video/x-raw,format=I420,width=640,height=480,framerate=30/1 ! vaapipostproc ! vaapisink
Created attachment 258721 [details] [review] vaapipostproc support raw yuv data upload
Created attachment 258722 [details] [review] vaapipostproc fix caps negotiation with raw yuv caps
0001-postproc-support-raw-yuv-data-upload-on-gstreamer-1.patch, (id=258721) fixed raw yuv data upload to vasurface(videoparse ! vaapipostproc), which works on gstreamer 1.0 0002-postproc-fix-caps-negotiation-with-raw-data.patch (id=258722) fixed caps negotiation failed when v4l2src(camera) ! vaapipostproc Please review the 2 patches
Applied the first patch only, with extra clean-ups and fixes in case of errors, e.g. unmap video frames and unref buffer when needed to avoid memory leak. The second patch was somewhat already fixes in git master branch. Thanks.
commit b62bd57bda595fb98a9fdc918df3ab5938c8e9f0 Author: Wind Yuan <feng.yuan@intel.com> Date: Fri Nov 1 13:43:11 2013 +0800 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>