[FFmpeg-devel] [PATCH v2 0/2] Add common V4L2 request API code

xademax at gmail.com xademax at gmail.com
Tue Apr 12 18:53:14 EEST 2022


From: Elie ROUDNINSKI <xademax at gmail.com>

This is the second iteration of https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2898
but only covering the common V4L2 request API code without the support for h264 codec.

Changes in v2:
* Addressed some styling comments
* Removed libudev dependency
* Device probing has been refactored

This code (in one version or another) has been widely used by various projects
like LibreELEC[1] for several years already.
The uAPI has been stable for several kernel versions too and as of linux5.17,
the following codecs are available:
* mpeg2
* h264
* vp9

HEVC is in the process of being stabilized too[2].

I have tried to contact the original author of the code but I haven't got an answer
so far so I have kept them as commit author but added myself as co-author since
I have made substantial modifications to it. Happy to change this either way.

It's my first contribution to FFmpeg, so I hope to have done everything right.
Additionally, I must confess that I am not an expert of the V4L2 request APIs but
since I was frustrated of not being able to use standard FFmpeg on my ARM boards
to get hardware decoding working, I figured I might just try to give it a go.
There are several comments in the original patch series that I won't have an answer
for but I hope that won't be a blocker. That's also why the v4l2-request configure
option has been marked as experimental.

[1] https://github.com/LibreELEC/LibreELEC.tv/tree/master/packages/multimedia/ffmpeg/patches/v4l2-request
[2] https://patchwork.kernel.org/project/linux-media/list/?series=630077


Jonas Karlman (2):
  avutil/buffer: add av_buffer_pool_flush()
  avcodec: add common V4L2 request API code

 configure                 |   7 +
 doc/APIchanges            |   3 +
 libavcodec/Makefile       |   3 +-
 libavcodec/hwconfig.h     |   2 +
 libavcodec/v4l2_buffers.c |   8 +-
 libavcodec/v4l2_context.c |  80 ++--
 libavcodec/v4l2_context.h |   5 +-
 libavcodec/v4l2_device.c  | 229 ++++++++++
 libavcodec/v4l2_device.h  |  60 +++
 libavcodec/v4l2_m2m.c     | 119 ++---
 libavcodec/v4l2_m2m.h     |   4 +-
 libavcodec/v4l2_m2m_dec.c |  10 +-
 libavcodec/v4l2_m2m_enc.c |   8 +-
 libavcodec/v4l2_request.c | 892 ++++++++++++++++++++++++++++++++++++++
 libavcodec/v4l2_request.h |  87 ++++
 libavutil/buffer.c        |   7 +
 libavutil/buffer.h        |   5 +
 libavutil/version.h       |   4 +-
 18 files changed, 1399 insertions(+), 134 deletions(-)
 create mode 100644 libavcodec/v4l2_device.c
 create mode 100644 libavcodec/v4l2_device.h
 create mode 100644 libavcodec/v4l2_request.c
 create mode 100644 libavcodec/v4l2_request.h

-- 
2.35.1



More information about the ffmpeg-devel mailing list