[vlc-devel] Re: vlc: svn commit r7377 (andrep)

Andre Pang ozone at algorithm.com.au
Mon Apr 19 17:08:54 CEST 2004


On 19/04/2004, at 8:56 PM, Derk-Jan Hartman wrote:

>> * Added Continuous Media Markup Language (CMML) codec
>
> Couldn't this be implemented in some sort of library that VLC can 
> use???
> I hate imported code. That's for mplayer. It adds a lot of overhead to 
> the source while many users might not even be interested in this 
> remotely. They might just be interested to have the smallest possible 
> mp3 streamer to install on their robot.

I agree.  However, I wanted to do the commit so the support would at 
least be there: refactoring is always easier when you have something 
working first :).

Of course, there are quite a few things in that code which would be 
useful as a library, outside of the plugin:

>>    A /trunk/modules/codec/cmml/browser_open.c
>>    A /trunk/modules/codec/cmml/browser_open.h
>>    A /trunk/modules/codec/cmml/history.c
>>    A /trunk/modules/codec/cmml/history.h

The code for these files should be moved into the VLC core at some 
stage: browser_open.[ch] is a very simple attempt to provide a way to 
open the system's web browser; history.[ch] is similar to a web 
browser's history, and like playlists, should be more integrated with 
VLC (especially since they can and should be used for media files which 
don't contain CMML).  Even though it does belong in the core, I was 
reluctant to put such new functionality into libvlc, since it would 
affect the whole player instead of just one plugin.

>>    A /trunk/modules/codec/cmml/xstrcat.h

This is a simple wrapper around strcat to make it a bit more tasty.

>>    A /trunk/modules/codec/cmml/xarray.c
>>    A /trunk/modules/codec/cmml/xarray.h
>>    A /trunk/modules/codec/cmml/xlist.c
>>    A /trunk/modules/codec/cmml/xlist.h

These four files essentially provide a variable-sized array: they could 
fairly easily be replaced with the vlc_list_t implementation from 
src/misc/objects.c, except that the vlc_list_t functions in that file 
are not public, so the API for them would have to be put into an 
include/ file.  Possible, sure, but again, it's a matter of getting one 
plugin working vs making more far-reaching changes.

>>    A /trunk/modules/codec/cmml/xtag.c
>>    A /trunk/modules/codec/cmml/xtag.h
>>    A /trunk/modules/codec/cmml/xurl.c
>>    A /trunk/modules/codec/cmml/xurl.h

These four files could go into the core at a later stage: xtag.[ch] is 
a very simple (but working!) XML parser.  I would've used libxml2 to do 
the parsing since VLC already uses it, except that xtag is a meager 13k 
C file and does the job admirably.  xurl.[ch] is meant to be a general 
URL handling library.  Both would be useful in libvlc.

Two lofty future goal may also be to unify e.g. the XML parsing code 
(from codec/cmml, gui/skins, demux/m3u) and possibly URL handling code 
into a library.  Since everything works at the moment I'm more inclined 
to leave things as they are, but it's something worth considering 
later.

> Also an actual explanation of what you commit might be appreciated. 
> what does it do, what uses it and what are the advantages.

Yep, sure.  Perhaps the best thing to do is to describe implementation 
details (like what I wrote in this message) in a HACKING file?  When I 
commit that, I'll add details about what the cmml codec does in the 
commit message.


-- 
% Andre Pang : trust.in.love.to.save

-- 
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