Commit bee379f5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

gl: remove redundant pointer

parent 13f58bee
...@@ -83,8 +83,6 @@ vlc_module_end () ...@@ -83,8 +83,6 @@ vlc_module_end ()
struct vout_display_sys_t struct vout_display_sys_t
{ {
vout_display_opengl_t *vgl; vout_display_opengl_t *vgl;
vout_window_t *window;
vlc_gl_t *gl; vlc_gl_t *gl;
picture_pool_t *pool; picture_pool_t *pool;
}; };
...@@ -134,11 +132,11 @@ static int Open (vlc_object_t *obj) ...@@ -134,11 +132,11 @@ static int Open (vlc_object_t *obj)
sys->gl = NULL; sys->gl = NULL;
sys->pool = NULL; sys->pool = NULL;
sys->window = MakeWindow (vd); vout_window_t *surface = MakeWindow (vd);
if (sys->window == NULL) if (surface == NULL)
goto error; goto error;
sys->gl = vlc_gl_Create (sys->window, API, "$" MODULE_VARNAME); sys->gl = vlc_gl_Create (surface, API, "$" MODULE_VARNAME);
if (sys->gl == NULL) if (sys->gl == NULL)
goto error; goto error;
...@@ -168,8 +166,8 @@ static int Open (vlc_object_t *obj) ...@@ -168,8 +166,8 @@ static int Open (vlc_object_t *obj)
error: error:
if (sys->gl != NULL) if (sys->gl != NULL)
vlc_gl_Destroy (sys->gl); vlc_gl_Destroy (sys->gl);
if (sys->window != NULL) if (surface != NULL)
vout_display_DeleteWindow (vd, sys->window); vout_display_DeleteWindow (vd, surface);
free (sys); free (sys);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -181,13 +179,15 @@ static void Close (vlc_object_t *obj) ...@@ -181,13 +179,15 @@ static void Close (vlc_object_t *obj)
{ {
vout_display_t *vd = (vout_display_t *)obj; vout_display_t *vd = (vout_display_t *)obj;
vout_display_sys_t *sys = vd->sys; vout_display_sys_t *sys = vd->sys;
vlc_gl_t *gl = sys->gl;
vout_window_t *surface = gl->surface;
vlc_gl_MakeCurrent (sys->gl); vlc_gl_MakeCurrent (gl);
vout_display_opengl_Delete (sys->vgl); vout_display_opengl_Delete (sys->vgl);
vlc_gl_ReleaseCurrent (sys->gl); vlc_gl_ReleaseCurrent (gl);
vlc_gl_Destroy (sys->gl); vlc_gl_Destroy (gl);
vout_display_DeleteWindow (vd, sys->window); vout_display_DeleteWindow (vd, surface);
free (sys); free (sys);
} }
...@@ -242,24 +242,24 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -242,24 +242,24 @@ static int Control (vout_display_t *vd, int query, va_list ap)
#endif #endif
case VOUT_DISPLAY_CHANGE_FULLSCREEN: case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{ {
const vout_display_cfg_t *cfg = const vout_display_cfg_t *c =
va_arg (ap, const vout_display_cfg_t *); va_arg (ap, const vout_display_cfg_t *);
return vout_window_SetFullScreen (sys->window, cfg->is_fullscreen); return vout_window_SetFullScreen (sys->gl->surface, c->is_fullscreen);
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{ {
unsigned state = va_arg (ap, unsigned); unsigned state = va_arg (ap, unsigned);
return vout_window_SetState (sys->window, state); return vout_window_SetState (sys->gl->surface, state);
} }
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM: case VOUT_DISPLAY_CHANGE_ZOOM:
{ {
const vout_display_cfg_t *cfg = va_arg (ap, const vout_display_cfg_t *); const vout_display_cfg_t *c = va_arg (ap, const vout_display_cfg_t *);
const video_format_t *src = &vd->source; const video_format_t *src = &vd->source;
if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE) if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE)
...@@ -268,16 +268,16 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -268,16 +268,16 @@ static int Control (vout_display_t *vd, int query, va_list ap)
force = va_arg (ap, int); force = va_arg (ap, int);
if (force if (force
&& (cfg->display.width != vd->cfg->display.width && (c->display.width != vd->cfg->display.width
|| cfg->display.height != vd->cfg->display.height) || c->display.height != vd->cfg->display.height)
&& vout_window_SetSize (sys->window, && vout_window_SetSize (sys->gl->surface,
cfg->display.width, cfg->display.height)) c->display.width, c->display.height))
return VLC_EGENERIC; return VLC_EGENERIC;
} }
vout_display_place_t place; vout_display_place_t place;
vout_display_PlacePicture (&place, src, cfg, false); vout_display_PlacePicture (&place, src, c, false);
vlc_gl_MakeCurrent (sys->gl); vlc_gl_MakeCurrent (sys->gl);
glViewport (place.x, place.y, place.width, place.height); glViewport (place.x, place.y, place.width, place.height);
vlc_gl_ReleaseCurrent (sys->gl); vlc_gl_ReleaseCurrent (sys->gl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment