[vlc-devel] D-Bus multiple APIs in vlc code

Rafaël Carré funman at videolan.org
Tue Nov 28 14:38:21 CET 2006


Hello,

VLC, in trunk, at the moment support 4 different versions of D-Bus api ( < 0.30, 0.30, 0.92, 1.0.0) and 2 different versions of HAL api ( >= 0.2.97, >= 0.5.0 )

D-Bus has been changing API fast over its development, and now has reached version 1.0, with a stable API.
You will note that before D-Bus 1.0RC3 (released 6 days before 1.0) you had to define "DBUS_API_SUBJECT_TO_CHANGE" to be able to compile code using it, to ensure programmers did know that API was unstable.

HAL is still considered API-unstable.


When doing some D-Bus and HAL related code, I fixed a non-critical bug, where vlc didn't unreference the D-Bus connection when it wouldn't use it anymore.
This is the correct way to use D-Bus.

However JP Saman noticed that this would cause vlc to segfault on his distro, using version 0.33 of D-Bus.


Another problem of D-Bus is that for an application to be able to use it from multiple threads, it has to call the dbus_thread_init() function.

You have to provide this function pointers to a lot of function needed for threads management, and it is not possible given current vlc threads implementation.

However, this is simple since D-Bus 0.93, because this version added dbus_thread_init_default() that is all we really need.


So my proposal is to get rid of 4 D-Bus dependancies, and only be compatible with D-Bus >= 1.0.0 to avoid using old, buggy & deprecated stuff.

The same could be applied for HAL, but I got no trouble reports on that part. Anyway that would make code look far better to only support one API.

--
Rafaël Carré
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20061128/fbf39169/attachment.sig>


More information about the vlc-devel mailing list