QTKit mCaptureDecompressedVideoOutput을 통해 얻은 NSCIImageRep을 그리는 데 문제가 있습니다. NSView에 NSCIImageRep을 그리는 방법
내가 OpenGL을 사용하여 이미지를 그리려하지 않는
, 나는 NSView의 서브 클래스 거기 이미지를 그리는 시도 :- (void) drawRect:(NSRect)dirtyRect
{
NSLog(@"DrawInRect");
CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
if (imageRep != nil)
{
CGImageRef image = [imageRep CGImageForProposedRect: &dirtyRect context: [NSGraphicsContext currentContext] hints:nil];
CGContextDrawImage(myContext, dirtyRect, image);
CGImageRelease(image);
}
}
imageRep 내가 mCaptureDecompressedVideoOutput 콜백을 통해 얻으 CGImageRef에 대한 포인터입니다
- (void)captureOutput:(QTCaptureOutput *)captureOutput didOutputVideoFrame:(CVImageBufferRef)videoFrame withSampleBuffer:(QTSampleBuffer *)sampleBuffer fromConnection:(QTCaptureConnection *)connection`.
이 코드는 내 컴퓨터를 고장납니다. 어떤 제안?
당신이 충돌에서 스택 추적을 게시 할 수 있습니까? –