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