[vlc-devel] [PATCH 13/22] core: move all actions handling in actions.c

Rémi Denis-Courmont remi at remlab.net
Fri Aug 4 17:49:52 CEST 2017


Le torstaina 3. elokuuta 2017, 15.10.46 EEST Hugo Beauzée-Luyssen a écrit :
> From: Thomas Guillem <thomas at gllm.fr>
> 
> ---
>  include/vlc_actions.h     |   15 +
>  modules/control/hotkeys.c | 1261
> +------------------------------------------- src/libvlccore.sym        |   
> 1 +
>  src/misc/actions.c        | 1277
> +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1302
> insertions(+), 1252 deletions(-)
> 
> diff --git a/include/vlc_actions.h b/include/vlc_actions.h
> index e613e5a310..331c51ea01 100644
> --- a/include/vlc_actions.h
> +++ b/include/vlc_actions.h
> @@ -241,6 +241,7 @@ typedef enum vlc_action_id {
>      ACTIONID_VIEWPOINT_FOV_OUT,
>      ACTIONID_VIEWPOINT_ROLL_CLOCK,
>      ACTIONID_VIEWPOINT_ROLL_ANTICLOCK,
> +    ACTIONID_VIEWPOINT_UPDATE, /* Arg 1: vlc_viewpoint_t* */
>      /* Combo Actions */
>      ACTIONID_COMBO_VOL_FOV_UP,
>      ACTIONID_COMBO_VOL_FOV_DOWN,
> @@ -271,4 +272,18 @@ VLC_API const char* const*
>  vlc_actions_get_key_names(vlc_object_t *p_obj);
>  #define vlc_actions_get_key_names(x)
> vlc_actions_get_key_names(VLC_OBJECT(x))
> 
> +/**
> + * Execute an action
> + *
> + * \param a valid vlc object
> + * \param i_action action to execute
> + * \param b_notify notify a new state via the OSD of the current vout
> + * \return VLC_SUCCESS or a VLC error
> + */
> +VLC_API int
> +vlc_actions_do(vlc_object_t *p_obj, vlc_action_id_t i_action,
> +               bool b_notify, ...);
> +#define vlc_actions_do(a,b,c,...) vlc_actions_do(VLC_OBJECT(a),b,c, \
> +    ##__VA_ARGS__)
> +

I am not against merging hotkeys in the core. But IMO, the most immediate 
problem with hotkeys is the lack of context.

When the key is clearly tied to a certain video output... it gets ignored, and 
possible ends up affecting the wrong video output(s). There are also no 
provisions for a key press tied to an audio output. At least in theory, that´s 
possible, e.g. headset buttons. And even by default, there are no provisions 
to keep track of the input or input owner that the key press is targeted to - 
we just assume it is a the playlist and its current input.

And thus, I don´t really like that API prototype.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list