[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
Mon Jul 15 16:06:29 CEST 2019
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)))
> Le 15 juillet 2019 14:57:20 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>> Also set the capability at the same time as the (de)activate callbacks.
>> ---
>> include/vlc_vout_display.h | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
>> index fd4940cf6d..09b14ab297 100644
>> --- a/include/vlc_vout_display.h
>> +++ b/include/vlc_vout_display.h
>> @@ -215,6 +215,15 @@ typedef int (*vout_display_open_cb)(vout_display_t
>> *vd,
>> */
>> typedef void (*vout_display_close_cb)(vout_display_t *vd);
>>
>> +#define set_callbacks_display(Activate, Deactivate, priority) \
>> + { \
>> + vout_display_open_cb open__ = Activate; \
>> + vout_display_close_cb close__ = Deactivate; \
>> + set_callbacks(open__, close__); \
>> + } \
>> + set_capability( "vout display", priority )
>> +
>> +
>> struct vout_display_t {
>> struct vlc_object_t obj;
>>
>> --
>> 2.17.1
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
More information about the vlc-devel
mailing list