After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711250 - vaapipostproc doesn't support raw yuv data upload on gstreamer-1.0
vaapipostproc doesn't support raw yuv data upload on gstreamer-1.0
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal major
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-11-01 09:44 UTC by Wind Yuan
Modified: 2013-11-18 14:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapipostproc support raw yuv data upload (2.64 KB, patch)
2013-11-01 09:59 UTC, Wind Yuan
none Details | Review
vaapipostproc fix caps negotiation with raw yuv caps (3.05 KB, patch)
2013-11-01 09:59 UTC, Wind Yuan
none Details | Review

Description Wind Yuan 2013-11-01 09:44:01 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
Comment 1 Wind Yuan 2013-11-01 09:59:00 UTC
Created attachment 258721 [details] [review]
vaapipostproc support raw yuv data upload
Comment 2 Wind Yuan 2013-11-01 09:59:48 UTC
Created attachment 258722 [details] [review]
vaapipostproc fix caps negotiation with raw yuv caps
Comment 3 Wind Yuan 2013-11-01 10:02:58 UTC
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
Comment 4 Gwenole Beauchesne 2013-11-18 14:07:20 UTC
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.
Comment 5 Gwenole Beauchesne 2013-11-18 14:07:43 UTC
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>