我有以下代码:
-(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];
但这只会导致应用程序在该行崩溃。