summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-03-30 01:50:52 (GMT)
committerDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2010-03-30 01:50:52 (GMT)
commitd123f41136914e2622af1680dbe3201dabd9823e (patch)
treeef9562b20d66cac0f02d62d7e316e799a038b85a /src
parenta1d30018e104bbc17ccebae742f72c0e39e1e7f6 (diff)
parent66a58d87c2d54bd4332ec9a8607222ac5c6521f1 (diff)
downloadQt-d123f41136914e2622af1680dbe3201dabd9823e.zip
Qt-d123f41136914e2622af1680dbe3201dabd9823e.tar.gz
Qt-d123f41136914e2622af1680dbe3201dabd9823e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7
Diffstat (limited to 'src')
-rw-r--r--src/multimedia/base/qvideowidget.cpp34
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp1
2 files changed, 28 insertions, 7 deletions
diff --git a/src/multimedia/base/qvideowidget.cpp b/src/multimedia/base/qvideowidget.cpp
index 3820af9..b791abd 100644
--- a/src/multimedia/base/qvideowidget.cpp
+++ b/src/multimedia/base/qvideowidget.cpp
@@ -218,13 +218,23 @@ void QRendererVideoWidgetBackend::paintEvent(QPaintEvent *event)
{
QPainter painter(m_widget);
+ if (m_widget->testAttribute(Qt::WA_OpaquePaintEvent)) {
+ QRegion borderRegion = event->region();
+ borderRegion = borderRegion.subtracted(m_boundingRect);
+
+ QBrush brush = m_widget->palette().window();
+
+ QVector<QRect> rects = borderRegion.rects();
+ for (QVector<QRect>::iterator it = rects.begin(), end = rects.end(); it != end; ++it) {
+ painter.fillRect(*it, brush);
+ }
+ }
+
if (m_surface->isActive() && m_boundingRect.intersects(event->rect())) {
m_surface->paint(&painter, m_boundingRect, m_sourceRect);
m_surface->setReady(true);
} else {
- painter.fillRect(event->rect(), m_widget->palette().background());
-
#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1)
if (m_updatePaintDevice && (painter.paintEngine()->type() == QPaintEngine::OpenGL
|| painter.paintEngine()->type() == QPaintEngine::OpenGL2)) {
@@ -239,6 +249,7 @@ void QRendererVideoWidgetBackend::paintEvent(QPaintEvent *event)
}
#endif
}
+
}
void QRendererVideoWidgetBackend::formatChanged(const QVideoSurfaceFormat &format)
@@ -248,6 +259,7 @@ void QRendererVideoWidgetBackend::formatChanged(const QVideoSurfaceFormat &forma
updateRects();
m_widget->updateGeometry();
+ m_widget->update();
}
void QRendererVideoWidgetBackend::frameChanged()
@@ -364,6 +376,12 @@ void QWindowVideoWidgetBackend::resizeEvent(QResizeEvent *)
void QWindowVideoWidgetBackend::paintEvent(QPaintEvent *event)
{
+ if (m_widget->testAttribute(Qt::WA_OpaquePaintEvent)) {
+ QPainter painter(m_widget);
+
+ painter.fillRect(event->rect(), m_widget->palette().window());
+ }
+
m_windowControl->repaint();
event->accept();
@@ -504,6 +522,7 @@ void QVideoWidgetPrivate::_q_fullScreenChanged(bool fullScreen)
void QVideoWidgetPrivate::_q_dimensionsChanged()
{
q_func()->updateGeometry();
+ q_func()->update();
}
/*!
@@ -545,10 +564,6 @@ QVideoWidget::QVideoWidget(QWidget *parent)
, d_ptr(new QVideoWidgetPrivate)
{
d_ptr->q_ptr = this;
-
- QPalette palette = QWidget::palette();
- palette.setColor(QPalette::Background, Qt::black);
- setPalette(palette);
}
/*!
@@ -913,8 +928,13 @@ void QVideoWidget::paintEvent(QPaintEvent *event)
{
Q_D(QVideoWidget);
- if (d->currentBackend)
+ if (d->currentBackend) {
d->currentBackend->paintEvent(event);
+ } else if (testAttribute(Qt::WA_OpaquePaintEvent)) {
+ QPainter painter(this);
+
+ painter.fillRect(event->rect(), palette().window());
+ }
}
#include "moc_qvideowidget.cpp"
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
index e25dd99..1c6df2c 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
@@ -61,6 +61,7 @@ Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent)
if (IVMRFilterConfig9 *config = com_cast<IVMRFilterConfig9>(m_filter, IID_IVMRFilterConfig9)) {
config->SetRenderingMode(VMR9Mode_Windowless);
config->SetNumberOfStreams(1);
+ config->SetRenderingPrefs(RenderPrefs9_DoNotRenderBorder);
config->Release();
}
}