[vlc-devel] [PATCH 15/15] display: don't pass a const vout_display_cfg_t * to VOUT_DISPLAY_CHANGE_xxx
Thomas Guillem
thomas at gllm.fr
Thu Sep 3 10:14:51 CEST 2020
LGTM
On Thu, Sep 3, 2020, at 07:52, Steve Lhomme wrote:
> It's always vd->cfg available to the display module.
> ---
> include/vlc_vout_display.h | 10 +++++-----
> src/video_output/display.c | 13 +++++--------
> 2 files changed, 10 insertions(+), 13 deletions(-)
>
> diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
> index 1269da60d84..7df5b24ef5f 100644
> --- a/include/vlc_vout_display.h
> +++ b/include/vlc_vout_display.h
> @@ -174,7 +174,7 @@ enum vout_display_query {
> * \retval VLC_EGENERIC if a \ref VOUT_DISPLAY_RESET_PICTURES request
> * is necessary
> */
> - VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, /* const vout_display_cfg_t *p_cfg */
> + VOUT_DISPLAY_CHANGE_DISPLAY_SIZE,
>
> /**
> * Notifies a change of the display fill display flag by the user.
> @@ -183,7 +183,7 @@ enum vout_display_query {
> * \retval VLC_EGENERIC if a \ref VOUT_DISPLAY_RESET_PICTURES request
> * is necessary
> */
> - VOUT_DISPLAY_CHANGE_DISPLAY_FILLED, /* const vout_display_cfg_t *p_cfg */
> + VOUT_DISPLAY_CHANGE_DISPLAY_FILLED,
>
> /**
> * Notifies a change of the user zoom factor.
> @@ -192,7 +192,7 @@ enum vout_display_query {
> * \retval VLC_EGENERIC if a \ref VOUT_DISPLAY_RESET_PICTURES request
> * is necessary
> */
> - VOUT_DISPLAY_CHANGE_ZOOM, /* const vout_display_cfg_t *p_cfg */
> + VOUT_DISPLAY_CHANGE_ZOOM,
>
> /**
> * Notifies a change of the sample aspect ratio.
> @@ -201,7 +201,7 @@ enum vout_display_query {
> * \retval VLC_EGENERIC if a \ref VOUT_DISPLAY_RESET_PICTURES request
> * is necessary
> */
> - VOUT_DISPLAY_CHANGE_SOURCE_ASPECT, /* const vout_display_cfg_t *p_cfg */
> + VOUT_DISPLAY_CHANGE_SOURCE_ASPECT,
>
> /**
> * Notifies a change of the source cropping.
> @@ -213,7 +213,7 @@ enum vout_display_query {
> * \retval VLC_EGENERIC if a \ref VOUT_DISPLAY_RESET_PICTURES request
> * is necessary
> */
> - VOUT_DISPLAY_CHANGE_SOURCE_CROP, /* const vout_display_cfg_t *p_cfg */
> + VOUT_DISPLAY_CHANGE_SOURCE_CROP,
>
> /**
> * Notifies a change of VR/360° viewpoint.
> diff --git a/src/video_output/display.c b/src/video_output/display.c
> index 040adc1d785..03b4b0db0fb 100644
> --- a/src/video_output/display.c
> +++ b/src/video_output/display.c
> @@ -517,8 +517,7 @@ static int vout_UpdateSourceCrop(vout_display_t *vd)
> video_format_Print(VLC_OBJECT(vd), "SOURCE ", &fmt);
> video_format_Print(VLC_OBJECT(vd), "CROPPED ", &osys->source);
>
> - int ret = vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_CROP,
> - &osys->cfg);
> + int ret = vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_CROP);
> osys->crop.left = left - osys->source.i_x_offset;
> osys->crop.top = top - osys->source.i_y_offset;
> /* FIXME for right/bottom we should keep the 'type' border vs window */
> @@ -545,8 +544,7 @@ static int vout_SetSourceAspect(vout_display_t *vd,
> osys->source.i_sar_den = osys->source.i_sar_den;
> }
>
> - if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_ASPECT,
> - &osys->cfg))
> + if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_SOURCE_ASPECT))
> ret = -1;
>
> /* If a crop ratio is requested, recompute the parameters */
> @@ -606,7 +604,7 @@ void vout_display_SetSize(vout_display_t *vd,
> unsigned width, unsigned height)
>
> osys->cfg.display.width = width;
> osys->cfg.display.height = height;
> - if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &osys->cfg))
> + if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE))
> vout_display_Reset(vd);
> }
>
> @@ -618,8 +616,7 @@ void vout_SetDisplayFilled(vout_display_t *vd, bool
> is_filled)
> return; /* nothing to do */
>
> osys->cfg.is_display_filled = is_filled;
> - if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_FILLED,
> - &osys->cfg))
> + if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_FILLED))
> vout_display_Reset(vd);
> }
>
> @@ -633,7 +630,7 @@ void vout_SetDisplayZoom(vout_display_t *vd,
> unsigned num, unsigned den)
>
> osys->cfg.zoom.num = num;
> osys->cfg.zoom.den = den;
> - if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_ZOOM, &osys->cfg))
> + if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_ZOOM))
> vout_display_Reset(vd);
> }
>
> --
> 2.26.2
>
> _______________________________________________
> 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