Brief vout 4 status
Samuel Hocevar
sam at zoy.org
Thu May 24 03:50:57 CEST 2001
Moin folks,
I'm back from a few days away and I'm trying to cope with all my late
e-mail and the usual duties. So, as you might know, I'm working on the
4th version of vlc's video output layer. Design is pretty stable now,
and I should be finished with the core code Real Soon Now (tm).
A few words about the design. We wanted vlc to be as fast as possible
both in software YUV mode and in hardware overlay mode, so the main
idea was to decode pictures directly in a direct video buffer whenever
possible. Sounds pretty obvious since most players do it like this, but
it can become a real pain if you want a generic enough video output that
can handle all these situations:
- output layer accepts YUV data in the decoder's chroma (eg. XVideo)
- output layer accepts YUV data in an other chroma format (eg. BeOS
Overlay system which is YCbCr)
- output layer accepts RGB data and can't scale it (eg. X11)
- output layer accepts RGB data but can scale it (eg. BeOS BBitmap)
The vout_Init method of a video output plugin is now in charge of
creating as many direct video buffers as possible, then the core video
output creates additional memory buffers if there are not enough direct
buffers. The decoder behaves exactly the same when fed with a direct
buffer or a memory buffer, and all the magic is done by the video output
(together with deciding whether a picture can be displayed, unlinked,
needs subtitles, should be copied before rendering subtitles, and so
on).
I'm in the process of moving the code from my test applications to my
local vlc repository. As of today, only the SDL plugin has been ported,
and it only works in YUV overlay mode. It now displays subtitles though.
A word about speed: current CVS vlc eats 70-71% CPU on my computer
using SDL and overlay, my vout 4 version eats 53-54% using SDL overlay
with five direct buffers, and 61-62% using SDL overlay with two direct
buffers. Xine still eats a lot less (42%) with Xv, but we're getting
closer and I suspect SDL adds a little overhead over Xv.
I put a very alpha snapshot here:
http://zoy.org/~sam/vlc/vlc-vout4-20010524.tar.gz
If you want to give it a try, dummy and sdl should be the only
video output modules you'll manage to compile. If you want to port or
create a video output module that does YUV conversion, have a look at
plugins/sdl/vout_sdl.c. Don't bother with vout_xvideo.c, it's already
being ported. If you wan't to port or create a video output module that
does software YUV, I'm afraid you'll need to wait a few days until this
part is ported.
Have fun,
--
Sam.
More information about the vlc-devel
mailing list