[vlc-devel] [PATCH 5/8] video_output: rename display_cfg to init_cfg
Steve Lhomme
robux4 at ycbcr.xyz
Mon May 13 13:54:50 CEST 2019
This vout_display_cfg_t is only used to initialize the display module. After
than the vd->cfg (osys->cfg of the vout wrapper) is the one holding all the
changes from the user. See comment in video_output.c line 1480.
The renaming will clear out this confusion and also avoid using the variable
when we know it's not the initialization phase.
---
src/video_output/display.c | 4 +--
src/video_output/video_output.c | 46 ++++++++++++++++----------------
src/video_output/vout_internal.h | 2 +-
src/video_output/vout_wrapper.c | 4 +--
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/video_output/display.c b/src/video_output/display.c
index f295ad6731..8cb53a778d 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -729,7 +729,7 @@ void vout_SetDisplayViewpoint(vout_display_t *vd,
vout_display_t *vout_display_New(vlc_object_t *parent,
const video_format_t *source,
- const vout_display_cfg_t *cfg,
+ const vout_display_cfg_t *init_cfg,
const char *module,
const vout_display_owner_t *owner)
{
@@ -738,7 +738,7 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
if (unlikely(osys == NULL))
return NULL;
- osys->cfg = *cfg;
+ osys->cfg = *init_cfg;
vout_display_GetDefaultDisplaySize(&osys->cfg.display.width,
&osys->cfg.display.height,
source, &osys->cfg);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 8605ac2e0b..937a194a4f 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -196,7 +196,7 @@ static void vout_SizeWindow(vout_thread_t *vout, unsigned *restrict width,
/* If the vout thread is running, the window lock must be held here. */
vout_display_SizeWindow(width, height, w, h, sar_num, sar_den,
sys->original.orientation,
- sys->display != NULL ? sys->display->cfg : &sys->display_cfg);
+ sys->display != NULL ? sys->display->cfg : &sys->init_cfg);
}
static void vout_UpdateWindowSize(vout_thread_t *vout)
@@ -210,7 +210,7 @@ static void vout_UpdateWindowSize(vout_thread_t *vout)
vout_SizeWindow(vout, &width, &height);
msg_Dbg(vout, "requested window size: %ux%u", width, height);
- vout_window_SetSize(vout->p->display_cfg.window, width, height);
+ vout_window_SetSize(vout->p->init_cfg.window, width, height);
}
/* */
@@ -386,7 +386,7 @@ void vout_ChangeFullscreen(vout_thread_t *vout, const char *id)
{
assert(!vout->p->dummy);
vlc_mutex_lock(&vout->p->window_lock);
- vout_window_SetFullScreen(vout->p->display_cfg.window, id);
+ vout_window_SetFullScreen(vout->p->init_cfg.window, id);
vlc_mutex_unlock(&vout->p->window_lock);
}
@@ -394,7 +394,7 @@ void vout_ChangeWindowed(vout_thread_t *vout)
{
assert(!vout->p->dummy);
vlc_mutex_lock(&vout->p->window_lock);
- vout_window_UnsetFullScreen(vout->p->display_cfg.window);
+ vout_window_UnsetFullScreen(vout->p->init_cfg.window);
/* Attempt to reset the intended window size */
vout_UpdateWindowSize(vout);
vlc_mutex_unlock(&vout->p->window_lock);
@@ -404,7 +404,7 @@ void vout_ChangeWindowState(vout_thread_t *vout, unsigned st)
{
assert(!vout->p->dummy);
vlc_mutex_lock(&vout->p->window_lock);
- vout_window_SetState(vout->p->display_cfg.window, st);
+ vout_window_SetState(vout->p->init_cfg.window, st);
vlc_mutex_unlock(&vout->p->window_lock);
}
@@ -429,7 +429,7 @@ void vout_ChangeDisplayFilled(vout_thread_t *vout, bool is_filled)
assert(!sys->dummy);
vlc_mutex_lock(&sys->window_lock);
- sys->display_cfg.is_display_filled = is_filled;
+ sys->init_cfg.is_display_filled = is_filled;
/* no window size update here */
vlc_mutex_unlock(&sys->window_lock);
@@ -458,8 +458,8 @@ void vout_ChangeZoom(vout_thread_t *vout, unsigned num, unsigned den)
}
vlc_mutex_lock(&sys->window_lock);
- sys->display_cfg.zoom.num = num;
- sys->display_cfg.zoom.den = den;
+ sys->init_cfg.zoom.num = num;
+ sys->init_cfg.zoom.den = den;
vout_UpdateWindowSize(vout);
vlc_mutex_unlock(&sys->window_lock);
@@ -617,7 +617,7 @@ void vout_ChangeViewpoint(vout_thread_t *vout,
vout_control_cmd_t cmd;
vlc_mutex_lock(&sys->window_lock);
- sys->display_cfg.viewpoint = *p_viewpoint;
+ sys->init_cfg.viewpoint = *p_viewpoint;
/* no window size update here */
vlc_mutex_unlock(&sys->window_lock);
@@ -1275,7 +1275,7 @@ void vout_ChangePause(vout_thread_t *vout, bool is_paused, vlc_tick_t date)
vout_control_Release(&vout->p->control);
vlc_mutex_lock(&vout->p->window_lock);
- vout_window_SetInhibition(vout->p->display_cfg.window, !is_paused);
+ vout_window_SetInhibition(vout->p->init_cfg.window, !is_paused);
vlc_mutex_unlock(&vout->p->window_lock);
}
@@ -1473,21 +1473,21 @@ static int vout_Start(vout_thread_t *vout, const vout_configuration_t *cfg)
owner.video = &interactive_cbs;
sys->filter.chain_interactive = filter_chain_NewVideo(vout, true, &owner);
- vout_display_cfg_t dcfg;
+ vout_display_cfg_t initcfg;
vlc_mutex_lock(&sys->window_lock);
- dcfg = sys->display_cfg;
+ initcfg = sys->init_cfg;
/* Any configuration change after unlocking will involve a control request
* that will be processed in the new thread. There may also be some pending
* control requests for configuration change already visible in
- * sys->display_cfg, leading to processing of extra harmless and useless
+ * sys->init_cfg, leading to processing of extra harmless and useless
* control request processing.
*
* TODO: display lock separate from window lock.
*/
vlc_mutex_unlock(&sys->window_lock);
- if (vout_OpenWrapper(vout, sys->splitter_name, &dcfg))
+ if (vout_OpenWrapper(vout, sys->splitter_name, &initcfg))
goto error;
unsigned num = 0, den = 0;
@@ -1750,7 +1750,7 @@ void vout_Stop(vout_thread_t *vout)
vlc_mutex_lock(&sys->window_lock);
if (sys->window_active) {
- vout_window_Disable(sys->display_cfg.window);
+ vout_window_Disable(sys->init_cfg.window);
sys->window_active = false;
}
vlc_mutex_unlock(&sys->window_lock);
@@ -1800,7 +1800,7 @@ void vout_Release(vout_thread_t *vout)
vlc_mutex_destroy(&vout->p->filter.lock);
assert(!sys->window_active);
- vout_display_window_Delete(sys->display_cfg.window);
+ vout_display_window_Delete(sys->init_cfg.window);
vout_control_Clean(&vout->p->control);
@@ -1891,8 +1891,8 @@ vout_thread_t *vout_Create(vlc_object_t *object)
vlc_mutex_init(&sys->filter.lock);
/* Window */
- sys->display_cfg.window = vout_display_window_New(vout);
- if (sys->display_cfg.window == NULL) {
+ sys->init_cfg.window = vout_display_window_New(vout);
+ if (sys->init_cfg.window == NULL) {
spu_Destroy(sys->spu);
vlc_object_delete(vout);
return NULL;
@@ -1910,9 +1910,9 @@ vout_thread_t *vout_Create(vlc_object_t *object)
atomic_init(&sys->refs, 0);
if (var_InheritBool(vout, "video-wallpaper"))
- vout_window_SetState(sys->display_cfg.window, VOUT_WINDOW_STATE_BELOW);
+ vout_window_SetState(sys->init_cfg.window, VOUT_WINDOW_STATE_BELOW);
else if (var_InheritBool(vout, "video-on-top"))
- vout_window_SetState(sys->display_cfg.window, VOUT_WINDOW_STATE_ABOVE);
+ vout_window_SetState(sys->init_cfg.window, VOUT_WINDOW_STATE_ABOVE);
return vout;
}
@@ -1973,10 +1973,10 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
#endif
};
- VoutGetDisplayCfg(vout, &sys->display_cfg);
+ VoutGetDisplayCfg(vout, &sys->init_cfg);
vout_SizeWindow(vout, &wcfg.width, &wcfg.height);
- if (vout_window_Enable(sys->display_cfg.window, &wcfg)) {
+ if (vout_window_Enable(sys->init_cfg.window, &wcfg)) {
vlc_mutex_unlock(&sys->window_lock);
goto error;
}
@@ -1994,7 +1994,7 @@ int vout_Request(const vout_configuration_t *cfg, input_thread_t *input)
if (vout_Start(vout, cfg))
{
vlc_mutex_lock(&sys->window_lock);
- vout_window_Disable(sys->display_cfg.window);
+ vout_window_Disable(sys->init_cfg.window);
sys->window_active = false;
vlc_mutex_unlock(&sys->window_lock);
goto error;
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index b6fdb36aab..c9ecb68d29 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -177,7 +177,7 @@ struct vout_thread_sys_t
vlc_mutex_t window_lock;
/* Video output display */
- vout_display_cfg_t display_cfg;
+ vout_display_cfg_t init_cfg;
vout_display_t *display;
picture_pool_t *private_pool;
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 0662f4163c..e7ff187cbf 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -65,7 +65,7 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
*
*****************************************************************************/
int vout_OpenWrapper(vout_thread_t *vout,
- const char *splitter_name, const vout_display_cfg_t *cfg)
+ const char *splitter_name, const vout_display_cfg_t *init_cfg)
{
vout_thread_sys_t *sys = vout->p;
vout_display_t *vd;
@@ -82,7 +82,7 @@ int vout_OpenWrapper(vout_thread_t *vout,
else
modlist = "splitter,none";
- vd = vout_display_New(VLC_OBJECT(vout), &sys->original, cfg, modlist,
+ vd = vout_display_New(VLC_OBJECT(vout), &sys->original, init_cfg, modlist,
&owner);
free(modlistbuf);
--
2.17.1
More information about the vlc-devel
mailing list