[v2,0/4] libcamera: converter: Replace usage of stream index by Stream pointer
mbox series

Message ID 20240529070248.12186-1-umang.jain@ideasonboard.com
Headers show
Series
  • libcamera: converter: Replace usage of stream index by Stream pointer
Related show

Message

Umang Jain May 29, 2024, 7:02 a.m. UTC
The converter interface uses the unsigned int output stream index to map
to the output frame buffers. This is cumbersome to implement new
converters because one has to keep around additional book keeping
to track the streams with their correct indexes.

This patch (still an RFC) intends to drop stream index usage.
The index is replaced by Stream pointer. This is convenient since
Stream pointers are easily accessible at configuration time (from
StreamConfiguration) and from Request objects.

The v4l2_converter_m2m and simple pipeline handler are adapt to
use the new interface. This work roped in software ISP as well,
which also seems to use indexes (although it doesn't implement converter
interface) because of a common conversionQueue_ queue used for
converter_ and swIsp_.

Patch 1/4 and 2/4 drop redundant  validation of outputs std::map<>.

Patch 3/4 renames private class V4L2M2MConverter::Stream to
V4L2M2Mconverter::V4L2M2MStream

Patch 4/4 replaces the stream index usage from converter interface and
soft isp.

changes in v2:
- Split out patches 1/4 and 2/4 to tackle validation/sanity check
- Rename V4L2M2MConverter::Stream to V4L2M2Mconverter::V4L2M2MStrea

Umang Jain (4):
  converter: converter_v4l2_m2m: Rectify streams sanity check
  libcamera: software_isp: Drop unnecessary sanity check
  converter: converter_v4l2_m2m: Rename private Stream class
  libcamera: converter: Replace usage of stream index by Stream pointer

 include/libcamera/internal/converter.h        |  5 +-
 .../internal/converter/converter_v4l2_m2m.h   | 13 ++--
 .../internal/software_isp/software_isp.h      |  5 +-
 .../converter/converter_v4l2_m2m.cpp          | 77 ++++++++++---------
 src/libcamera/pipeline/simple/simple.cpp      | 14 ++--
 src/libcamera/software_isp/software_isp.cpp   | 22 ++----
 6 files changed, 67 insertions(+), 69 deletions(-)