Setting White balance and Exposure mode for iphone camera + enum default

Posted by Spectravideo328 on Stack Overflow See other posts from Stack Overflow or by Spectravideo328
Published on 2012-11-06T17:13:49Z Indexed on 2012/11/07 23:00 UTC
Read the original article Hit count: 246

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".

© Stack Overflow or respective owner

Related posts about ios

Related posts about opengl-es