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 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 + libavcodec/v4l2-common.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ libavcodec/v4l2-common.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ libavdevice/Makefile | 6 ++---- libavdevice/v4l2-common.c | 105 --------------------------------------------------------------------------------------------------------- libavdevice/v4l2-common.h | 61 ------------------------------------------------------------- libavdevice/v4l2.c | 40 +++++++++++++++++++++++++++------------- libavdevice/v4l2enc.c | 14 +++++++++++--- 9 files changed, 207 insertions(+), 188 deletions(-) [PATCH 2/4] libavcodec: v4l2: add pack_flags to the conversion tables 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 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: 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 Tested decoders: - h264 - mpeg4 - vp8 - vp9 - hevc Tested encoders: -h264 -h263 -mpeg4 Tested transcoding (concurrent encoding/decoding) Some of the changes introduced: - v4l2: code cleanup. - v4l2: follow the decode api. - v4l2: fix display size for NV12 output pool. - v4l2: handle EOS. - v4l2: vp8 and mpeg4 decoding. - v4l2: hevc and vp9 support. - v4l2: generate EOF on dequeue errors. - v4l2: h264_mp4toannexb filtering. - v4l2: import compat/v4l2 header files. [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 +- compat/v4l2/v4l2-common.h | 107 +++++++ compat/v4l2/v4l2-controls.h | 987 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ compat/v4l2/videodev2.h | 2402 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure | 26 +- libavcodec/Makefile | 19 +- libavcodec/allcodecs.c | 9 + libavcodec/v4l2-buffers.c | 614 ++++++++++++++++++++++++++++++++++++ libavcodec/v4l2-buffers.h | 226 ++++++++++++++ libavcodec/v4l2-common.c | 136 -------- libavcodec/v4l2-common.h | 62 ---- libavcodec/v4l2-fmt.c | 142 +++++++++ libavcodec/v4l2-fmt.h | 62 ++++ libavcodec/v4l2_m2m.c | 356 +++++++++++++++++++++ libavcodec/v4l2_m2m.h | 69 +++++ libavcodec/v4l2_m2m_avcodec.h | 32 ++ libavcodec/v4l2_m2m_dec.c | 229 ++++++++++++++ libavcodec/v4l2_m2m_enc.c | 270 ++++++++++++++++ libavdevice/v4l2.c | 2 +- libavdevice/v4l2enc.c | 2 +- tests/ref/fate/source | 3 + 21 files changed, 5548 insertions(+), 210 deletions(-) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel