[vlc-devel] Re: SVG rendering

Olivier Aubert oaubert at bat710.univ-lyon1.fr
Wed Jul 23 18:30:19 CEST 2003


Hello.

> 1: How whould these features be used? Can you give an example? SVG is as far
> as I know using xml and xml does in my experience usually means quite a lot
> of text, so I fear really big string constants in the code.
A concrete example is advene, the application we are working on now. It
is a DVD annotation tool, which allows users to share annotations of
many different types (text, sound, graphics, ...) about a movie, and
render them of course. For the moment, we support textual annotations
(which we can render as subtitles for instance). With a SVG module, we
can display graphical annotations, such as frames around an important
element of the movie (before the question is asked : it is not yet
referenced on the videolan wiki, but will be as soon as we take the time
to make a decent webpage).

SVG itself is not that heavy. It is just some markup, which can be
generated easily. And it can handle text as well, without having to
bother about specifying fonts, sizes or positions to the freetype
renderer. If you want to have a real example, you can find a SVG file,
and a snapshot of VLC rendering it on a movie at the following URL:
http://www710.univ-lyon1.fr/~oaubert/tmp/

I would say that its only drawback compared to the freetype renderer is
its efficiency : in the current implementation (and it is difficult to
do otherwise), the rendering is done in a separate picture, which is
blended into the VLC picture, which means a lot of manipulations and
memory use, whereas freetype only renders specific glyphs and copies
them to the screen. Otherwise, it could easily be a more generic
replacement for the freetype rendering.

> 2: SVG is said to be similar to flash, and flash usually involves some
> interaction. How is this handled?
It is not supported for the moment in librsvg2, as far as I know. I do
not know if it will ever be. librsvg implements only a subset of SVG,
which is already quite interesting for many uses.

> 3: the ShowString functions are meant to be used to show strings. Whouldn't
> it be better to replicate the changes I made for the showstrings functions,
> and make a showSVG or something? These changes was really minimal.
Wouldn't it be nicer to have more generic rendering functions
(renderStuff) which would render either text using freetype or graphics
using SVG, and maybe some other formats that we did not think of at the
moment ? Else we will be replicating code all over, which is not a Good
Thing. The video filter approach is interesting, but it lacks a way to
precisely select and address a video filter such as an svg_filter.

> 4: How large parts of gnome do librsvg depend on? is there a slight
> possibility that it can be used on windows/macos/beos?
It should compile and run on Windows/MacOSX without too much trouble. It
depends on gdk, libart and libxml, which already run under Cygwin for
Windows (see http://cygnome.sourceforge.net/).

> The text style is still ignored by the textrenderers as well. :)
Which would be a good reason to make now the rendering architecture more
generic, with a generic render_style_t structure, for instance :
void vout_RenderAbsolute( vout_thread_t *p_vout,
                          vlc_object_t *p_rendering_module,
                          char *psz_string,
                          render_style_t *p_style, 
                          mtime_t i_start, mtime_t i_stop );

Olivier

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list