Question

I am using the back camera of an iphone4 and doing the standard and lengthy process of creating an AVCaptureSession and adding to it an AVCaptureDevice.

Before attaching the AvCaptureDeviceInput of that camera to the session, I am testing my understanding of white balance and exposure, so I am trying this:

[self.theCaptureDevice lockForConfiguration:nil];
[self.theCaptureDevice setWhiteBalanceMode:AVCaptureWhiteBalanceModeLocked];
[self.theCaptureDevice setExposureMode:AVCaptureExposureModeContinuousAutoExposure];
[self.theCaptureDevice unlockForConfiguration];

1- Given that the various options for white balance mode are in an enum, I would have thought that the default is always zero since the enum Typedef variable was never assigned a value. I am finding out, if I breakpoint and po the values in the debugger, that the default white balance mode is actually set to 2. Unfortunately, the header files of AVCaptureDevice does not say what the default are for the different camera setting.

2- This might sound silly, but can I assume that once I stop the app, that all settings for whitebalance, exposure mode, will go back to their default. So that if I start another app right after, the camera device is not somehow stuck on those "hardware settings".

Was it helpful?

Solution

After a bit more research and help, I found the answers:

1- All camera settings (White balance, Focus and exposure) default to their "continuous" setting so that the camera is continuously adjusting for all. Check AVCaptureDevice.h for enum values.

2- All apps function in silo. Camera stops when the app that calls it is moved to the background. When a new app calls the camera, the above defaults are set again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top