Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using QC Composition as Plugin [solved]



OK -- I figured it out. I was using the Open GL context provided by a NSOpenGLView. This doesn't work -- it seems to be a requirement that it come from a NSOpenGLContext. After switching to NSOpenGLContext, the output of the plugin now is gettable.

Best,
Mark


// if there is a frame available from a quicktime movie
if(QTVisualContextIsNewImageAvailable(_visualContext, NULL) && (QTVisualContextCopyImageForTime(_visualContext, NULL, NULL, &imageBuffer) == kCVReturnSuccess)) {
// convert frame to a CIImage
CIImage* inputImage = [CIImage imageWithCVImageBuffer:imageBuffer];
// send the new CIImage to the renderer input
if(![_renderer setValue:inputImage forInputKey:kRendererImageInput])
NSLog(@"Could not pass frames cache to composition");

It's better to pass directly the CVImageBuffer (see http://developer.apple.com/technotes/tn2005/tn2143.html)

OK -- that's a good point. But in my actual application, I'll almost always being passing in CIImage -- so I did the conversion just to test that I could do it.


Nevertheless, I changed the code to pass the CVImageBuffer instead. Still no output.


// tell it to render
// ??? Can I pass 0 for the time ???
[_renderer renderAtTime:0 arguments:NULL];

Yes 0 is definitely a valid value

// get the output image
NSImage* outImage = [_renderer valueForOutputKey:kRendererImageOutput];
if(!outImage)
        NSLog(@"Could not get output image to composition");

The problem is that the output image is always NULL. Any ideas?

Can you post the composition somewhere - it's difficult to say without seeing it?

Well, it's pretty simple. It's one module: Crystallize, with the Image input published as 'imgin' and the Image output published as 'imgout'.


Is there anything about the Crystallize module itself that would cause it not to work?

I tried changing it to "Color Invert" but it still didn't work.

Best,
Mark

--
=====================================================================
Mark Coniglio, Artistic Co-Director | email@hidden
Troika Ranch Dance Theater          | http://www.troikaranch.org
=====================================================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden


--
=====================================================================
Mark Coniglio, Artistic Co-Director | email@hidden
Troika Ranch Dance Theater          | http://www.troikaranch.org
=====================================================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden
References: 
 >Using QC Composition as Plugin (From: Mark Coniglio <email@hidden>)
 >Re: Using QC Composition as Plugin (From: Pierre-Olivier Latour <email@hidden>)
 >Re: Using QC Composition as Plugin (From: Mark Coniglio <email@hidden>)
 >Re: Using QC Composition as Plugin (From: Pierre-Olivier Latour <email@hidden>)
 >Re: Using QC Composition as Plugin (From: Mark Coniglio <email@hidden>)



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.