[vlc-devel] [PATCH 0/8 v4] surface rendering callbacks

Rémi Denis-Courmont remi at remlab.net
Mon Jan 21 18:41:53 CET 2019


Le maanantaina 21. tammikuuta 2019, 19.15.51 EET Rémi Denis-Courmont a écrit :
> Le maanantaina 21. tammikuuta 2019, 18.38.43 EET Steve Lhomme a écrit :
> > This is another variant of the same patches. This time there's only one
> > callback and the different calls are passed via control "messages" which
> > all have an input pointer and an output pointer (unused most of the time).
> 
> This is even worse than the previous version IMO. Zero type safety. Awful.

Besides binding writers do not like varags callbacks. So they should only be 
used when actually justified by the use case. That is to say when the argument 
list is actually variable such as printf/scanf/D-Bus.

It took me more than a decade to understand how vararg actually works, and 
most C programmers still don't understand, though many think they do. So when 
there are no actual reasons to use them, I don't want to use them.

Also this is again multiplexing, albeit at a different layer than the previous 
version. I can see why you may need multiplexed function calls on context 
boundaries such as system calls, IPC, network/RPC, or binary compatibility. 
But I really don't see why you need multiplexing here.

As Thomas already noted in the previous thread, you could just add a new 
function with whatever suitable and typed parameter(s) and/or callback(s).

-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list