Commit 48018aed authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Video Widget cleaning. Corrections of previous commits.

zoom and resize when stop should be fixed. #1652 and #1716
parent ac495caa
......@@ -67,16 +67,23 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
{
/* Init */
i_vout = 0;
hide(); setMinimumSize( 16, 16 );
videoSize.rwidth() = -1;
videoSize.rheight() = -1;
hide();
/* Set the policy to expand in both directions */
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
/* Black background is more coherent for a Video Widget IMVHO */
/* Black background is more coherent for a Video Widget */
QPalette plt = palette();
plt.setColor( QPalette::Active, QPalette::Window , Qt::black );
plt.setColor( QPalette::Inactive, QPalette::Window , Qt::black );
plt.setColor( QPalette::Window, Qt::black );
setPalette( plt );
setAutoFillBackground(true);
/* Indicates that the widget wants to draw directly onto the screen.
Widgets with this attribute set do not participate in composition
management */
setAttribute( Qt::WA_PaintOnScreen, true );
/* The core can ask through a callback to show the video. */
......@@ -85,7 +92,7 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i ) : QFrame( NULL ), p_intf( _p_i )
this, SLOT(SetSizing(unsigned int, unsigned int )),
Qt::BlockingQueuedConnection );
#else
#error This is broken. Fix it with a QEventLoop with a processEvents ()
#warning This is broken. Fix it with a QEventLoop with a processEvents ()
connect( this, SIGNAL(askVideoWidgetToShow( unsigned int, unsigned int)),
this, SLOT(SetSizing(unsigned int, unsigned int )) );
#endif
......@@ -99,10 +106,11 @@ void VideoWidget::paintEvent(QPaintEvent *ev)
#endif
}
/* Kill the vout at Destruction */
VideoWidget::~VideoWidget()
{
vout_thread_t *p_vout = i_vout
? (vout_thread_t *)vlc_object_get( i_vout ) : NULL;
vout_thread_t *p_vout = i_vout ?
(vout_thread_t *)vlc_object_get( i_vout ) : NULL;
if( p_vout )
{
......@@ -134,7 +142,9 @@ void *VideoWidget::request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
return NULL;
}
i_vout = p_nvout->i_object_id;
#ifndef NDEBUG
msg_Dbg( p_intf, "embedded video ready (handle %p)", winId() );
#endif
return ( void* )winId();
}
......@@ -156,8 +166,8 @@ void VideoWidget::release( void *p_win )
i_vout = 0;
videoSize.rwidth() = 0;
videoSize.rheight() = 0;
updateGeometry();
hide();
updateGeometry(); // Needed for deinterlace
}
QSize VideoWidget::sizeHint() const
......
......@@ -41,26 +41,6 @@
#include <QWidget>
#include <QFrame>
#define VOLUME_MAX 200
/* on WIN32 hide() for fullscreen controller doesnt work, so it have to be
done by trick with setting the opacity of window */
#ifdef WIN32
#define WIN32TRICK
#endif
/* to trying transparency with fullscreen controller on windows enable that */
/* it can be enabled on-non windows systems,
but it will be transparent only with composite manager */
#ifndef WIN32
#define HAVE_TRANSPARENCY 1
#else
#define HAVE_TRANSPARENCY 0
#endif
/* Default value of opacity for FS controller */
#define DEFAULT_OPACITY 0.75
class ResizeEvent;
class QPalette;
class QPixmap;
......@@ -240,6 +220,24 @@ signals:
void advancedControlsToggled( bool );
};
/* on WIN32 hide() for fullscreen controller doesnt work, so it have to be
done by trick with setting the opacity of window */
#ifdef WIN32
#define WIN32TRICK
#endif
/* to trying transparency with fullscreen controller on windows enable that */
/* it can be enabled on-non windows systems,
but it will be transparent only with composite manager */
#ifndef WIN32
#define HAVE_TRANSPARENCY 1
#else
#define HAVE_TRANSPARENCY 0
#endif
/* Default value of opacity for FS controller */
#define DEFAULT_OPACITY 0.75
/***********************************
* Fullscreen controller
***********************************/
......@@ -302,7 +300,7 @@ private:
};
#define VOLUME_MAX 200
class VolumeClickHandler : public QObject
{
public:
......
This diff is collapsed.
......@@ -75,9 +75,6 @@ public:
void releaseVideo( void * );
int controlVideo( void *p_window, int i_query, va_list args );
#if 0
void requestLayoutUpdate();
#endif
/* Getters */
QSystemTrayIcon *getSysTray() { return sysTray; };
QMenu *getSysTrayMenu() { return systrayMenu; };
......
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