このメソッドでAVCaptureVideoDataOutputを初期化します。
// Setup the video output
_videoOutput = [[AVCaptureVideoDataOutput alloc] init];
_videoOutput.alwaysDiscardsLateVideoFrames = YES;
_videoOutput.minFrameDuration = kCMTimeZero;
_videoOutput.videoSettings =
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA],(id)kCVPixelBufferPixelFormatTypeKey
,AVVideoCodecH264, AVVideoCodecKey, nil];
// Setup the audio output
_audioOutput = [[AVCaptureAudioDataOutput alloc] init];
NSLog(@"dispatch_queue_t");
// Setup the queue
dispatch_queue_t queue = dispatch_queue_create("MyQueue", NULL);
[_videoOutput setSampleBufferDelegate:self queue:queue];
[_audioOutput setSampleBufferDelegate:self queue:queue];
dispatch_release(queue);
そして、私はデリゲートメソッドという問題を抱えています:
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
は呼び出されません。IOS4では、このメソッドが呼び出されますが、なぜそれが発生するのでしょうか。