[vlc-devel] [PATCH] qt: fix initial scale/size of video when autoresize gui is disabled

Darrell Walisser darrell.walisser at gmail.com
Sun Feb 28 20:04:50 CET 2016


nothing, thought I would resubmit since the directory paths changed (qt4
renamed to qt)

On Sun, Feb 28, 2016 at 2:03 PM, Jean-Baptiste Kempf <jb at videolan.org>
wrote:

> What is the change compared to the previous patch?
>
> On 28 Feb, Darrell Walisser wrote :
> > ---
> >  modules/gui/qt/components/interface_widgets.cpp | 10 ++++++++++
> >  modules/gui/qt/main_interface.cpp               | 19 +++++++++++++++----
> >  2 files changed, 25 insertions(+), 4 deletions(-)
> >
> > diff --git a/modules/gui/qt/components/interface_widgets.cpp
> b/modules/gui/qt/components/interface_widgets.cpp
> > index 920bf68..b6c37e5 100644
> > --- a/modules/gui/qt/components/interface_widgets.cpp
> > +++ b/modules/gui/qt/components/interface_widgets.cpp
> > @@ -183,6 +183,16 @@ WId VideoWidget::request( struct vout_window_t
> *p_wnd, unsigned int *pi_width,
> >     Parent has to care about resizing itself */
> >  void VideoWidget::setSize( unsigned int w, unsigned int h )
> >  {
> > +    /* If the size changed, resizeEvent will be called, otherwise not,
> > +     * in which case we need to tell the vout what the size actually is
> > +     */
> > +    if( (unsigned)size().width() == w && (unsigned)size().height() == h
> )
> > +    {
> > +         if( p_window != NULL )
> > +            vout_window_ReportSize( p_window, w, h );
> > +        return;
> > +    }
> > +
> >      resize( w, h );
> >      emit sizeChanged( w, h );
> >      /* Work-around a bug?misconception? that would happen when vout
> core resize
> > diff --git a/modules/gui/qt/main_interface.cpp
> b/modules/gui/qt/main_interface.cpp
> > index 90f941c..08ab7c7 100644
> > --- a/modules/gui/qt/main_interface.cpp
> > +++ b/modules/gui/qt/main_interface.cpp
> > @@ -215,11 +215,13 @@ MainInterface::MainInterface( intf_thread_t
> *_p_intf ) : QVLCMW( _p_intf )
> >      {
> >          if( b_autoresize )
> >          {
> > -            CONNECT( this, askVideoToResize( unsigned int, unsigned int
> ),
> > -                     this, setVideoSize( unsigned int, unsigned int ) );
> >              CONNECT( videoWidget, sizeChanged( int, int ),
> >                       this, videoSizeChanged( int,  int ) );
> >          }
> > +
> > +        CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
> > +                 this, setVideoSize( unsigned int, unsigned int ) );
> > +
> >          CONNECT( this, askVideoSetFullScreen( bool ),
> >                   this, setVideoFullScreen( bool ) );
> >      }
> > @@ -777,8 +779,17 @@ void MainInterface::releaseVideoSlot( void )
> >
> >  void MainInterface::setVideoSize( unsigned int w, unsigned int h )
> >  {
> > -    if( !isFullScreen() && !isMaximized() )
> > -        videoWidget->setSize( w, h );
> > +    if (!isFullScreen() && !isMaximized() )
> > +    {
> > +        /* Resize video widget to video size, or keep it at the same
> > +         * size. Call setSize() either way so that
> vout_window_ReportSize
> > +         * will always get called.
> > +         */
> > +        if (b_autoresize)
> > +            videoWidget->setSize( w, h );
> > +        else
> > +            videoWidget->setSize( videoWidget->width(),
> videoWidget->height() );
> > +    }
> >  }
> >
> >  void MainInterface::videoSizeChanged( int w, int h )
> > --
> > 2.5.0
> >
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
>
> --
> With my kindest regards,
>
> --
> Jean-Baptiste Kempf
> http://www.jbkempf.com/ - +33 672 704 734
> Sent from my Electronic Device
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160228/6ae58e5a/attachment.html>


More information about the vlc-devel mailing list