summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/rkisp1/rkisp1_path.cpp')
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1_path.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
index 0f728cea..89fb6596 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
@@ -127,15 +127,20 @@ void RkISP1Path::populateFormats()
}
StreamConfiguration
-RkISP1Path::generateConfiguration(const CameraSensor *sensor, StreamRole role)
+RkISP1Path::generateConfiguration(const CameraSensor *sensor, const Size &size,
+ StreamRole role)
{
const std::vector<unsigned int> &mbusCodes = sensor->mbusCodes();
const Size &resolution = sensor->resolution();
+ /* Min and max resolutions to populate the available stream formats. */
Size maxResolution = maxResolution_.boundedToAspectRatio(resolution)
.boundedTo(resolution);
Size minResolution = minResolution_.expandedToAspectRatio(resolution);
+ /* The desired stream size, bound to the max resolution. */
+ Size streamSize = size.boundedTo(maxResolution);
+
/* Create the list of supported stream formats. */
std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
unsigned int rawBitsPerPixel = 0;
@@ -189,7 +194,7 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor, StreamRole role)
StreamFormats formats(streamFormats);
StreamConfiguration cfg(formats);
cfg.pixelFormat = format;
- cfg.size = maxResolution;
+ cfg.size = streamSize;
cfg.bufferCount = RKISP1_BUFFER_COUNT;
return cfg;