I filed a bug report against this, but until there's an update I use
the following code to get around it. Note that this is inside a
PowerPlant application so I use LGWorld for my offscreen drawing, if
you're not using PowerPlant, just allocate and use a GWorld directly.
Also, the movie is in PowerPlant movie controller class, so
substitute your movie for all references to mMovieView->GetMovie().
// Get the current frame into a PicHandle
PicHandle thePict;
OSErr theErr = noErr;
// Let QuickTime get it for us if possible
thePict = ::GetMoviePict(mMovieView->GetMovie(),theCurTime);
if (thePict EQ NULL)
{
theErr = ::GetMoviesError();
// Fix for problem with QuickTime 7.0.1 and MPEG4 encoded .avis
if (theErr EQ cDepthErr) // If we get a cDepthErr, then do the
heavy lifting ourselves
{
theErr = noErr; // Clear the error flag so we can fall through
to the throw if necessary
Rect frame; // This will be the Rect for the movie and the pict
Rect globalFrame; // Only we also need it in global coords
LGWorld * lGWorld = nil;
CGrafPtr movieGWorld;
::GetMovieBox(mMovieView->GetMovie(),&frame); // Get the movies box frame
::GetMovieGWorld(mMovieView->GetMovie(),&movieGWorld,NULL); //
Get the movie's GWorld
frame.bottom -= 20; // Adjust for the controller
globalFrame = frame;
::QDLocalToGlobalRect(movieGWorld,&globalFrame); // Must
convert to global coords for movie port
lGWorld = new LGWorld(frame); // Make a GWorld to create the pict in
if (lGWorld EQ nil) // Only reason to fail is...
theErr = memFullErr; // ...we don't have enough memory
else
{
OpenCPicParams newHeader; // Set up the new pict
newHeader.srcRect = frame;
newHeader.hRes = 0x00480000;
newHeader.vRes = 0x00480000;
newHeader.version = -2;
newHeader.reserved1 = 0;
newHeader.reserved2 = 0;
lGWorld->BeginDrawing(); // Now blast the movie frame into the pict
- Craig
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden