[libcamera-devel,v3,07/22] libcamera: pipeline: rkisp1: Export stream formats to applications

Message ID 20200925014207.1455796-8-niklas.soderlund@ragnatech.se
State Accepted
Headers show
Series
  • libcamera: pipeline: rkisp1: Extend to support two streams
Related show

Commit Message

Niklas Söderlund Sept. 25, 2020, 1:41 a.m. UTC
The information about stream format is available but not exported to
applications, fix this.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
* Changes since v1
- Fix s/applicaitons/applications/ in subject
- Cap the max resolution reported to the sensor resolution.
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Jacopo Mondi Sept. 25, 2020, 2:27 p.m. UTC | #1
Hi Niklas,

On Fri, Sep 25, 2020 at 03:41:52AM +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@ragnatech.se>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> * Changes since v1
> - Fix s/applicaitons/applications/ in subject
> - Cap the max resolution reported to the sensor resolution.
> ---
>  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 e52aadcfdb9870a3..27191b18c989aa5e 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -582,7 +582,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)

Do the supported formats differ between main and self path ?
Probably with the introduction of different roles support, I'll find
it out later ?

For now
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
   j


> +		streamFormats[format] =
> +			{ { RKISP1_RSZ_MP_SRC_MIN, data->sensor_->resolution() } };
> +
> +	StreamFormats formats(streamFormats);
> +	StreamConfiguration cfg(formats);
>  	cfg.pixelFormat = formats::NV12;
>  	cfg.size = data->sensor_->resolution();
>
> --
> 2.28.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Niklas Söderlund Sept. 25, 2020, 4:20 p.m. UTC | #2
Hi Jacopo,

On 2020-09-25 16:27:01 +0200, Jacopo Mondi wrote:
> Hi Niklas,
> 
> On Fri, Sep 25, 2020 at 03:41:52AM +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@ragnatech.se>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > * Changes since v1
> > - Fix s/applicaitons/applications/ in subject
> > - Cap the max resolution reported to the sensor resolution.
> > ---
> >  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 e52aadcfdb9870a3..27191b18c989aa5e 100644
> > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> > @@ -582,7 +582,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)
> 
> Do the supported formats differ between main and self path ?
> Probably with the introduction of different roles support, I'll find
> it out later ?

Yes main supports RAW while self supports RGB formats. In previos 
versions I enabled RGB for self but I have now tested it more and al tho 
it works the captured frames does not look 100% so I have taken it out 
of the series.

> 
> For now
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> 
> Thanks
>    j
> 
> 
> > +		streamFormats[format] =
> > +			{ { RKISP1_RSZ_MP_SRC_MIN, data->sensor_->resolution() } };
> > +
> > +	StreamFormats formats(streamFormats);
> > +	StreamConfiguration cfg(formats);
> >  	cfg.pixelFormat = formats::NV12;
> >  	cfg.size = data->sensor_->resolution();
> >
> > --
> > 2.28.0
> >
> > _______________________________________________
> > libcamera-devel mailing list
> > libcamera-devel@lists.libcamera.org
> > https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index e52aadcfdb9870a3..27191b18c989aa5e 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -582,7 +582,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, data->sensor_->resolution() } };
+
+	StreamFormats formats(streamFormats);
+	StreamConfiguration cfg(formats);
 	cfg.pixelFormat = formats::NV12;
 	cfg.size = data->sensor_->resolution();