[vlc-commits] Qt4: create video window in fullscreen mode (fixes #2685)
Rémi Denis-Courmont
git at videolan.org
Thu Oct 29 21:38:56 CET 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 29 22:37:22 2015 +0200| [610ecb908b6855f836840f4b80aa7c30f5499374] | committer: Rémi Denis-Courmont
Qt4: create video window in fullscreen mode (fixes #2685)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=610ecb908b6855f836840f4b80aa7c30f5499374
---
modules/gui/qt4/main_interface.cpp | 14 +++++++++-----
modules/gui/qt4/main_interface.hpp | 7 ++++---
modules/gui/qt4/qt4.cpp | 3 +--
3 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 6abda4b..6028b10 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -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();
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index a0eaa4d..6c6945b 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -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 );
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 2bb6d24..3cfaffc 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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;
}
More information about the vlc-commits
mailing list