pipeline: rkisp1: Match sensor aspect ratio when generating configurations
The RkISP1Path::generateConfiguration() function limits the maximum resolution to the sensor resolution, to avoid upscaling. It however doesn't take the sensor aspect ratio into account, which leads to a maximum (and default) resolution of 1920x1920 when using the self path with a sensor that has a higher resolution. Fix it by constraining the minimum and maximum resolutions to match the sensor's aspect ratio. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
parent
bf5b3af88f
commit
074fa98ac4
1 changed files with 4 additions and 3 deletions
|
@ -50,12 +50,13 @@ bool RkISP1Path::init(MediaDevice *media)
|
||||||
|
|
||||||
StreamConfiguration RkISP1Path::generateConfiguration(const Size &resolution)
|
StreamConfiguration RkISP1Path::generateConfiguration(const Size &resolution)
|
||||||
{
|
{
|
||||||
Size maxResolution = resolution;
|
Size maxResolution = maxResolution_.boundedToAspectRatio(resolution)
|
||||||
maxResolution.boundTo(maxResolution_);
|
.boundedTo(resolution);
|
||||||
|
Size minResolution = minResolution_.expandedToAspectRatio(resolution);
|
||||||
|
|
||||||
std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
|
std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
|
||||||
for (const PixelFormat &format : formats_)
|
for (const PixelFormat &format : formats_)
|
||||||
streamFormats[format] = { { minResolution_, maxResolution } };
|
streamFormats[format] = { { minResolution, maxResolution } };
|
||||||
|
|
||||||
StreamFormats formats(streamFormats);
|
StreamFormats formats(streamFormats);
|
||||||
StreamConfiguration cfg(formats);
|
StreamConfiguration cfg(formats);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue