[vlc-devel] [PATCH 1/2] libvlc: added a formatted log callback

Jeremy Vignelles jeremy.vignelles at dev3i.fr
Sun May 19 12:58:33 CEST 2019


> Le 19 mai 2019 à 08:29, Rémi Denis-Courmont <remi at remlab.net> a écrit :
> 
> 
> Le lauantaina 18. toukokuuta 2019, 23.38.19 EEST Jeremy Vignelles a écrit :
> > I don't know all languages, but C# is definitely not one of those. Callbacks
> > can be declared and called from native code, we already do that in
> > LibVLCSharp, for example to handle events.
> 
> So what? LibVLC is not designed around C# limitations. We stopped that vain 
> insane efforts years ago.

The effort is not that big in my opinion. I'm offering a patch that would make things better for the other languages out there.

I totally understand that given the amount of work in the core, libvlc compatibility with other languages is not on the list of things you care about, but does that mean that all patches in that field should be rejected ?

> > * vlcj https://github.com/caprica/vlcj for java
> > * vlc-rs https://github.com/garkimasera/vlc-rs for rust
> > * vlc-go https://github.com/adrg/libvlc-go
> > * Vlc.DotNet https://github.com/ZeBobo5/Vlc.DotNet for C#
> > * and now LibVLCSharp, which is supported by VideoLAN and which first stable
> > 
> > version has already been downloaded 179 times in just five days of
> > existence.
> 
> vlcj exposes the log callbacks without needing to mess with the native API...

As far as I understand it, vlcj uses JNA to use libvlc, which is very similar to C#'s P/Invoke. This means that it has no native layer between vlcj and libvlc.

As for the log callback, va_list is interpreted as a void*, and passed back to a vsnprintf from a shared library (libc.so or msvcrt.dll), as this is done in Vlc.DotNet. The msvcrt library is present on all windows platforms without any external installation, but the implementation is flawed and cannot render all markers.

The patch could help them as well.


More information about the vlc-devel mailing list