Hi list !

In my application I display still images and videos.
For best performances, I use a display link and also Apple's plugin FastImage.

For images everything is just fine.

For movies I was considering if it could bring any performance enhancement to pass the video frames to a FastImage plugin instead of an Image input port.
I used to pass my movie frames like this :


        //Check if a new frame is available from the movie
        if(QTVisualContextIsNewImageAvailable(qtVisualContext, time)) {
                CVOpenGLTextureRef texture = NULL;
if( QTVisualContextCopyImageForTime(qtVisualContext, nil, time, &texture) == noErr ){ // get the texture for the frame // the above call may produce a null texture so we must check for this first
                        if(texture != NULL){
                                //Pass updated movie frames cache to the 
composition
                                if(![renderer setValue:(id)texture 
forInputKey:kVideoImageInputKey])
NSLog(@"[Area %...@] Could not pass frames cache to composition", areaId);
                        }
                }
                CVOpenGLTextureRelease(texture);
        }

I changed it to the following :

        //Check if a new frame is available from the movie
        if(QTVisualContextIsNewImageAvailable(qtVisualContext, time)) {
                CVOpenGLTextureRef texture = NULL;
if( QTVisualContextCopyImageForTime(qtVisualContext, nil, time, &texture) == noErr ){ // get the texture for the frame // the above call may produce a null texture so we must check for this first
                        if(texture != NULL){
                                NSMutableDictionary*            arguments = 
[NSMutableDictionary dictionary];
[arguments setObject:[NSNumber numberWithUnsignedInt:CVOpenGLTextureGetName(texture)] forKey:kArgumentKey_TextureName]; [arguments setObject:[NSNumber numberWithUnsignedInt:areaWidth] forKey:kArgumentKey_TextureWidth]; [arguments setObject:[NSNumber numberWithUnsignedInt:areaHeight] forKey:kArgumentKey_TextureHeight];
                        #if __BIG_ENDIAN__
[arguments setObject:QCPlugInPixelFormatARGB8 forKey:kArgumentKey_TextureFormat];
                        #else
[arguments setObject:QCPlugInPixelFormatBGRA8 forKey:kArgumentKey_TextureFormat];
                        #endif
[arguments setObject:(id)_textureColorSpace forKey:kArgumentKey_TextureColorSpace];
                                return arguments;
                        
                        }
                }
                return nil;
        }
        return nil;

I also modified the FastImage plugin to have it keep displaying the old frame if there is no new one. Unfortunately instead of having a performance improvement I had a performance drop (and a KP).

Am I going in the right direction?
Is there any performance improvement possible?
Am I leaking somewhere (I guess that's why I had a kernel panic)


Thanks in advance

Fabrice Pipart

www.easyshadow.com
EasyMediaOnline
Digital Signage Software

AIM : fabricepipart
Skype: fabrice.pipart
Tel.  (877)-ESIGN-4U ext 69
Int.  +1-(877)-374-4648
Fax  +1-(877) 298-5108

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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]

Reply via email to