Hello
I am attempting to optimize and de-couple parts of my Quartz Composer
application.
I would like to move to QTkit to play back my QT movies and not rely
on QCs movie player patch for various reasons.
I am attempting to use the
[QTMovie frameAtTime: withAttributes: error:]
method to create an CVOpenGLTextureRef to efficiently pass my QT
movies frames to my QC compositions with the eventual thought of
moving decoding to another thread. However I cannot seem to get the
basic call to work quickly/efficiently at all. I can either get a VERY
low framerate output if I choose to output an NSImage, or black if I
choose to output a CVOpenGLTextureRef.
I am confused on one point with regards to the GL Contexts. When
creating the dictionary for output for the frameAtTime: withAttributes
method, which OpenGL context and pixelformat should I be referencing?
Should I be referencing the GLContext in which the QCRenderers live,
or.. do I use the context that the movie uses for decoding (Im
assuming it has one since I can access the key). Either way I return a
black frame, but its much faster than the NSImage method ;) ;)
Note I am not using displaylink (yet) for the callback, I am simply
requesting the output image during my rendering loop for the
QCRenderers.
Apologies if this content is inappropriate for this mailing list.
Some code:
// using the movies 'gl context'?
-(id) getLatestMovieFrame
{
NSDictionary *imageAttrs = [NSDictionary
dictionaryWithObjectsAndKeys:
QTMovieFrameImageTypeCVOpenGLTextureRef,
QTMovieFrameImageType,
[testMovie
attributeForKey
:@"QTMovieFrameImageOpenGLContext"],QTMovieFrameImageOpenGLContext,
[testMovie
attributeForKey
:@"QTMovieFrameImagePixelFormat"] ,QTMovieFrameImagePixelFormat,
[NSNumber numberWithBool:NO],
QTMovieFrameImageHighQuality,
[NSNumber numberWithBool:NO],
QTMovieFrameImageDeinterlaceFields,
nil];
return [testMovie frameImageAtTime:[testMovie currentTime]
withAttributes:imageAttrs error:nil];
}
// using the renderers gl context
-(id) getLatestMovieFrame
{
NSDictionary *imageAttrs = [NSDictionary
dictionaryWithObjectsAndKeys:
QTMovieFrameImageTypeCVOpenGLTextureRef,
QTMovieFrameImageType,
[v001GLContext CGLContextObj]
,QTMovieFrameImageOpenGLContext,
[v001GLPixelFormat
CGLPixelFormatObj] ,QTMovieFrameImagePixelFormat,
[NSNumber numberWithBool:NO],
QTMovieFrameImageHighQuality,
[NSNumber numberWithBool:NO],
QTMovieFrameImageDeinterlaceFields,
nil];
return [testMovie frameImageAtTime:[testMovie currentTime]
withAttributes:imageAttrs error:nil];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]