I have a program to take a video with default parameters, and the Exposure, Focus and White Balance will be adjusted automatically when I move the camera. I want to add 2 buttons in the program: LOCK and PRESET. When the LOCK button is pressed, the exposure, focus and white balance will be fixed, and their values will be stored as user settings. The PRESET button is to set the user settings to the camera, to make sure we can take all the videos with the same exposure, focus and white balance values.

The lock part is easy, I just have to change the mode, so I would like to know if there is any way to get and set values for exposure, focus and white balance.

Take exposure for example,by default, the exposureMode is set to AVCaptureExposureModeContinuousAutoExposure, that means, when I hold the iPhone to take a video, the exposure will be adjusted automatically to ensure that we can see the scene clearly in bright or dark environment.

AVCaptureDevice* pCaptureDevice = [self videoDeviceWithPosition:AVCaptureDevicePositionBack];
[pCaptureDevice lockForConfiguration:nil];
[pCaptureDevice setExposureMode:AVCaptureExposureModeContinuousAutoExposure];
[pCaptureDevice unlockForConfiguration];

When the LOCK button is pressed, I change the exposureMode to AVCaptureExposureModeLocked, so the current exposure value will not be changed anymore.

[pCaptureDevice lockForConfiguration:nil];
[pCaptureDevice setExposureMode:AVCaptureExposureModeLocked];
[pCaptureDevice unlockForConfiguration];

However, how can I get the exposure value at that moment when the button is pressed? And what's more important, how can I set the exposure value back to the AVCaptureDevice when PRESET is pressed.

I searched in the forum and only found Michael Grinich's post: Accessing iOS 6 new APIs

Edit
Report