2014-12-26 7 views
0

을 충돌 나는이 다음 코드 :잠금 아이폰 OS 카메라 노출

-(void) startCameraCapture { 
    // start capturing frames 
    // Create the AVCapture Session 
    session = [[AVCaptureSession alloc] init]; 

    // create a preview layer to show the output from the camera 
    AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session]; 
    // Specify that the video should be stretched to fill the layer’s bounds. 
    previewLayer.videoGravity = AVLayerVideoGravityResize; 

    //previewView.frame = CGRectMake(126.0, 164.0, 64.0, 75.0); 


    previewLayer.frame = previewView.frame; 
    [previewView.layer addSublayer:previewLayer]; 

    // Get the default camera device 
    AVCaptureDevice* camera = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; 
    // get the current settings 
    [appDelegate loadSettings]; 
    [session startRunning];  
} 

내가 화면이 특정 밝기를 조정할 수 만에 카메라 장치의 노출을 고정 할 수있는 방법이 있나요?

죄송합니다.이 권리를 요청하지 않으면 죄송합니다.

감사합니다.

편집 :

내가 추가하는 시도 :

[camera setExposureModeCustomWithDuration:CMTimeMake(1,1) ISO:100 completionHandler:nil]; 

을하지만 앱에서 결과 만 그 줄에서 충돌. 애플의 문서에 따르면

+0

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/index.html#//apple_ref/occ/instm/AVCaptureDevice/setTorchModeOnWithLevel : error : – user523234

+0

'setExposureModeCustomWithDuration' 메소드 호출을 시도 할 때 오류가 발생합니다. 내가 뭐라고 부르는지 모르겠다. 내 AVCaptureDevice? – Tukajo

+0

@ Tukajo 혹시 이것을 알아 냈습니까? 나는 같은 문제가있다. –

답변

1

:이 방법이 처음 lockForConfiguration를 사용하여 수신기에 단독으로 액세스를 얻기없이 호출되는 경우 NSGenericException 예외가 발생

:.

그래서 앞에 줄을 추가

[camera lockForConfiguration:nil]; 
+0

위의 코드를 추가 한 후에도 여전히 [[camera setExposureModeCustomWithDuration : CMTimeMake (1,1) ISO : 100 completionHandler : nil]; – Tukajo