Chr*_*ris 6 avfoundation ios avcapturesession
我有一个类似于Apple的AVCam演示的视频摄像机视频.我遇到了一个非常令人沮丧的问题,我不知道如何进行调试.
基本上,我们谈论的是视频控制器上的摄像机设置.当VC出现时,预览层应显示相机看到的内容,并在按下录制按钮后开始录制到文件.
这有20%的时间.其余时间,VC正常加载,但预览层在1-3秒后冻结.一旦冻结,我就不会抛出任何崩溃或错误[编辑:不正确,见下文].但是,如果我在冻结后点击了记录,则会触发一次调用
[self.fileOutput startRecordingToOutputFileURL:currentVideoURL recordingDelegate:self];
Run Code Online (Sandbox Code Playgroud)
我立即接到对AVCaptureFileOutputRecordingDelegate方法的调用
-(void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error
Run Code Online (Sandbox Code Playgroud)
设置了NSError对象,错误代码为-11803 {AVErrorSessionNotRunning}.这个方法肯定在调用[captureSession startRunning]之后运行.
UPDATE
有些事情导致会话立即中断.捕获开始后,captureSession.isInterrupted几乎立即设置为TRUE,并在启动会话时立即触发以下通知:
AVCaptureSessionWasInterruptedNotification
AVCaptureSessionDidStopRunningNotification (edit -- had the wrong const here)
Run Code Online (Sandbox Code Playgroud)
什么可能导致会话在启动后立即中断?
是否有任何可能导致AVCaptureSession被中断的事件的文档?
| 归档时间: |
|
| 查看次数: |
799 次 |
| 最近记录: |