1
에 내 응용 프로그램을 얼려이 내 응용 프로그램AVCaptureConnection이 두 번째 호출
AVCaptureConnection *videoConnection = [videoOutput connectionWithMediaType:AVMediaTypeVideo];
if ([videoConnection isVideoOrientationSupported])
{
[videoConnection setVideoOrientation:AVCaptureVideoOrientationPortrait];
}
을 정지 내 코드는 내가 두 번째로 내 응용 프로그램 정류장에서 세션을 초기화 할 때이 내 videoOutput 초기화
// Setup video capture
videoInput = [[AVCaptureDeviceInput deviceInputWithDevice: front? frontVideoDevice: rearVideoDevice error: &error] retain];
videoOutput = [[AVCaptureVideoDataOutput alloc] init];
[videoOutput setAlwaysDiscardsLateVideoFrames: YES];
// Set the video output to store frame in BGRA (It is supposed to be faster)
NSString* key = (NSString*)kCVPixelBufferPixelFormatTypeKey;
NSNumber* value = [NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA];
NSDictionary* videoSettings = [NSDictionary dictionaryWithObject:value forKey:key];
[videoOutput setVideoSettings:videoSettings];
입니다 응답하지만 avcaptureconnection 코드를 제거하면 모든 것이 정상입니다.
?
나쁜. 디버거를 통해 두 번째로 호출하려고하는 유효한 객체 인'videoOutput'이 있는지 확인할 수 있습니까? 정확한 오류 메시지를 게시 할 수 있습니까? – Pfitz
그게 문제가 아니며 videoOutput이 제대로 할당되었습니다. 하지만 이제는 AVCaptureSessionRuntimeErrorNotification을 얻었습니다. – Janub
예외 중단 점을 설정 했습니까? – Pfitz