| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Greetings. I have a Quartz Composer based application in which ive recently replaced my quicktime player (which used Quartz Composers Movie patch and a QCRenderer) with a displaylink driven core video 'pipeline' based on QTCoreVideo101 for quicktime playback. Currently my displaylink QT player is passing a CIImage to my QC patch renderers (which I call a 'layer') on request, via imageWithCVImageBuffer:. My Layer rendering is decoupled and not driven by my display link QT player, similar to "http://lists.apple.com/archives/quartz-dev/2005/Dec/msg00013.html", so my QT sources are display linked, and the rest of my pipeline which uses QCRenderers us the timer approach. I do not have issues with stuttering or black frames. In fact, things are very fast and I am pretty happy this system (when it works!) For reference,my display link driven QT player retains a CIImage when there is no new frame available, and updates the CIImage if there is a frame available like so: from mediaSource class - barely modified QTCoreVideo101 sans comments: - (CVReturn)getFrameForTime:(const CVTimeStamp*)timeStamp flagsOut:(CVOptionFlags*)flagsOut { NSAutoreleasePool *pool = [NSAutoreleasePool new]; if (textureContext != NULL && QTVisualContextIsNewImageAvailable(textureContext, timeStamp)) { if (NULL != currentFrame) { CVOpenGLTextureRelease(currentFrame); currentFrame = NULL; } OSStatus status = QTVisualContextCopyImageForTime(textureContext, NULL, timeStamp, ¤tFrame); if ((noErr == status) && (NULL != currentFrame)) { [self drawRect:NSZeroRect]; // update our reference CIImage only when we have a new frame. [self setCurrentFrameAsCIImage]; } } [pool release]; return kCVReturnSuccess; } and my setCurrentFrameAsCIImage call: -(void)setCurrentFrameAsCIImage { [currentFrameAsCIImage release]; currentFrameAsCIImage = nil; currentFrameAsCIImage = [[CIImage imageWithCVImageBuffer:currentFrame] retain]; } And then I just return my currentFrameAsCIImage upon request from my other timer based QCRendering thread in my main app. As I understand this, currentFrameAsCIImage should always have the most recent frame in it. However, I am having some odd issues I cannot track down, and would love some clarification on a few points from more experienced developers, specifically with regards to using locks around opengl contexts/threads since Im now using display link. Prior to upgrading to displaylink/core video my application had no crashers I was aware of, and I did not retain any images in my layer/QCrendering method when passing my input/output keys to my Quartz patches. Now passing the CIImage from my setCurrentFrameAsCIImage method, I have crashes occasionally if I resize a window with an NSOpenGLView which is rendering the output of my layers (serially renderer QC patches), or occasionally if turn on a QC driven 'effect' within a layer. What do I have to do differently now that I have a CIImage driven from display links CVBufferRef? Do I need to introduce locks within my main application controller class when rendering the QCRenders chain, or retain my QCPortType images in my main QCRenderer thread? Ive tried both (but perhaps doing so incorrectly). Does anyone have any advice? Thank you for reading, and im well aware this issues is rather abstract, so I appreciate any pointers no matter how vague. Thanks, |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.