diff options
Diffstat (limited to 'src/android/camera_capabilities.cpp')
-rw-r--r-- | src/android/camera_capabilities.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp index 6b5edb66..6543c2bb 100644 --- a/src/android/camera_capabilities.cpp +++ b/src/android/camera_capabilities.cpp @@ -138,13 +138,14 @@ int CameraCapabilities::initialize(std::shared_ptr<libcamera::Camera> camera, return initializeStaticMetadata(); } -std::vector<Size> CameraCapabilities::getYUVResolutions(CameraConfiguration *cameraConfig, - const PixelFormat &pixelFormat, +std::vector<Size> CameraCapabilities::getYUVResolutions(const PixelFormat &pixelFormat, const std::vector<Size> &resolutions) { std::vector<Size> supportedResolutions; - + std::unique_ptr<CameraConfiguration> cameraConfig = + camera_->generateConfiguration({ StreamRole::Viewfinder }); StreamConfiguration &cfg = cameraConfig->at(0); + for (const Size &res : resolutions) { cfg.pixelFormat = pixelFormat; cfg.size = res; @@ -324,8 +325,7 @@ int CameraCapabilities::initializeStreamConfigurations() if (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) resolutions = getRawResolutions(mappedFormat); else - resolutions = getYUVResolutions(cameraConfig.get(), - mappedFormat, + resolutions = getYUVResolutions(mappedFormat, cameraResolutions); for (const Size &res : resolutions) { |