QuickTime!

hi all!

im try to get a sdl surface plaing a quick time video!

so far i got this:

SDL_Surface *g_screen = SDL_SetVideoMode(800, 600, 32, SDL_HWSURFACE |
SDL_NOFRAME);

Movie theMovie;
Str255 l_path = “mov.mov”;
FSSpec fileSpec;

CGrafPtr windowPort;
short theFile;
FSMakeFSSpec(0, 0L, l_path, &fileSpec);
windowPort = GetNativeWindowPort(g_screen);
SetGWorld(windowPort, nil);
OpenMovieFile(&fileSpec, &theFile, fsRdPerm);
NewMovieFromFile(&theMovie, theFile, nil, nil, newMovieActive, nil);

at:

windowPort = GetNativeWindowPort(g_screen);

i get this error
error C2440: ‘=’ : cannot convert from ‘GrafPtr’ to ‘CGrafPtr’

windowPort = GetNativeWindowPort((GrafPtr(g_screen)));

samething…

can anyone help me out?

thx

Quoth Golgoth! , on 2005-03-17 03:01:36 +0000:

at:

windowPort = GetNativeWindowPort(g_screen);

i get this error
error C2440: ‘=’ : cannot convert from ‘GrafPtr’ to ‘CGrafPtr’

And how is this an SDL problem?

—> Drake Wilson
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050316/ece311aa/attachment.pgp

… ok i ll rephrase the question then …

anyone ever play video throught an sdl surface?

if yes… what will be the right graphic port to use?

thx

Golgoth! wrote:

… ok i ll rephrase the question then …

anyone ever play video throught an sdl surface?

Yes, using SDL overlays (YV12).

if yes… what will be the right graphic port to use?

For what I can see from your original code a ‘Graphic Port’ is something
similar to a win32 Drawing Context, you don’t have a DC or a Graphic
Port in SDL, but you can access directly the surface both in RGB and YUV
format, so you need a lower level API call from the codec that let you
specify your bitmap format and pointer OR to render on a fake bitmap
provided by the codec and then move it to the SDL surface.

Bye,
Gabry

Golgoth! wrote:

… ok i ll rephrase the question then …

anyone ever play video throught an sdl surface?

if yes… what will be the right graphic port to use?

The “Graphic Port” concept doesn’t apply to SDL.

You need to have QuickTime decode to a memory buffer and display that
memory buffer on the screen.

Use QTNewGWorldFromPtr on a block of memory you’ve allocated, and have
QuickTime render into that with SetMovieGWorld. If you’re really lucky,
you can use SDL’s screen surface for the block of memory and save the
per-frame copy.

Also, if you can get QuickTime to give you a YUV overlay, you can speed
this up and scale for free, etc.

Apple has some source code for rendering frame-by-frame from Quicktime
to an OpenGL texture…obviously, this isn’t completely what you want,
but it’ll show you how to have QuickTime decode to an offscreen buffer.

http://developer.apple.com/samplecode/OpenGL_Movie/OpenGL_Movie.html

I used this sample code before, and it works great.

–ryan.

Le Thu, 17 Mar 2005 18:02:56 +0100
Gabriele Greco <gabriele.greco at darts.it> a ?crit:

Golgoth! wrote:

… ok i ll rephrase the question then …

anyone ever play video throught an sdl surface?

Yes, using SDL overlays (YV12).

Speaking of video overlays, my video card can support RGB overlay. It
would be nice to use it in SDL, because low resolution games and
emulators could use it to scale the emulated screen to the SDL screen
surface.

I know I can do it in OpenGL easily, but it would be a nice addition.

Also, it would be useful if SDL_BlitSurface could convert surfaces
between YUV and RGB colorspaces.–
Patrice Mandin
WWW: http://membres.lycos.fr/pmandin/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux