[vlc-devel] [PATCH 2/3] display: add macros to set the callbacks and check type of the Open/Close

Rémi Denis-Courmont remi at remlab.net
Fri Jul 19 18:36:58 CEST 2019


Le perjantaina 19. heinäkuuta 2019, 16.35.39 EEST Steve Lhomme a écrit :
> Also set the capability at the same time as the (de)activate callbacks.
> ---
>  include/vlc_vout_display.h | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
> index be0971a1ef..a8cd4352bd 100644
> --- a/include/vlc_vout_display.h
> +++ b/include/vlc_vout_display.h
> @@ -215,6 +215,24 @@ 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; \
> +        (void) open__; (void) close__; \
> +        set_callbacks(activate, deactivate) \
> +    } \
> +    set_capability( "vout display", priority )
> +
> +#define set_callback_display(activate, priority) \
> +    { \
> +        vout_display_open_cb open__ = activate; \
> +        (void) open__; \
> +        set_callback(activate) \
> +    } \
> +    set_capability( "vout display", priority )
> +
> +
>  struct vout_display_t {
>      struct vlc_object_t obj;

I'd have written only the first variant and then moved the close callback to 
vout_display_t, or vice versa, but whatever.

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





More information about the vlc-devel mailing list