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

Qt4: create video window in fullscreen mode (fixes #2685)

parent deddd862
......@@ -203,8 +203,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
/* VideoWidget connects for asynchronous calls */
b_videoFullScreen = false;
connect( this, SIGNAL(askGetVideo(WId*,struct vout_window_t*,unsigned*,unsigned *)),
this, SLOT(getVideoSlot(WId*,struct vout_window_t*,unsigned*,unsigned*)),
connect( this, SIGNAL(askGetVideo(WId*,struct vout_window_t*,unsigned*,unsigned *, bool)),
this, SLOT(getVideoSlot(WId*,struct vout_window_t*,unsigned*,unsigned*, bool)),
Qt::BlockingQueuedConnection );
connect( this, SIGNAL(askReleaseVideo( void )),
this, SLOT(releaseVideoSlot( void )),
......@@ -705,7 +705,8 @@ void MainInterface::toggleFSC()
* That's why we have all those emit statements...
*/
WId MainInterface::getVideo( struct vout_window_t *p_wnd,
unsigned int *pi_width, unsigned int *pi_height )
unsigned int *pi_width, unsigned int *pi_height,
bool fullscreen )
{
if( !videoWidget )
return 0;
......@@ -713,12 +714,13 @@ WId MainInterface::getVideo( struct vout_window_t *p_wnd,
/* This is a blocking call signal. Results are returned through pointers.
* Beware of deadlocks! */
WId id;
emit askGetVideo( &id, p_wnd, pi_width, pi_height );
emit askGetVideo( &id, p_wnd, pi_width, pi_height, fullscreen );
return id;
}
void MainInterface::getVideoSlot( WId *p_id, struct vout_window_t *p_wnd,
unsigned *pi_width, unsigned *pi_height )
unsigned *pi_width, unsigned *pi_height,
bool fullscreen )
{
/* Hidden or minimized, activate */
if( isHidden() || isMinimized() )
......@@ -729,6 +731,8 @@ void MainInterface::getVideoSlot( WId *p_id, struct vout_window_t *p_wnd,
*p_id = ret;
if( ret ) /* The videoWidget is available */
{
setVideoFullScreen( fullscreen );
/* Consider the video active now */
showVideo();
......
......@@ -70,7 +70,7 @@ public:
/* Video requests from core */
WId getVideo( struct vout_window_t *,
unsigned int *pi_width, unsigned int *pi_height );
unsigned int *pi_width, unsigned int *pi_height, bool );
void releaseVideo( void );
int controlVideo( int i_query, va_list args );
......@@ -210,7 +210,7 @@ public slots:
/* Manage the Video Functions from the vout threads */
void getVideoSlot( WId *p_id, struct vout_window_t *,
unsigned *pi_width, unsigned *pi_height );
unsigned *pi_width, unsigned *pi_height, bool );
void releaseVideoSlot( void );
void emitBoss();
......@@ -262,7 +262,8 @@ private slots:
void resumePlayback();
signals:
void askGetVideo( WId *, struct vout_window_t *, unsigned *, unsigned * );
void askGetVideo( WId *, struct vout_window_t *, unsigned *, unsigned *,
bool );
void askReleaseVideo( );
void askVideoToResize( unsigned int, unsigned int );
void askVideoSetFullScreen( bool );
......
......@@ -689,7 +689,7 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
unsigned i_width = cfg->width;
unsigned i_height = cfg->height;
WId wid = p_mi->getVideo( p_wnd, &i_width, &i_height );
WId wid = p_mi->getVideo( p_wnd, &i_width, &i_height, cfg->is_fullscreen );
if( !wid )
return VLC_EGENERIC;
......@@ -713,7 +713,6 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
p_wnd->control = WindowControl;
p_wnd->sys = (vout_window_sys_t*)p_mi;
emit p_mi->askVideoSetFullScreen( cfg->is_fullscreen );
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