[vlc-devel] commit: Resize the video to the normal size on launch (Jean-Baptiste Kempf )

git version control git at videolan.org
Wed Jun 25 01:29:29 CEST 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Jun 24 16:31:12 2008 -0700| [68cb7744866cfe9f18516c186d1c84dc3667c07d]

Resize the video to the normal size on launch

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=68cb7744866cfe9f18516c186d1c84dc3667c07d
---

 modules/gui/qt4/components/interface_widgets.cpp |   10 +++++-----
 modules/gui/qt4/components/interface_widgets.hpp |    3 +--
 modules/gui/qt4/main_interface.cpp               |    2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 6402535..4b31941 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -74,10 +74,9 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
     setAttribute( Qt::WA_PaintOnScreen, true );
 
     /* The core can ask through a callback to show the video. */
-    connect( this, SIGNAL(askVideoWidgetToShow()), this, SLOT(show()), Qt::BlockingQueuedConnection );
-
-    /* The core can ask through a callback to resize the video */
-   // CONNECT( this, askResize( int, int ), this, SetSizing( int, int ) );
+    connect( this, SIGNAL(askVideoWidgetToShow( unsigned int, unsigned int)),
+             this, SLOT(SetSizing(unsigned int, unsigned int )),
+             Qt::BlockingQueuedConnection );
 }
 
 void VideoWidget::paintEvent(QPaintEvent *ev)
@@ -115,7 +114,7 @@ void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
                            unsigned int *pi_width, unsigned int *pi_height )
 {
     msg_Dbg( p_intf, "Video was requested %i, %i", *pi_x, *pi_y );
-    emit askVideoWidgetToShow();
+    emit askVideoWidgetToShow( *pi_width, *pi_height );
     if( p_vout )
     {
         msg_Dbg( p_intf, "embedded video already in use" );
@@ -134,6 +133,7 @@ void VideoWidget::SetSizing( unsigned int w, unsigned int h )
     msg_Dbg( p_intf, "Video is resizing to: %i %i", w, h );
     videoSize.rwidth() = w;
     videoSize.rheight() = h;
+    if( isHidden() ) show();
     updateGeometry(); // Needed for deinterlace
 }
 
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index 35e3c9a..ccd0953 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -91,8 +91,7 @@ private:
     QSize videoSize;
 
 signals:
-    void askVideoWidgetToShow();
-    //void askResize();
+    void askVideoWidgetToShow( unsigned int, unsigned int );
 
 public slots:
     void SetSizing( unsigned int, unsigned int );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 6a5fec6..377a44a 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -692,7 +692,7 @@ void *MainInterface::requestVideo( vout_thread_t *p_nvout, int *pi_x,
 #endif
         videoIsActive = true;
 
-        emit askVideoToResize( *pi_width, *pi_height );
+//        emit askVideoToResize( *pi_width, *pi_height );
         emit askUpdate();
 
         fullscreenControls->regFullscreenCallback( p_nvout );




More information about the vlc-devel mailing list