[libcamera-devel] [PATCH 06/13] libcamera: pipeline: rkisp1: Export stream formats to applicaitons

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Aug 20 17:04:35 CEST 2020


Hello,

s/applicaitons/applications/ in the subject line.

On Thu, Aug 20, 2020 at 10:46:13AM +0200, Jacopo Mondi wrote:
> Hi Niklas,
>    a few questions
> 
> On Thu, Aug 13, 2020 at 02:52:39AM +0200, Niklas Söderlund wrote:
> > The information about stream format is available but not exported to
> > applications, fix this.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> > ---
> >  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > index 9d5a52d352aefabc..8e0f6db5faa96928 100644
> > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > @@ -585,7 +585,13 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera
> >  	if (roles.empty())
> >  		return config;
> >
> > -	StreamConfiguration cfg{};
> > +	std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
> > +	for (const PixelFormat &format : RKISP1_RSZ_MP_FORMATS)
> > +		streamFormats[format] =
> > +			{ { RKISP1_RSZ_MP_SRC_MIN, RKISP1_RSZ_MP_SRC_MAX } };
> > +
> 
> Can the ISP freely up-scale? Otherwise the size should be capped to
> the max sensor size

Even if the ISP can upscale I'm not sure we should allow it. I'd prefer
capping the size.

> Can all formats be produced from all input formats ? Otherwise the
> formats that can be produced should be matched with the ones produced
> by the sensor.
> 
> As a general note, should we try to report the available stream
> formats by inspeting the ones that can be produced by the video device
> or can we live with a static enumeration in the pipeline handler ?

We don't need to query the kernel if we know the information already,
but we should only report formats that can actually be produced for the
connected sensor.

> > +	StreamFormats formats(streamFormats);
> > +	StreamConfiguration cfg(formats);
> >  	cfg.pixelFormat = formats::NV12;
> >  	cfg.size = data->sensor_->resolution();
> >

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list