@@ -306,7 +306,10 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,
Size sensorResolution = data->cio2_.sensor()->resolution();
for (const StreamRole role : roles) {
- StreamConfiguration cfg = {};
+ std::map<PixelFormat, std::vector<SizeRange>> streamFormats;
+ unsigned int bufferCount;
+ PixelFormat pixelFormat;
+ Size size;
switch (role) {
case StreamRole::StillCapture:
@@ -314,20 +317,27 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,
* Use the sensor resolution aligned to the ImgU
* output constraints.
*/
- cfg.size.width = std::min(sensorResolution.width,
- IPU3_OUTPUT_MAX_WIDTH);
- cfg.size.height = std::min(sensorResolution.height,
- IPU3_OUTPUT_MAX_HEIGHT);
- cfg.size.width &= ~IPU3_OUTPUT_WIDTH_ALIGN;
- cfg.size.height &= ~IPU3_OUTPUT_HEIGHT_ALIGN;
- cfg.pixelFormat = formats::NV12;
- cfg.bufferCount = IPU3_BUFFER_COUNT;
+ size.width = std::min(sensorResolution.width,
+ IPU3_OUTPUT_MAX_WIDTH);
+ size.height = std::min(sensorResolution.height,
+ IPU3_OUTPUT_MAX_HEIGHT);
+ size.width &= ~IPU3_OUTPUT_WIDTH_ALIGN;
+ size.height &= ~IPU3_OUTPUT_HEIGHT_ALIGN;
+ pixelFormat = formats::NV12;
+ bufferCount = IPU3_BUFFER_COUNT;
+ streamFormats[pixelFormat] = { { minIPU3OutputSize, size } };
break;
case StreamRole::StillCaptureRaw: {
- cfg = data->cio2_.generateConfiguration(sensorResolution);
- cfg.bufferCount = 1;
+ StreamConfiguration cio2Config =
+ data->cio2_.generateConfiguration(sensorResolution);
+ pixelFormat = cio2Config.pixelFormat;
+ size = cio2Config.size;
+ bufferCount = cio2Config.bufferCount;
+
+ for (const PixelFormat &format : data->cio2_.formats())
+ streamFormats[format] = data->cio2_.sizes();
break;
}
@@ -339,12 +349,13 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,
* sensor resolution and aligned to the ImgU output
* constraints.
*/
- cfg.size.width = std::min(1280U, sensorResolution.width);
- cfg.size.height = std::min(720U, sensorResolution.height);
- cfg.size.width &= ~IPU3_OUTPUT_WIDTH_ALIGN;
- cfg.size.height &= ~IPU3_OUTPUT_HEIGHT_ALIGN;
- cfg.pixelFormat = formats::NV12;
- cfg.bufferCount = IPU3_BUFFER_COUNT;
+ size.width = std::min(1280U, sensorResolution.width);
+ size.height = std::min(720U, sensorResolution.height);
+ size.width &= ~IPU3_OUTPUT_WIDTH_ALIGN;
+ size.height &= ~IPU3_OUTPUT_HEIGHT_ALIGN;
+ pixelFormat = formats::NV12;
+ bufferCount = IPU3_BUFFER_COUNT;
+ streamFormats[pixelFormat] = { { minIPU3OutputSize, size } };
break;
}
@@ -356,6 +367,11 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera,
return nullptr;
}
+ StreamFormats formats(streamFormats);
+ StreamConfiguration cfg(formats);
+ cfg.size = size;
+ cfg.pixelFormat = pixelFormat;
+ cfg.bufferCount = bufferCount;
config->addConfiguration(cfg);
}