[vlc-devel] libvlc status?

Filippo Carone filippo at carone.org
Wed Mar 26 16:09:45 CET 2008

Tanguy Krotoff ha scritto:
> Hi everybody
> I'm developing a VLC Phonon backend.
> Phonon is is the cross platform multimedia API for KDE 4. It is
> integrated inside Qt-4.4. It has already a backend for Xine,
> GStreamer, Direct Show and QuickTime.
> http://en.wikipedia.org/wiki/Phonon_%28KDE%29
> I hope to integrate it into some Qt-4 video/music players like
> SMPlayer http://smplayer.sourceforge.net/ and others
> Ok that is said :p
> Here is the code of the VLC Phonon backend (under GPL):
> http://smplayer.svn.sourceforge.net/viewvc/smplayer/experimental/phonon-vlc/
> So i've been using libvlc-git-0.9 for a full week (holidays,
> holidays... :p) and I found the API "unworking" and "confusing"

the fast answer is libvlc is in progress. Please file all the bugs you 
find as bug reports on trac to help us fixing and testing. I'm trying to 
cover with unit tests all the libvlc functions from the java bindings 
and update the


to keep a public report on what is going on (you may take a look at the 
bindings/java/core/src/test/java classes).

> So I checked the Java binding but VlcClient.java is too simple :/
Indeed, it's just a rapid proof of concept.

> What is the status of libvlc-0.9? unstable/pretty stable/tested?
I'd say "unstable" with tests in progress for the moment.
> Which part of the API should I used and that is known to be tested?
> Should I go for libvlc-0.8.6 instead?
Using 0.8.6 will keep you out of alot of improvements done in 0.9.0 
release, but it may fit your needs as well. You may also take a look at 
the mediacontrol library used in the python bindings.

> I would like to know if there is a simple application that uses libvlc
> that works. By who/where is used libvlc?
> Is it possible to use the same API as the qtvlc?
> Here is the bugs/strange things/questions that I got:
> * libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * )
> does not work (-> exception) if there is no libvlc_media_instance_t
> instantiated.
> But still the function does not required a libvlc_media_instance_t parameter
> + getting the volume should of course not depend from a libvlc_media_instance_t
bug, without a unit test

> * libvlc_media_instance_set_drawable()
> does not work, I have to use libvlc_video_set_parent()
bug, without a unit test

> * libvlc_media_descriptor_get_meta()
> does not work, impossible to get artist name... even while playing the
> file or checking for the libvlc_MediaDescriptorMetaChanged event
> I tried with different mp3 files with tags
bug, without a unit test

> * libvlc_MediaDescriptorPreparsedChanged
> event unknown, still present inside libvlc_structures.h
bug, without a unit test
> * libvlc_media_list_player_stop() and libvlc_media_instance_stop()
> crash with different snapshots
libvlc_media_list_player_stop is unit-tested and reports no errors. please file a specific bug.

> * no event libvlc_MediaInstanceStopped
> but there is libvlc_MediaInstancePlayed, libvlc_MediaInstancePaused,
> and even libvlc_MediaInstanceReachedEnd... strange...
> + libvlc_MediaInstancePlayed vs libvlc_MediaListPlayerPlayed is very confusing
yeah, naming can be enhanced here, what would you propose?

> * How do I deactivate the double-click on the vlc video window?
> minor problem for the moment
> * How do I set the audio device to use if I have several?
> there is no libvlc_audio_set_device(int deviceId) + qtvlc does not
> provide this functionality
> (I guess this will be for the future...)

this can be filed as an enhacement on trac

> * Also there is no event like libvlc_AudioDeviceFailed
> statically, but this is another subject.. :p
> The libvlc API is quite confusing (ok this is only my opinion): a lot
> of stuffs: media_list, media_list_player, media_list_view +
> depreceated API...
Documentation should make functions less obscure. The approach taken in 
libvlc leads to more flexibility and control, with something to pay on 
the usuability side (for the moment).

> Sometimes I wonder why there is media_list, media_view... since libvlc
> users will probably create a new "media list/playlist" stuff in their
> own code if needed.
> About events, you have to attach each category to a callback. I think
> a simple switch() from the user side would have been ok + one and only
> one callback registration and all events going to the same callback.
While I do not think is the best approach, you can specify the same 
callback function for all the events and handle each event with a 

> And still there is no char * libvlc_get_version(), you have to go with
> the old API to get this.
This is surely a bug.

> I would have seen a simple:
> register_callback(callback);
> int mid = media_new("myvideo.avi");
> media_load(mid); //send load event + meta data, duration... working,
> don't have to run media_play() to get this...
> media_play(mid); //send play event
> media_attach_to_window(mid, window_id);
> media_stop(mid); //send stop event
> media_release(mid);
> //all events though callback()
> void callack(int mid, event)
> {
>    switch(event)
>    ...
> }
> So a bit like the old API but without the playlist and with the callback system.
Your sample code, with the current libvlc-0.9 turns to:
1 new libvlc_instance
2 set parent
3 new libvlc_media_descriptor
4 new libvlc_media_list
5 add descriptor to list
6 create libvlc_media_list_player
7 list_player.play

1 new libvlc_instance
2 set parent
3 new media_instance
4 media_instance play

currently there's no way to get all the meta info about the item before 
playing it, but this will be addressed (I hope soon).
> I hope that you will be able to help me. If I can give you more
> feedback on some stuffs, no problem
File bugreports / contribute patches / unittests ;)


More information about the vlc-devel mailing list