If you use overlays you don’t need double buffering, I’ve also
seen that the SDL_DisplayYUVOverlay() is VBlank synchronized in
WIN32, while it’s not in Linux and OSX, but also on those cases
the wrost problem you can have is tearing, and tearing is a
problem also with SDL_Flip()ed surfaces if your video card is not
synchronized with the VBlank, so it’s not a YUV related problem
at all.
That it’s means that i can’t have a double buffer application with
a mpeg video inside ? I’m trying to display a little animation from
a mpeg video when a game is over. Is it not possible if my game is
using double buffering, fullscreen and hardware surfaces ?
That’s hardware and driver dependent.
On hardware with a real YUV (or other) overlay, the overlay is
effectively an extra “channel”, similar to the normal display
hardware. That is, it has it’s own VRAM pointer, and it can use page
flipping and retrace sync. (Theoretically, you could probably flip
the overlay and the “normal” display independently, but I don’t know
if any drivers support that.)
On systems without a h/w overlay, the video frames end up in the
normal frame buffer one way or another. (Hardware, software or
"hybrid" decoder.) That means it works pretty much like normal
blitting; the video frames end up in the normal frame buffer. Normal
buffering/flipping semantics applies.
Either way, there’s always the option of streaming the video into any
surface you like (including OpenGL textures) using a software (or
hardware, I guess) decoder. You get more control (and accelerated
filtered scaling, color modulation, blending etc with OpenGL), and it
should work as expected everywhere - but you may not get maximum
decoding performance.
Thanks David for the info !!
I have tried the last option yet, rendering into a surface and it works.
It’s a bit slower than the SMPEG_play() but it’s posible. A good example
of this technique is ‘glmovie.c’ from the SMPEG library where the video
player uses openGL commands to show the video. Well I’ll study the overlays
a little more.
Thanks again.
Jorge
David Olofson
<david at olofson.net> Para: sdl at libsdl.org
Enviado por: cc:
sdl-admin at libsdl.or Asunto: Re: [SDL] SMPEG and double buffer
g
01/04/2004 09.50
Por favor, responda
a sdl
[…]
If you use overlays you don’t need double buffering, I’ve also
seen that the SDL_DisplayYUVOverlay() is VBlank synchronized in
WIN32, while it’s not in Linux and OSX, but also on those cases
the wrost problem you can have is tearing, and tearing is a
problem also with SDL_Flip()ed surfaces if your video card is not
synchronized with the VBlank, so it’s not a YUV related problem
at all.
That it’s means that i can’t have a double buffer application with
a mpeg video inside ? I’m trying to display a little animation from
a mpeg video when a game is over. Is it not possible if my game is
using double buffering, fullscreen and hardware surfaces ?
That’s hardware and driver dependent.
On hardware with a real YUV (or other) overlay, the overlay is
effectively an extra “channel”, similar to the normal display
hardware. That is, it has it’s own VRAM pointer, and it can use page
flipping and retrace sync. (Theoretically, you could probably flip
the overlay and the “normal” display independently, but I don’t know
if any drivers support that.)
On systems without a h/w overlay, the video frames end up in the
normal frame buffer one way or another. (Hardware, software or
"hybrid" decoder.) That means it works pretty much like normal
blitting; the video frames end up in the normal frame buffer. Normal
buffering/flipping semantics applies.
Either way, there’s always the option of streaming the video into any
surface you like (including OpenGL textures) using a software (or
hardware, I guess) decoder. You get more control (and accelerated
filtered scaling, color modulation, blending etc with OpenGL), and it
should work as expected everywhere - but you may not get maximum
decoding performance.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Thursday 01 April 2004 08.58, @Jorge_Fernandez_Mont wrote:
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl