diff options
author | Andy Shaw <qt-info@nokia.com> | 2010-11-24 10:57:49 (GMT) |
---|---|---|
committer | Andy Shaw <qt-info@nokia.com> | 2010-11-24 10:57:49 (GMT) |
commit | ba9816d1160998abe75b8b45f4b1c14985119553 (patch) | |
tree | dea1708ae66f4775fe82934e675d54a55805a730 /src | |
parent | b91221ebe4acc5f59793b1070dd134ed56eb91fb (diff) | |
download | Qt-ba9816d1160998abe75b8b45f4b1c14985119553.zip Qt-ba9816d1160998abe75b8b45f4b1c14985119553.tar.gz Qt-ba9816d1160998abe75b8b45f4b1c14985119553.tar.bz2 |
Ensure that if this is does not have a valid filter when on XP or less
The renderer is only supported on Windows Vista or later so if we are
on an earlier version of Windows then this should not be used. In
addition this patch also ensures that it resets the filter if any of the
needed functions fail.
Task-number: QTBUG-13062
Reviewed-by: Thierry Bastian
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/phonon/ds9/videorenderer_evr.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp index de3f46f..ff39eccc4 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp @@ -62,19 +62,21 @@ namespace Phonon VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target) { + if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA) + return; m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter); if (!m_filter) { return; } ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); - if (!filterControl) { + if (!filterControl || + FAILED(filterControl->SetVideoWindow(reinterpret_cast<HWND>(target->winId()))) || + FAILED(filterControl->SetAspectRatioMode(MFVideoARMode_None)) || // We're in control of the size + !getService<IMFVideoMixerControl>(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl) || + !getService<IMFVideoProcessor>(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor)) { m_filter = Filter(); //will release the interface - return; } - - filterControl->SetVideoWindow(reinterpret_cast<HWND>(target->winId())); - filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size } QImage VideoRendererEVR::snapshot() const |