Sorry about the sketchy details. Basically I have a wrapper class for the Sequence Grabber, and I want to setup a delegate for the decompression callback.

This is where I use the respondsToSelector method:
static void SGVideoDecompTrackingCallback(
                void *decompressionTrackingRefCon,
                OSStatus result,
                ICMDecompressionTrackingFlags decompressionTrackingFlags,
                CVPixelBufferRef pixelBuffer,
                TimeValue64 displayTime,
                TimeValue64 displayDuration,
                ICMValidTimeFlags validTimeFlags,
                void *reserved,
                void *sourceFrameRefCon )
{
#pragma unused(reserved)
#pragma unused(sourceFrameRefCon)
        
        SGVideo* sgVideoChan = (SGVideo*)decompressionTrackingRefCon;
        id _delegate = sgVideoChan.delegate;
        
        if (result == noErr){
                
if ([_delegate respondsToSelector: @selector(SGDecompDataProc:)]){
                        
            [_delegate SGDecompDataProc:pixelBuffer
              trackingFlags:decompressionTrackingFlags
              displayTime:displayTime
              displayDuration:displayDuration
              validTimeFlags:validTimeFlags];
        }
    }
}


Header file where the function I am checking is prototyped:

@interface VideoController : NSObject {
        SeqGrab* mSeqGrab;
        SGVideo* mVideoChan;
        IBOutlet SampleCIView* mPreview;
}

-(void)SGDecompDataProc: (CVPixelBufferRef)pixelBuffer trackingFlags: (ICMDecompressionTrackingFlags)decompressionTrackingFlags displayTime: (TimeValue64)displayTime displayDuration:(TimeValue64)displayDuration validTimeFlags:(ICMValidTimeFlags)validTimeFlags;


@end

Please let me know if you need to see anything else. Once again I apologize for the sketchy details.

Thank you all for your help!

Carmen


On Aug 18, 2008, at 4:39 PM, Andy Lee wrote:

Also: note that method names are case-sensitive, so @selector(doSomething) is not the same as @selector(doSomeThing).

Also, if the method you are referring to takes an argument, make sure you aren't forgetting the colon at the end. The name of the method contains all its colons; @selector(doSomething) is different from @selector(doSomething:).

--Andy


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to