[vlc-devel] [PATCH 0/2] Libvlc formatted log callback

Rémi Denis-Courmont remi at remlab.net
Sat May 18 09:18:30 CEST 2019


Le perjantaina 17. toukokuuta 2019, 11.04.59 EEST Jérémy VIGNELLES a écrit :
> Hi,
> 
> In libvlc, there is currently a `libvlc_log_set` function, that can register
> log callback in a vprintf style, that is, with a `va_list` argument.
> 
> This is nice when you are trying to call from C, but when using other
> languages like C# or Java, va_list is impossible to get right, and even if
> it did, those languages do not provide ways to format that kind of stuff.

We already tried to adapt to foreign function interfaces and failed, and 
realized that the FFI just could not handle it across the broad set of 
platforms that VLC supports.

Then we took the logical decision going forward: to reject that sort of 
patchsets.

To call LibVLC from .Net or Java, you need OS-specific, architecture-specific, 
and windowing system-specific code anyway. There is the library path, name, 
version, calling convention, name mangling and mapping of scalar types, and 
mapping of compound types, mapping of unions, window handles, heap 
allocations, etc. va_list is the least of problems - and you don't even need 
to look into va_list here, only pass it forth.

The best way to handle all those problems is in a native library. But if you 
prefer to do it the hard way directly in high level language, then that's your 
problem.

The train has left the station. This does not belong in LibVLC.

-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list