summaryrefslogtreecommitdiffstats
path: root/src/plugins/directshow/player/vmr9videowindowcontrol.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-09-10 18:25:37 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-11-05 11:34:55 +0000
commit95bd9d58d8d37ddec8d37f5b35128689c0aa55a8 (patch)
treeecf8820d012953caee0f516e349757c8362a95b2 /src/plugins/directshow/player/vmr9videowindowcontrol.cpp
parentb2e9ae8856f5297289ab5e1f48bda12ef2201b97 (diff)
DirectShow: use the EVR in the window control.
Reuse existing code from the WMF plugin, which already uses the EVR. This enables HW-accelerated video decoding when using QMediaPlayer with a QVideoWidget. Task-number: QTBUG-45593 Change-Id: I757e4d53cd2c648aee6ba33a4851a8c6adc62843 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/directshow/player/vmr9videowindowcontrol.cpp')
-rw-r--r--src/plugins/directshow/player/vmr9videowindowcontrol.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/directshow/player/vmr9videowindowcontrol.cpp b/src/plugins/directshow/player/vmr9videowindowcontrol.cpp
index 48ff6c2c3..853ca031c 100644
--- a/src/plugins/directshow/player/vmr9videowindowcontrol.cpp
+++ b/src/plugins/directshow/player/vmr9videowindowcontrol.cpp
@@ -35,13 +35,16 @@
#include "directshowglobal.h"
+#ifndef QT_NO_WIDGETS
#include <QtGui/QPalette>
#include <QtWidgets/QWidget>
+#endif
Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent)
: QVideoWindowControl(parent)
- , m_filter(com_new<IBaseFilter>(CLSID_VideoMixingRenderer9, IID_IBaseFilter))
+ , m_filter(com_new<IBaseFilter>(CLSID_VideoMixingRenderer9))
, m_windowId(0)
+ , m_windowColor(RGB(0, 0, 0))
, m_dirtyValues(0)
, m_aspectRatioMode(Qt::KeepAspectRatio)
, m_brightness(0)
@@ -74,11 +77,13 @@ void Vmr9VideoWindowControl::setWinId(WId id)
{
m_windowId = id;
+#ifndef QT_NO_WIDGETS
if (QWidget *widget = QWidget::find(m_windowId)) {
const QColor color = widget->palette().color(QPalette::Window);
m_windowColor = RGB(color.red(), color.green(), color.blue());
}
+#endif
if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
m_filter, IID_IVMRWindowlessControl9)) {