Message ID | 20250804163812.126022-7-mzamazal@redhat.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
On Mon, Aug 04, 2025 at 06:38:09PM +0200, Milan Zamazal wrote: > When software ISP is enabled, we want to be able to provide a raw stream > in addition to the processed stream. For this purpose, we need two > streams. If only the processed stream is requested, it doesn't harm to > allocate two. > > The number of streams is determined as a camera property in the pipeline > matching. To be able to produce both raw and processed output, two > streams must be provided. The actual number of streams needed (one or > two) is determined only when examining roles in > SimplePipelineHandler::generateConfiguration. The last sentence should be changed. A application can easily bypass generateConfiguration and hand craft CameraConfiguration, passing it to validate(). So I think no. of streams needed is deterministically evaluated at validation phase. > > In theory, software ISP could produce multiple processed streams but > this is out of scope of this patch series. Hence two streams are > sufficient at the moment. > > When software ISP is not enabled, the camera won't be able to produce > multiple streams (assuming there's no hardware converter) and only > single stream should be allocated as before. The simple pipeline > handler assumes there's a linear pipeline from the camera sensor to a > video capture device, and only supports a single stream. Branches in > the hardware pipeline that would allow capturing multiple streams from > the same camera sensor are not supported. We have no plan to change > that, as a device that can produce multiple streams will likely be > better supported by a dedicated pipeline handler. > > Signed-off-by: Milan Zamazal <mzamazal@redhat.com> > --- > src/libcamera/pipeline/simple/simple.cpp | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp > index 12fbe533e..46c316fd7 100644 > --- a/src/libcamera/pipeline/simple/simple.cpp > +++ b/src/libcamera/pipeline/simple/simple.cpp > @@ -1789,6 +1789,16 @@ bool SimplePipelineHandler::matchDevice(MediaDevice *media, > } > } > > + if (info.swIspEnabled) { > + /* > + * When the software ISP is enabled, the simple pipeline handler > + * exposes the raw stream, giving a total of two streams. This > + * is mutally exclusive with the presence of a converter. s/mutally/mutually/ Reviewed-by: Umang Jain <uajain@igalia.com> > + */ > + ASSERT(!converter_); > + numStreams = 2; > + } > + > swIspEnabled_ = info.swIspEnabled; > > /* Locate the sensors. */ > -- > 2.50.1 >
Hi Umang, Umang Jain <uajain@igalia.com> writes: > On Mon, Aug 04, 2025 at 06:38:09PM +0200, Milan Zamazal wrote: >> When software ISP is enabled, we want to be able to provide a raw stream >> in addition to the processed stream. For this purpose, we need two > >> streams. If only the processed stream is requested, it doesn't harm to >> allocate two. >> >> The number of streams is determined as a camera property in the pipeline >> matching. To be able to produce both raw and processed output, two >> streams must be provided. The actual number of streams needed (one or >> two) is determined only when examining roles in >> SimplePipelineHandler::generateConfiguration. > > The last sentence should be changed. A application can easily bypass > generateConfiguration and hand craft CameraConfiguration, passing it to > validate(). So I think no. of streams needed is deterministically > evaluated at validation phase. Right, I'll change it. >> In theory, software ISP could produce multiple processed streams but >> this is out of scope of this patch series. Hence two streams are >> sufficient at the moment. >> >> When software ISP is not enabled, the camera won't be able to produce >> multiple streams (assuming there's no hardware converter) and only >> single stream should be allocated as before. The simple pipeline >> handler assumes there's a linear pipeline from the camera sensor to a >> video capture device, and only supports a single stream. Branches in >> the hardware pipeline that would allow capturing multiple streams from >> the same camera sensor are not supported. We have no plan to change >> that, as a device that can produce multiple streams will likely be >> better supported by a dedicated pipeline handler. >> >> Signed-off-by: Milan Zamazal <mzamazal@redhat.com> >> --- >> src/libcamera/pipeline/simple/simple.cpp | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp >> index 12fbe533e..46c316fd7 100644 >> --- a/src/libcamera/pipeline/simple/simple.cpp >> +++ b/src/libcamera/pipeline/simple/simple.cpp >> @@ -1789,6 +1789,16 @@ bool SimplePipelineHandler::matchDevice(MediaDevice *media, >> } >> } >> >> + if (info.swIspEnabled) { >> + /* >> + * When the software ISP is enabled, the simple pipeline handler >> + * exposes the raw stream, giving a total of two streams. This >> + * is mutally exclusive with the presence of a converter. > > s/mutally/mutually/ Oh, flyspell-prog-mode not enabled. I'll fix both. > Reviewed-by: Umang Jain <uajain@igalia.com> > >> + */ >> + ASSERT(!converter_); >> + numStreams = 2; >> + } >> + >> swIspEnabled_ = info.swIspEnabled; >> >> /* Locate the sensors. */ >> -- >> 2.50.1 >>
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 12fbe533e..46c316fd7 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -1789,6 +1789,16 @@ bool SimplePipelineHandler::matchDevice(MediaDevice *media, } } + if (info.swIspEnabled) { + /* + * When the software ISP is enabled, the simple pipeline handler + * exposes the raw stream, giving a total of two streams. This + * is mutally exclusive with the presence of a converter. + */ + ASSERT(!converter_); + numStreams = 2; + } + swIspEnabled_ = info.swIspEnabled; /* Locate the sensors. */
When software ISP is enabled, we want to be able to provide a raw stream in addition to the processed stream. For this purpose, we need two streams. If only the processed stream is requested, it doesn't harm to allocate two. The number of streams is determined as a camera property in the pipeline matching. To be able to produce both raw and processed output, two streams must be provided. The actual number of streams needed (one or two) is determined only when examining roles in SimplePipelineHandler::generateConfiguration. In theory, software ISP could produce multiple processed streams but this is out of scope of this patch series. Hence two streams are sufficient at the moment. When software ISP is not enabled, the camera won't be able to produce multiple streams (assuming there's no hardware converter) and only single stream should be allocated as before. The simple pipeline handler assumes there's a linear pipeline from the camera sensor to a video capture device, and only supports a single stream. Branches in the hardware pipeline that would allow capturing multiple streams from the same camera sensor are not supported. We have no plan to change that, as a device that can produce multiple streams will likely be better supported by a dedicated pipeline handler. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> --- src/libcamera/pipeline/simple/simple.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+)