[libcamera-devel] [RFC PATCH 0/6] Add propagation of sensor frame interval

Marian Cichy m.cichy at pengutronix.de
Tue Mar 16 16:52:05 CET 2021


This patch series is meant to demonstrate my use-case and to start a
discussion. The main target is to have a mechanism where the
application, e.g. libcamerasrc can read out the frame interval set by
the driver.

It is generally useful for applications to know the framerate, e.g. one
can build pipelines with Gstreamer where the framerate is used to
pre-allocate a proper amount of memory or to compute the latency. It is
also an useful debug-information in general.

this approach uses the frame_interval ioctls which is for my driver the
only way to get the frame rate. I suspect there is also a different
approach using controls::FrameDurations which I find in some parts of
libcamera. However, it is not clear to me, how I would use this and what
the driver needs to do here or if it even would be the better approach
for my use-case. Any comments to this are welcome.


Marian Cichy (6):
  libcamera: Add fraction.h
  libcamera: stream: Add frame interval attribute
  libcamera: v4l2_subdevice: Add methods to get/set frame interval
  pipeline: simple: Propagate frame interval through pipeline
  pipeline: simple: rename setupFormats to setupStreamProperties
  gst: utils: Add framerate to caps

 include/libcamera/fraction.h                | 34 ++++++++++++
 include/libcamera/internal/v4l2_subdevice.h |  4 ++
 include/libcamera/stream.h                  |  2 +
 src/gstreamer/gstlibcamera-utils.cpp        |  2 +
 src/libcamera/fraction.cpp                  | 60 +++++++++++++++++++++
 src/libcamera/meson.build                   |  1 +
 src/libcamera/pipeline/simple/simple.cpp    | 31 +++++++++--
 src/libcamera/v4l2_subdevice.cpp            | 43 +++++++++++++++
 8 files changed, 173 insertions(+), 4 deletions(-)
 create mode 100644 include/libcamera/fraction.h
 create mode 100644 src/libcamera/fraction.cpp

-- 
2.29.2



More information about the libcamera-devel mailing list