Domanda

I am trying to set the camera exposure points in iOS 5 (iPhone 4s test device):

if ([_videoDevice lockForConfiguration:nil])
{
    if ([_videoDevice isExposurePointOfInterestSupported])
    {
        [_videoDevice setExposurePointOfInterest:CGPointMake(0.2,0.2)];

        if ([_videoDevice isExposureModeSupported:AVCaptureExposureModeAutoExpose])
        {
            [_videoDevice setExposureMode:AVCaptureExposureModeAutoExpose];
            NSLog(@"Adjusting exposure: %d", [_videoDevice isAdjustingExposure]);
        }
    }
    [_videoDevice unlockForConfiguration];
}

According to the documentation "AVCaptureExposureModeAutoExpose" should set the exposure and then lock. My problem is that "isAdjustingExposure" always returns false. I even tried to set some sleeps but it remains at false state.

How can I correctly set the exposure point?

Regards,

È stato utile?

Soluzione

The trick is to set "AVCaptureExposureModeContinuousAutoExposure" and use key/value observing.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top