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 <aball...@gentoo.org> Reviewed-by: Jorge Ramirez-Ortiz <jorge.ramirez-or...@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-or...@linaro.org> Tested-by: Jorge Ramirez <jorge.ramirez-or...@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-or...@linaro.org> Tested-by: Jorge Ramirez <jorge.ramirez-or...@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-or...@linaro.org> Reviewed-by: Alexis Ballier <aball...@gentoo.org> Tested-by: Jorge Ramirez <jorge.ramirez-or...@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(-) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel