[vlc-devel] [PATCH v2 06/19] display: don't pass an unused const vout_display_cfg_t* to VOUT_DISPLAY controls
Steve Lhomme
robux4 at ycbcr.xyz
Tue Aug 25 16:20:19 CEST 2020
Removed from:
- VOUT_DISPLAY_RESET_PICTURES
- VOUT_DISPLAY_CHANGE_SOURCE_CROP
- VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
- VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
- VOUT_DISPLAY_CHANGE_DISPLAY_FILLED
- VOUT_DISPLAY_CHANGE_ZOOM
---
include/vlc_vout_display.h | 12 ++++++------
modules/hw/vdpau/display.c | 1 -
modules/video_output/wayland/shm.c | 1 -
modules/video_output/win32/common.c | 6 +++---
modules/video_output/xcb/x11.c | 1 -
src/video_output/display.c | 17 +++++++----------
6 files changed, 16 insertions(+), 22 deletions(-)
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 0610c4134ba..1d5beafeb96 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -157,7 +157,7 @@ enum vout_display_query {
* \ref VOUT_DISPLAY_CHANGE_SOURCE_CROP
* control query returns an error.
*/
- VOUT_DISPLAY_RESET_PICTURES, /* const vout_display_cfg_t *, video_format_t * */
+ VOUT_DISPLAY_RESET_PICTURES, /* video_format_t * */
#if defined(__OS2__)
/* Ask the module to acknowledge/refuse the fullscreen state change after
@@ -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/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
index 473cb220b09..31e06cc2399 100644
--- a/modules/hw/vdpau/display.c
+++ b/modules/hw/vdpau/display.c
@@ -231,7 +231,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
{
case VOUT_DISPLAY_RESET_PICTURES:
{
- va_arg(ap, const vout_display_cfg_t *);
video_format_t *fmt = va_arg(ap, video_format_t *);
const video_format_t *src= &vd->source;
vout_display_place_t place;
diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 72194520cca..fb894920e2e 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -160,7 +160,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
{
case VOUT_DISPLAY_RESET_PICTURES:
{
- va_arg(ap, const vout_display_cfg_t *);
video_format_t *fmt = va_arg(ap, video_format_t *);
vout_display_place_t place;
video_format_t src;
diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 28af381cea3..b2ad670d0c3 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -132,14 +132,14 @@ void CommonWindowClean(vout_display_sys_win32_t *sys)
int CommonControl(vout_display_t *vd, display_win32_area_t *area, vout_display_sys_win32_t *sys, int query)
{
switch (query) {
- case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: /* const vout_display_cfg_t *p_cfg */
- case VOUT_DISPLAY_CHANGE_ZOOM: /* const vout_display_cfg_t *p_cfg */
+ case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
+ case VOUT_DISPLAY_CHANGE_ZOOM:
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP: {
CommonPlacePicture(vd, area);
return VLC_SUCCESS;
}
- case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: /* const vout_display_cfg_t *p_cfg */
+ case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
{ /* Update dimensions */
#if !VLC_WINSTORE_APP
if (sys->event != NULL)
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index 08daa739594..b33c1be2eeb 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -180,7 +180,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_RESET_PICTURES:
{
- va_arg(ap, const vout_display_cfg_t *);
*va_arg(ap, video_format_t *) = sys->fmt;
return VLC_SUCCESS;
}
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 5d59c7af2a1..8bc588673e3 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -492,8 +492,7 @@ static void vout_display_Reset(vout_display_t *vd)
osys->pool = NULL;
}
- if (vout_display_Control(vd, VOUT_DISPLAY_RESET_PICTURES, &osys->cfg,
- &vd->fmt)
+ if (vout_display_Control(vd, VOUT_DISPLAY_RESET_PICTURES, &vd->fmt)
|| VoutDisplayCreateRender(vd))
msg_Err(vd, "Failed to adjust render format");
}
@@ -554,8 +553,7 @@ static int vout_UpdateSourceCrop(vout_display_t *vd)
video_format_Print(VLC_OBJECT(vd), "SOURCE ", &osys->source);
video_format_Print(VLC_OBJECT(vd), "CROPPED", &vd->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 */
@@ -582,8 +580,7 @@ static int vout_SetSourceAspect(vout_display_t *vd,
vd->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 */
@@ -643,7 +640,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_CheckReset(vd))
vout_display_Reset(vd);
}
@@ -656,8 +653,8 @@ 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) || vout_display_CheckReset(vd))
+ if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_FILLED)
+ || vout_display_CheckReset(vd))
vout_display_Reset(vd);
}
@@ -671,7 +668,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_CheckReset(vd))
vout_display_Reset(vd);
}
--
2.26.2
More information about the vlc-devel
mailing list