Cocoa, QuickTime, and sequence grabbing...
Cocoa, QuickTime, and sequence grabbing...
- Subject: Cocoa, QuickTime, and sequence grabbing...
- From: Michael George <email@hidden>
- Date: Thu, 10 Jul 2003 12:10:38 -0400
I am writing an application that grabs vide from a video source (via QT
codecs) and saves it in a file as well as displays it in a window.
I have started with SGDataProc and that works fine as a start.
However, I want to stop and restart the sequence grabber. Not only
that, but I'd like to completely end the grab and reinitialize the
sequence grabber.
I have added a new action to MyObject (from SGDataProc):
-(IBAction)reinit:(id)sender
{
NSLog( @"MyObject::reinit() called" );
[view endGrab];
OSErr err = [view doSeqGrab:[view bounds]];
NSLog( @"MyObject::reinit() [view doSeqGrab] returned %d", err );
}
moved the MyQuickDrawView object down in the Cocoa window and added a
button which will call MyObject::reinit() when pressed.
Very simple, it would seem.
I can start the app and it's grabbin' frames every 1/10s, just like it
should.
However, when I press the reinit button, the video stops as it should
but then I get an error panel which just says: "Error -50". When I
press the "OK" button, the panel reappears, ad infinitum.
Looking at the run pane, I see that reinit() is called, and [view
doSeqGrab: [view bounds]] returns 0, as it should.
My first guess is that when setupDecomp() is called, the
MyQuickDrawView object doesn't have focus, and therefore the return
from qdPort() is invalid and therefore the draw will fail. So, I
surround the DecompressSequenceBegin() call which uses the return from
[self qdPort] with a matched pair of [self lockFocus]/[self
unlockFocus] calls to lock teh focus to the MyQuickDrawView obect while
making the call to [self qdPort], but the result is the same.
I've googled for "quicktime sequence grabber error -50" and checked
Apple's archives (cocoa-dev and quicktime-api) for " "error -50"
sequence grab", but have found nothing helpful...
-Michael
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.