[vlc-devel] [PATCH 2/3] display: add macro to set the callbacks and check type of the Open/Close
Steve Lhomme
robux4 at ycbcr.xyz
Tue Jul 16 08:29:53 CEST 2019
On 2019-07-15 17:25, Rémi Denis-Courmont wrote:
> Le maanantaina 15. heinäkuuta 2019, 17.06.29 EEST Steve Lhomme a écrit :
>> On 2019-07-15 15:03, Rémi Denis-Courmont wrote:
>>> Hi,
>>>
>>> I don't think that'll work if there are submodules with different
>>> open/close callbacks. Possibly this never happens yet, but that is going
>>> to be a PITA to debug if it ever does occur.
>> add_submodule() just calls a VLC_MODULE_CREATE. Every vlc_plugin_set()
>> call after that ends up in the submodule.
>>
>> So
>> set_callbacks(activate, deactivate);
>>
>> Should be the same as
>> {
>> set_callbacks(activate, deactivate);
>> }
>>
>> They both do
>> vlc_module_set(VLC_MODULE_CB_OPEN, #activate, (void *)(activate))
>> vlc_module_set(VLC_MODULE_CB_CLOSE, #deactivate, (void *)(deactivate)))
>
> Current code does:
>
> vlc_module_set(VLC_MODULE_CB_OPEN, "Open", (void *)(Open))
>
> while this patch does:
>
> vlc_module_set(VLC_MODULE_CB_OPEN, "open__", (void *)(open__))
>
> Those do not look the same to me.
Indeed. The name in itself have no significance. But it's
stored/restored from the plugin cache, thus invalidating old plugins
cache (including current 4.0 ones).
I'll just do a version without calling set_callbacks() but it's less nice.
More information about the vlc-devel
mailing list