Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: QTNewGWorld
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QTNewGWorld



On Oct 16, 2006, at 11:24 AM, Matt wrote:

I'm trying to create/use an offscreen buffer for a
movie.  BTW, "theMovie" referenced below was created
with no errors using "NewMovieFromDataRef"

I'm getting a crash in "SetMovieGWorld" after I create
the GWorld using "QTNewGWorld".

Here's my code:

// ----
void** ppOutGWorld; // off-screen buffer
Rect theBounds = {0,0,242,192};
err = QTNewGWorld(
  (GWorldPtr*)ppOutGWorld,
  k32ARGBPixelFormat, &theBounds, NULL, NULL, 0);

if (noErr == err)
 LockPixels(
  GetGWorldPixMap(*(GWorldPtr*)appOutGWorld));

// set the movie to draw into that GWorld.
SetMovieGWorld(theMovie,
 *(*(GWorldPtr**)appOutGWorld), nil);
// ----

Can anybody help me here?

Not knowing anything else, I noticed two things in your code above:

1. ppOutGWorld is a void** instead of a GWorldPtr, which you then have to repeatedly cast. Any reason you couldn't just use the proper data type?

2. SetMovieGWorld is not bounded by the check to see that the GWorld was successfully created. You shouldn't be doing -anything- with that GWorld unless QTNewGWorld succeeded.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >QTNewGWorld (From: Matt <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.