[FFmpeg-devel] V4L2 M2M codecs

Jorge Ramirez-Ortiz jorge.ramirez-ortiz at linaro.org
Mon Jul 24 22:08:45 EEST 2017


The following patchset adds support for V4L2 mem2mem codecs.

This feature gives ffmpeg access to any hardware codec implementing the
V4L2 API. Since the number of hardware codecs implementing this API is
expected to increase, we believe it will be benefitial to all users to
integrate its support in the ffmpeg project.

These patches were originally posted by Alexis Ballier back in 2014
and since then they have been reviewed and tested further in different
platforms.

----------------------------------------------
* [PATCH 1/4] Move lavd/v4l2-common.* to lavc
----------------------------------------------    
    In preparation to support the integation of the V4L2 API for encoding
    and decoding, move v4l2 related files to libavcodec.
    
    Signed-off-by: Alexis Ballier <aballier at gentoo.org>
    Reviewed-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz at linaro.org>

 configure                                 |  6 ++++--
 libavcodec/Makefile                       |  1 +
 {libavdevice => libavcodec}/v4l2-common.c | 30 +++++++++++++++---------------
 {libavdevice => libavcodec}/v4l2-common.h | 24 ++++++++++--------------
 libavdevice/Makefile                      |  6 ++----
 libavdevice/v4l2.c                        | 40 +++++++++++++++++++++++++++-------------
 libavdevice/v4l2enc.c                     | 12 ++++++++++--
 7 files changed, 69 insertions(+), 50 deletions(-)

-----------------------------------------------------------------------
* [PATCH 2/4] libavcodec: v4l2: add pack_flags to the conversion tables
-----------------------------------------------------------------------    
    Extend the mapping function to use the v4l2 conversion tables.
    
    Reviewed-by: Jorge Ramirez <jorge.ramirez-ortiz at linaro.org>
    Tested-by: Jorge Ramirez <jorge.ramirez-ortiz at linaro.org>

 libavcodec/v4l2-common.c | 63 ++++++++++++++++++++++++++++++++-------------------------------
 libavcodec/v4l2-common.h |  7 ++++++-
 libavdevice/v4l2.c       |  2 +-
 libavdevice/v4l2enc.c    |  2 +-
 4 files changed, 40 insertions(+), 34 deletions(-)

--------------------------------------------------
* [PATCH 3/4] libavcodec: v4l2: add codec formats
--------------------------------------------------    
    In addition, enable the multi planar raw formats.
    
    Reviewed-by: Jorge Ramirez <jorge.ramirez-ortiz at linaro.org>
    Tested-by: Jorge Ramirez <jorge.ramirez-ortiz at linaro.org>

 libavcodec/v4l2-common.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

-----------------------------------------------------------------------
* [PATCH 4/4] libavcodec/dev: v4l2: add support for v4l2 mem2mem codecs
------------------------------------------------------------------------    
    This patchset enhances Alexis Ballier's original patch and validates
    it using Qualcomm's Venus hardware (driver recently landed upstream
    [1]).
    
    This has been tested on Qualcomm's DragonBoard 410c and 820c
    
    ffplay tested video decoders:
    - h264,
    - vp8
    - mpeg4
    
    Some of the changes introduced:
    - v4l2: some cleanup of the code.
    - v4l2: some cleaup before upstreaming.
    - v4l2: follow the new decode api.
    - v4l2: fix display size for NV12 output pool.
    - v4l2: handle EOS.
    - v4l2: fix vp8 and mpeg4 decoding.
    - v4l2: generate EOF on dequeue errors.
    - v4l2: h264_mp4toannexb filtering.
    
    [1] https://lwn.net/Articles/697956/
    
    Reviewed-by: Jorge Ramirez <jorge.ramirez-ortiz at linaro.org>
    Reviewed-by: Alexis Ballier <aballier at gentoo.org>
    Tested-by: Jorge Ramirez <jorge.ramirez-ortiz at linaro.org>

 Changelog                     |   3 +-
 configure                     |  17 +++++++-
 libavcodec/Makefile           |  15 ++++++-
 libavcodec/allcodecs.c        |   7 ++++
 libavcodec/v4l2-buffers.c     | 633 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libavcodec/v4l2-buffers.h     | 247 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libavcodec/v4l2-common.c      |  48 +++++++++++-----------
 libavcodec/v4l2-common.h      |   4 +-
 libavcodec/v4l2_m2m.c         | 358 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libavcodec/v4l2_m2m.h         |  69 +++++++++++++++++++++++++++++++
 libavcodec/v4l2_m2m_avcodec.h |  32 +++++++++++++++
 libavcodec/v4l2_m2m_dec.c     | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libavcodec/v4l2_m2m_enc.c     | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 13 files changed, 1897 insertions(+), 31 deletions(-)





More information about the ffmpeg-devel mailing list