Changeset aeb8ed0fb0a896579de098b6a13ffcae41fc8ec7

Show
Ignore:
Timestamp:
20/06/08 20:39:27 (6 months ago)
Author:
Rémi Denis-Courmont <rdenis@simphalempin.com>
git-committer:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1213987167 +0300
git-parent:

[5c603c041addd09cddcd24ec1af3828feeb4c8e0]

git-author:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1213987146 +0300
Message:

Qt4: wait for VideoWidget::paintEvent

This seems to solve the invalid handle problem, as pointed out by
Laurent. However, I get a poststamp-sized video output now...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/components/interface_widgets.cpp

    r5f01018 raeb8ed0  
    4848#include <QResizeEvent> 
    4949#include <QDate> 
     50#include <QMutexLocker> 
    5051 
    5152/********************************************************************** 
     
    5960    vlc_mutex_init( &lock ); 
    6061    p_vout = NULL; 
     62    handleReady = false; 
    6163    hide(); setMinimumSize( 16, 16 ); 
    6264    videoSize.rwidth() = -1; 
     
    7981    /* The core can ask through a callback to resize the video */ 
    8082   // CONNECT( this, askResize( int, int ), this, SetSizing( int, int ) ); 
     83} 
     84 
     85void VideoWidget::paintEvent(QPaintEvent *ev) 
     86{ 
     87    QFrame::paintEvent(ev); 
     88    handleReady = true; 
     89    handleWait.wakeAll(); 
    8190} 
    8291 
     
    107116                           unsigned int *pi_width, unsigned int *pi_height ) 
    108117{ 
     118    QMutexLocker locker( &handleLock ); 
    109119    msg_Dbg( p_intf, "Video was requested %i, %i", *pi_x, *pi_y ); 
    110120    emit askVideoWidgetToShow(); 
     
    115125    } 
    116126    p_vout = p_nvout; 
    117     msg_Dbg( p_intf, "embedded video handle %p", winId() ); 
     127    while( !handleReady ) 
     128    { 
     129        msg_Dbg( p_intf, "embedded video pending (handle %p)", winId() ); 
     130        handleWait.wait( &handleLock ); 
     131    } 
     132    msg_Dbg( p_intf, "embedded video ready (handle %p)", winId() ); 
    118133    return ( void* )winId(); 
    119134} 
  • modules/gui/qt4/components/interface_widgets.hpp

    r69afa85 raeb8ed0  
    4141#include <QWidget> 
    4242#include <QFrame> 
     43#include <QMutex> 
     44#include <QWaitCondition> 
    4345 
    4446#define VOLUME_MAX 200 
     
    9092    vlc_mutex_t lock; 
    9193    QSize videoSize; 
     94    QMutex         handleLock; 
     95    QWaitCondition handleWait; 
     96    bool           handleReady; 
    9297 
    9398signals: 
     
    97102public slots: 
    98103    void SetSizing( unsigned int, unsigned int ); 
     104 
     105protected: 
     106    virtual void paintEvent(QPaintEvent *); 
    99107}; 
    100108