I am using the iphone4 rear camera and following the standard and lengthy process of creating an AVCaptureSession and adding AVCaptureDevice to it.
Before attaching the AvCaptureDeviceInput of this camera to the session, I check my understanding of white balance and exposure, so I try:
[self.theCaptureDevice lockForConfiguration:nil]; [self.theCaptureDevice setWhiteBalanceMode:AVCaptureWhiteBalanceModeLocked]; [self.theCaptureDevice setExposureMode:AVCaptureExposureModeContinuousAutoExposure]; [self.theCaptureDevice unlockForConfiguration];
1- Given that the various parameters of the white balance mode are in the enumeration, I would have thought that the default value is always zero, since the Typedef enumeration variable was never assigned a value. I found that if I stay at the breakpoint and change the values in the debugger, then the default white balance mode is actually set to 2. Unfortunately, the AVCaptureDevice header files do not say that by default for different camera settings.
2- This may seem silly, but can I assume that as soon as I stop the application, all the settings for white balance, exposure mode will return to their default. So, if I launched another application right after that, the camera device did not somehow get stuck on these “hardware settings”.
source share