jjzjj

commitConfiguration

全部标签

IOS8:录制到文件并使用 AVCaptureSession/commitConfiguration 时,相机预览会闪烁

从IOS8开始,我在使用commitConfiguration时遇到了一个奇怪的问题我们通过AVCaptureMovieFileOutput录制5秒的文件。更改文件时,相机预览会闪烁并逐渐变黑一秒钟。在接收服务器上拼接文件时也有卡顿现象。//methodthatswitchestheoutputfile-(void)switchOutputFile{NSURL*outputUrl=[selfgetOutputFileUrl];NSLog(@"Switchingto:%@",outputUrl);//beginconfiguration[self.captureSessionbeginC

swift defer 语句不会断点但会打印

我把一个defer放在一个do里面,就像这样do{defer{self.captureSession?.commitConfiguration()print("commitConfiguration")}self.captureSession?.beginConfiguration()//tryabunchAVsessionsetupcalls...}catch{//error}我试图放置一个断点以确保延迟block在最后进入。令我惊讶的是,它没有。我检查了文档,运行了应用程序,似乎没有任何问题。所以我放了一个打印语句。你瞧,它确实打印了它,表明它可能确实执行了,即使调试断点从未被激活

ios - AVCaptureSession 无法在对 beginConfiguration/commitConfiguration 的调用之间开始运行

我正在尝试使用Zxing读取QR码:self.capture=[[ZXCapturealloc]init];self.capture.rotation=90.0f;//Usethebackcameraself.capture.delegate=self;self.capture.camera=self.capture.back;self.capture.layer.frame=self.view.bounds;[self.view.layeraddSublayer:self.capture.layer];我收到这个错误:*由于未捕获的异常“NSGenericException”而终止应