2014-01-26 3 views
2

AVFoundation을 사용하여 카메라 응용 프로그램을 구현하려고합니다.iPhone 5 : iOS 7에서 AVCaptureExposureModeAutoFocus가 지원되지 않습니다.

AVCaptureExposureModeAutoExpose이 : 나는 시점에서 exposurePointOfInterest을 설정 한 다음 애플의 문서에 의해 설명 된대로 노출을 고정하기 위해 AVCaptureExposureModeAutoFocus를 사용하려면이 장치가 자동으로 노출을 한 번 조정하고 다음에 대한 노출 모드를 변경 AVCaptureExposureModeLocked.

-(void)autoExposeAtPoint:(CGPoint)point 
{ 
    AVCaptureDevice *device = [videoInput device]; 
    if([device isExposurePointOfInterestSupported] && [device isExposureModeSupported:AVCaptureExposureModeAutoExpose]){ 
     if([device lockForConfiguration:NULL]){ 
      [device setExposurePointOfInterest:point]; 
      [device setExposureMode:AVCaptureExposureModeAutoExpose]; 
      [device unlockForConfiguration]; 
      NSLog(@"Exposure point of intereset has been set to (%f,%f)",point.x, point.y); 
     } 
    } 
} 

그러나, 원하는 지점에서 자동 노출 그냥 이런 일이 없었는데 :

은 내가 사용하는 기능입니다. 아래 NSLog를 사용하여 디버깅 할 때 AVCaputreExposureModeAutoExpose은 지원되지 않습니다. 반면, AVCaptureExposureModeContinuousAutoExpose을 사용하면 완벽하게 실행됩니다.

나는 이것을 이해하지 못한다. 이 AVCaputreExposureModeAutoExpose은 iOS7을 실행하는 iPhone 5의 후면 카메라에서 지원되지 않습니다. 누구나 단서가 있습니까? 감사!

디버그 코드 :

NSLog(@"issupported: %hhd", [device isExposurePointOfInterestSupported]); 
NSLog(@"ismodesupported: %hhd" ,[device isExposureModeSupported:AVCaptureExposureModeAutoExpose]); 

**Result:** 
issupported: 1 
ismodesupported: 0 

답변

2

나는 애플 개발자 포럼에이 질문을 게시 브래드 포드 (코어 미디어 공학과) 애플의 WWDC에서 AV 재단과 카메라의 스피커 응답되었다.

올바른 :

여기에 자신의 answer입니다. AVCaptureExposureModeAutoExpose는 헤더에 정의되어 있지만 현재 모든 iOS 장치에 구현되어 있지 않습니다.

당신은 그러나 다음 setExposureMode 전화, 관심의 원하는 지점을 설정하여 자신의 코드에서 구현할 수 있습니다 AVCaptureExposureModeContinuousAutoExposure을하고 은 (키 - 값 관찰) AVCaptureDevice의 "isAdjustingExposure"속성을 듣고 노출 조정이 완료되면 알 수 있습니다. 이 나오면 곧바로 AVCaptureExposureModeLocked로 설정하십시오.

+0

관련 키는 실제로 "adjustmentExposure"입니다. – nrj

관련 문제