[vlc-devel] [RFC 1/6] libvlc: add rendering callbacks for D3D11 and D3D9

Rémi Denis-Courmont remi at remlab.net
Fri May 3 16:51:03 CEST 2019

Le perjantaina 3. toukokuuta 2019, 9.29.37 EEST Steve Lhomme a écrit :
> On 5/2/2019 4:29 PM, Rémi Denis-Courmont wrote:
> > Le torstaina 2. toukokuuta 2019, 11.04.42 EEST Steve Lhomme a écrit :
> >>> I really don't think that a type-unsafe API is a good idea for LibVLC.
> >>> It's
> >>> already hard enough to get right.
> >> 
> >> It's a balance between simplicity and safety.
> > 
> > No. Proper type-safe callbacks are simpler to document and implement. This
> > is only a balance between making it easier for the one VLC developer vs
> > everybody else.
> My main concern is that it's easier to not support some of the
> callbacks.

It certainly makes it harder to *accidentally* miss a callback. But it's not 
hard to pass NULL and we already document that in a number of cases.

> And then if something doesn't work the host app may not
> realize because this one call is missing. While with control calls, the
> host app sees of all them and has to consciously ignore some.

Eh? If you miss a callback parameter, the code won't compile to begin with.

> If some functions/controls are added API to the API it's less visible
> for the host app to know when it's called.

Adding a new function call in the documentation is much more visible than 
adding an enum member to me.

> Also depending on the
> language of the app it may be easier to have one callback rather than many.

If you mean FFI style, it's actually much harder to write bindings with void 
pointers to complex structures (or worse, var args), than multiple parameters 
of "simple" types.

Rémi Denis-Courmont

More information about the vlc-devel mailing list