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

Steve Lhomme robux4 at ycbcr.xyz
Mon May 20 09:41:07 CEST 2019


On 2019-05-19 8:32, Rémi Denis-Courmont wrote:
> Le lauantaina 18. toukokuuta 2019, 23.12.30 EEST Jeremy Vignelles a écrit :
>> Hi Rémi,
>>
>> Thanks for your review.
>>
>>> Le 18 mai 2019 à 09:18, Rémi Denis-Courmont <remi at remlab.net> a écrit :
>>>
>>> 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.
>>
>> As of today, every libvlc API that made sense to expose are implemented in
>> LibVLCSharp, with the only exception of that specific logging API. I don't
>> know if there is something missing for other languages on specific APIs,
>> but as far as .net is concerned, the other functions are correctly
>> supported.
> 
> And? The point is, we decided to *stop* vainly trying to support the DotNet
> DllImport natively, because we want char, bool, size_t, va_list, etc. and
> becausewe found out that it ws anyway not possible to import LibVLC without
> platform-specific code even if the type system were watered-down.

I followed the conversation and still don't understand why it's wrong to 
replace a "format string + va_list" by a "formatted string" in the API. 
Even in C handling a va_list is a PITA. If you want to peek into it, you 
need to copy it. Let alone the typing of the variables in the va_list.


More information about the vlc-devel mailing list