>> On Dec 2, 2012, at 22:02 , gary.gard...@brokensoftware.com wrote:
>>
>>> Can anyone tell me what the next steps are?  Any snippets of code that
>>> I
>>> can look at?  I'm sure I'm not the first to try to do this.
>>
>> Have you looked here?
>>
>>      
>> https://developer.apple.com/library/mac/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html
>>
>> It seems pretty explicit about how to get video frames, and there are
>> code
>> fragments you can use.
>>
>>
>>
>
> Quincey,
>
> That's what I have been reading for the past few days and I'm waiting on
> the light to dawn.  I think I am missing some small bit as I am getting an
> error.
>
> I will keep digging. I'm sure I'll figure out this last 5% somehow.
>
> Thanks
>

Quincey,

I also found this example -->
https://developer.apple.com/library/ios/#qa/qa1702/_index.html

Of course there are some issues with it as it's from IOS, but I assume
this is the pattern that is supposed to be used.  Using this pattern, I
get a little further.  Below is a snippet of my code.  Ignore that fact
that I have a few things out of order:


- (void)setSelectedVideoDevice:(AVCaptureDevice *)selectedVideoDevice
{
        [[self session] beginConfiguration];

        if ([self videoDeviceInput]) {
                // Remove the old device input from the session
                [session removeInput:[self videoDeviceInput]];
                [self setVideoDeviceInput:nil];
        }

        if (selectedVideoDevice) {
                NSError *error = nil;

                // Create a device input for the device and add it to the 
session
                AVCaptureDeviceInput *newVideoDeviceInput = 
[AVCaptureDeviceInput
deviceInputWithDevice:selectedVideoDevice error:&error];
                if (newVideoDeviceInput == nil) {
                        dispatch_async(dispatch_get_main_queue(), ^(void) {
                                [self presentError:error];
                        });
                } else {
                        if (![selectedVideoDevice 
supportsAVCaptureSessionPreset:[session
sessionPreset]])
                                [[self session] 
setSessionPreset:AVCaptureSessionPresetHigh];

                        [[self session] addInput:newVideoDeviceInput];
                        [self setVideoDeviceInput:newVideoDeviceInput];


            AVCaptureVideoDataOutput *output = [[AVCaptureVideoDataOutput
alloc] init];
            [session addOutput:output];

            // Configure your output.
            dispatch_queue_t queue = dispatch_queue_create("myQueue", NULL);
            [output setSampleBufferDelegate:self queue:queue];
            dispatch_release(queue);

                }

        }

        [[self session] commitConfiguration];
}

The setSampleBufferDelegate:self queue:queue gives a warning in XCode that
says Sending '<my object name here>' to parameter of incompatible type
'id'<AVCaptureVideoDataOutputSampleBufferDelegate>'

I am not sure how to fix this.  Any thoughts would be helpful.  And yes I
am a newbie when it comes to Objective-C and Mac development.  So not
everything is totally clear to me on using this framework.
_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to