From ff9d9e3fa4eb3d3b0b4ab15b9aa96aae143c81ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Mon, 28 Nov 2011 09:03:19 +0100 Subject: [PATCH] click: fix camera failure after zoom usage libcamera was changing the image resolution without updating mRawWidth and mRawHeight, and this caused initRaw to take pictures with the previous resolution. If that resolution was unsuitable because of zoom level, it would cause the camera to fail until it was restarted. This patch updates both variables to reflect the modified resolution so initRaw always takes pictures with the correct width and height. Change-Id: I33e8445a65ac667a030b35b103f86be46381abc4 --- libcamera/QualcommCameraHardware.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcamera/QualcommCameraHardware.cpp b/libcamera/QualcommCameraHardware.cpp index d4e5d16..e2c96e3 100644 --- a/libcamera/QualcommCameraHardware.cpp +++ b/libcamera/QualcommCameraHardware.cpp @@ -2015,7 +2015,9 @@ void QualcommCameraHardware::setZoom() multiplier = getParm("picture-size", picturesize); LOGV("Reducing picture quality; new multiplier: %d", multiplier); } - level = zoomsel * (iscamcorder ? (multiplier*5)/6 : 5); + level = zoomsel * (iscamcorder ? (multiplier*5) / 6 : 5); + //Update the parameters so initRaw doesn't use the wrong size later + mParameters.getPictureSize(&mRawWidth, &mRawHeight); LOGV("Level: %d, Multiplier: %d ZoomSel: %d",level,multiplier,zoomsel); } } else {