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

vout: expose fullscreen output selection

parent 5dbf0751
......@@ -51,7 +51,8 @@ enum {
VOUT_CONTROL_FLUSH, /* time */
VOUT_CONTROL_STEP, /* time_ptr */
VOUT_CONTROL_FULLSCREEN, /* bool */
VOUT_CONTROL_FULLSCREEN, /* string */
VOUT_CONTROL_WINDOWED, /* void */
VOUT_CONTROL_WINDOW_STATE, /* unsigned */
VOUT_CONTROL_MOUSE_STATE, /* vlc_mouse_t */
VOUT_CONTROL_DISPLAY_SIZE, /* window */
......
......@@ -483,11 +483,16 @@ void vout_ChangeAspectRatio( vout_thread_t *p_vout,
}
/* vout_Control* are usable by anyone at anytime */
void vout_ControlChangeFullscreen(vout_thread_t *vout, bool fullscreen)
void vout_ControlChangeFullscreen(vout_thread_t *vout, const char *id)
{
vout_control_PushBool(&vout->p->control, VOUT_CONTROL_FULLSCREEN,
fullscreen);
vout_control_PushString(&vout->p->control, VOUT_CONTROL_FULLSCREEN, id);
}
void vout_ControlChangeWindowed(vout_thread_t *vout)
{
vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_WINDOWED);
}
void vout_ControlChangeWindowState(vout_thread_t *vout, unsigned st)
{
vout_control_PushInteger(&vout->p->control, VOUT_CONTROL_WINDOW_STATE, st);
......@@ -1338,17 +1343,24 @@ static void ThreadStep(vout_thread_t *vout, mtime_t *duration)
}
}
static void ThreadChangeFullscreen(vout_thread_t *vout, bool fullscreen)
static void ThreadChangeFullscreen(vout_thread_t *vout, const char *id)
{
vout_window_t *window = vout->p->window;
if (window == NULL)
return; /* splitter! */
if (fullscreen)
vout_window_SetFullScreen(window, NULL);
else
vout_window_UnsetFullScreen(window);
vout_window_SetFullScreen(window, id);
}
static void ThreadChangeWindow(vout_thread_t *vout)
{
vout_window_t *window = vout->p->window;
if (window == NULL)
return; /* splitter! */
vout_window_UnsetFullScreen(window);
}
static void ThreadChangeWindowState(vout_thread_t *vout, unsigned state)
......@@ -1700,7 +1712,10 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
ThreadStep(vout, cmd.time_ptr);
break;
case VOUT_CONTROL_FULLSCREEN:
ThreadChangeFullscreen(vout, cmd.boolean);
ThreadChangeFullscreen(vout, cmd.string);
break;
case VOUT_CONTROL_WINDOWED:
ThreadChangeWindow(vout);
break;
case VOUT_CONTROL_WINDOW_STATE:
ThreadChangeWindowState(vout, cmd.integer);
......
......@@ -187,7 +187,8 @@ static inline void vout_CloseAndRelease( vout_thread_t *p_vout )
}
/* TODO to move them to vlc_vout.h */
void vout_ControlChangeFullscreen(vout_thread_t *, bool fullscreen);
void vout_ControlChangeFullscreen(vout_thread_t *, const char *id);
void vout_ControlChangeWindowed(vout_thread_t *);
void vout_ControlChangeWindowState(vout_thread_t *, unsigned state);
void vout_ControlChangeDisplaySize(vout_thread_t *,
unsigned width, unsigned height);
......
......@@ -533,7 +533,7 @@ static int WallPaperCallback( vlc_object_t *obj, char const *name,
if( cur.b_bool )
{
vout_ControlChangeWindowState( vout, VOUT_WINDOW_STATE_BELOW );
vout_ControlChangeFullscreen( vout, true );
vout_ControlChangeFullscreen( vout, NULL );
}
else
{
......@@ -550,7 +550,10 @@ static int FullscreenCallback( vlc_object_t *p_this, char const *psz_cmd,
vout_thread_t *p_vout = (vout_thread_t *)p_this;
(void)psz_cmd; (void) oldval; (void)p_data;
vout_ControlChangeFullscreen( p_vout, newval.b_bool );
if( newval.b_bool )
vout_ControlChangeFullscreen( p_vout, NULL );
else
vout_ControlChangeWindowed( p_vout );
return VLC_SUCCESS;
}
......
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