拍摄照片前访问设备相机的曝光值

我正在使用来自Brad Larson的精彩的GPUImage框架 ,并且在某个时刻我有一个AVCaptureDevice(来自GPUImageVideoCamera类的属性inputCamera)的实例,我想从拍摄之前读取实际的曝光值,如元数据信息这是创build的,但只有在照片拍摄之后。 有没有办法让这个价值生活?

设置一个AVCaptureSession,然后你可以从下面的实时获取曝光数据:

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection{ lightSamp++; if(lightSamp>30){ CFDictionaryRef metadataDictionary = CMGetAttachment(sampleBuffer, kCGImagePropertyExifDictionary, NULL); NSDictionary *metaDict= (__bridge NSDictionary*)metadataDictionary; NSLog(@"exposure %@",metaDict ); lightSamp=0; } } 

}