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

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

Message

Umang Jain May 31, 2024, 5:25 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.

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.

---
Tested with mxc-isi running software isp on i.MX8MP platform
---

Changes in v3:
- Fix issue while running soft-isp
- Fix missing Doxygen changes

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

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 +-
 src/libcamera/converter.cpp                   |  6 +-
 .../converter/converter_v4l2_m2m.cpp          | 77 ++++++++++---------
 src/libcamera/pipeline/simple/simple.cpp      | 14 ++--
 src/libcamera/software_isp/software_isp.cpp   | 26 +++----
 7 files changed, 72 insertions(+), 74 deletions(-)

Comments

Andrei Konovalov May 31, 2024, 10:29 a.m. UTC | #1
On 31.05.2024 08:25, Umang Jain wrote:
> 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.
> 
> 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.
> 
> ---
> Tested with mxc-isi running software isp on i.MX8MP platform
> ---
> 
> Changes in v3:
> - Fix issue while running soft-isp

Thank you!
I can confirm that v2 was indeed broken, and v3 works OK with soft-isp.

Tested-by: Andrei Konovalov <andrey.konovalov.ynk@gmail.com> # sm8250 RB5

> - Fix missing Doxygen changes
> 
> changes in v2:
> - Split out patches 1/4 and 2/4 to tackle validation/sanity check
> - Rename V4L2M2MConverter::Stream to V4L2M2Mconverter::V4L2M2MStream
> 
> 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 +-
>   src/libcamera/converter.cpp                   |  6 +-
>   .../converter/converter_v4l2_m2m.cpp          | 77 ++++++++++---------
>   src/libcamera/pipeline/simple/simple.cpp      | 14 ++--
>   src/libcamera/software_isp/software_isp.cpp   | 26 +++----
>   7 files changed, 72 insertions(+), 74 deletions(-)
>
Umang Jain June 12, 2024, 5:35 a.m. UTC | #2
Hi Andrei

On 31/05/24 3:59 pm, Andrei Konovalov wrote:
> On 31.05.2024 08:25, Umang Jain wrote:
>> 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.
>>
>> 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.
>>
>> ---
>> Tested with mxc-isi running software isp on i.MX8MP platform
>> ---
>>
>> Changes in v3:
>> - Fix issue while running soft-isp
>
> Thank you!
> I can confirm that v2 was indeed broken, and v3 works OK with soft-isp.
>
> Tested-by: Andrei Konovalov <andrey.konovalov.ynk@gmail.com> # sm8250 RB5

Thank you for testing.

>
>> - Fix missing Doxygen changes
>>
>> changes in v2:
>> - Split out patches 1/4 and 2/4 to tackle validation/sanity check
>> - Rename V4L2M2MConverter::Stream to V4L2M2Mconverter::V4L2M2MStream
>>
>> 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 +-
>>   src/libcamera/converter.cpp                   |  6 +-
>>   .../converter/converter_v4l2_m2m.cpp          | 77 ++++++++++---------
>>   src/libcamera/pipeline/simple/simple.cpp      | 14 ++--
>>   src/libcamera/software_isp/software_isp.cpp   | 26 +++----
>>   7 files changed, 72 insertions(+), 74 deletions(-)
>>