Output key being mashed the second time round

Mike_Cook's picture

I have an application in Xcode that uses a QC composition that merges two images to make a 3D stereo pair. It works the first time (for the first image I save) but on the second time the final image key is not valid. The other two are. This is the small section of code.

rImageData = [view valueForOutputKey:@"Right_Image_out"];

NSLog(@"one %@",[view valueForOutputKey:@"Left_Image_out"]); lImageData = [view valueForOutputKey:@"Left_Image_out"];

NSLog(@"two %@",[view valueForOutputKey:@"FinalImage"]); imageData = [view valueForOutputKey:@"FinalImage"];

The first time the LOG statement returns:- 2010-08-25 22:58:31.930 3D Slide Maker[738:a0f] two " )> but the second time it gives:- 2010-08-25 22:58:50.356 3D Slide Maker[738:a0f] -[NSCFNumber setBitmap:rowBytes:bounds:format:]: unrecognized selector sent to instance 0x1032f80 and then the application hangs. It used to work before Snow Leopard but not now.

Has any one got any idea about what is going wrong and how to correct it?

Thanks

vade's picture
Re: Output key being mashed the second time round

Have you called renderAtTime: on your QCRenderer more than once? I suspect QC's garbage collection is invalidating the output key. Unless you retain it yourself to re-use it, it will go away. If you call renderAtTime again, the key ought to be valid again.

Mike_Cook's picture
Re: Output key being mashed the second time round

Thanks:- but I have never called QCRenderer in my code. The image changes in response to sliders and I just want the current image.

The Garbage collection is set to off in Xcode so I would be surprised if it were that. Is there separate garbage collection in Quartz?