summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-16 11:32:06 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-16 11:53:45 (GMT)
commitc89baf194c976a16d4865955b4583caa3b337a8d (patch)
tree89b19c7bbbee2d95fad9e00006746e1298f0d550
parent4c34411151516badbf0e286c9a477845cb02b1cc (diff)
downloadQt-c89baf194c976a16d4865955b4583caa3b337a8d.zip
Qt-c89baf194c976a16d4865955b4583caa3b337a8d.tar.gz
Qt-c89baf194c976a16d4865955b4583caa3b337a8d.tar.bz2
Phonon: make EVR also the default for mingw and fix build with wince
-rw-r--r--src/3rdparty/phonon/ds9/qevr9.h143
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_default.cpp153
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_default.h55
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_evr.cpp412
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_evr.h126
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp112
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_vmr9.h1
-rw-r--r--src/3rdparty/phonon/ds9/videowidget.cpp20
-rw-r--r--src/plugins/phonon/ds9/ds9.pro14
9 files changed, 647 insertions, 389 deletions
diff --git a/src/3rdparty/phonon/ds9/qevr9.h b/src/3rdparty/phonon/ds9/qevr9.h
new file mode 100644
index 0000000..8599fce
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/qevr9.h
@@ -0,0 +1,143 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <d3d9.h>
+
+#define DXVA2_ProcAmp_Brightness 1
+#define DXVA2_ProcAmp_Contrast 2
+#define DXVA2_ProcAmp_Hue 4
+#define DXVA2_ProcAmp_Saturation 8
+
+typedef enum {
+ MFVideoARMode_None = 0x00000000,
+ MFVideoARMode_PreservePicture = 0x00000001,
+ MFVideoARMode_PreservePixel = 0x00000002,
+ MFVideoARMode_NonLinearStretch = 0x00000004,
+ MFVideoARMode_Mask = 0x00000007
+} MFVideoAspectRatioMode;
+
+typedef struct {
+ float left;
+ float top;
+ float right;
+ float bottom;
+} MFVideoNormalizedRect;
+
+typedef struct {
+ UINT DeviceCaps;
+ D3DPOOL InputPool;
+ UINT NumForwardRefSamples;
+ UINT NumBackwardRefSamples;
+ UINT Reserved;
+ UINT DeinterlaceTechnology;
+ UINT ProcAmpControlCaps;
+ UINT VideoProcessorOperations;
+ UINT NoiseFilterTechnology;
+ UINT DetailFilterTechnology;
+} DXVA2_VideoProcessorCaps;
+
+typedef struct {
+ union {
+ struct {
+ USHORT Fraction;
+ SHORT Value;
+ };
+ LONG ll;
+ };
+} DXVA2_Fixed32;
+
+typedef struct {
+ DXVA2_Fixed32 MinValue;
+ DXVA2_Fixed32 MaxValue;
+ DXVA2_Fixed32 DefaultValue;
+ DXVA2_Fixed32 StepSize;
+} DXVA2_ValueRange;
+
+typedef struct {
+ DXVA2_Fixed32 Brightness;
+ DXVA2_Fixed32 Contrast;
+ DXVA2_Fixed32 Hue;
+ DXVA2_Fixed32 Saturation;
+} DXVA2_ProcAmpValues;
+
+DXVA2_Fixed32 DXVA2FloatToFixed(const float _float_)
+{
+ DXVA2_Fixed32 _fixed_;
+ _fixed_.Fraction = LOWORD(_float_ * 0x10000);
+ _fixed_.Value = HIWORD(_float_ * 0x10000);
+ return _fixed_;
+}
+
+float DXVA2FixedToFloat(const DXVA2_Fixed32 _fixed_)
+{
+ return (FLOAT)_fixed_.Value + (FLOAT)_fixed_.Fraction / 0x10000;
+}
+
+#undef INTERFACE
+#define INTERFACE IMFVideoDisplayControl
+DECLARE_INTERFACE_(IMFVideoDisplayControl, IUnknown)
+{
+ STDMETHOD(GetNativeVideoSize)(THIS_ SIZE* pszVideo, SIZE* pszARVideo) PURE;
+ STDMETHOD(GetIdealVideoSize)(THIS_ SIZE* pszMin, SIZE* pszMax) PURE;
+ STDMETHOD(SetVideoPosition)(THIS_ const MFVideoNormalizedRect* pnrcSource, const LPRECT prcDest) PURE;
+ STDMETHOD(GetVideoPosition)(THIS_ MFVideoNormalizedRect* pnrcSource, LPRECT prcDest) PURE;
+ STDMETHOD(SetAspectRatioMode)(THIS_ DWORD dwAspectRatioMode) PURE;
+ STDMETHOD(GetAspectRatioMode)(THIS_ DWORD* pdwAspectRatioMode) PURE;
+ STDMETHOD(SetVideoWindow)(THIS_ HWND hwndVideo) PURE;
+ STDMETHOD(GetVideoWindow)(THIS_ HWND* phwndVideo) PURE;
+ STDMETHOD(RepaintVideo)(THIS_) PURE;
+ STDMETHOD(GetCurrentImage)(THIS_ BITMAPINFOHEADER* pBih, BYTE** pDib, DWORD* pcbDib, LONGLONG* pTimeStamp) PURE;
+ STDMETHOD(SetBorderColor)(THIS_ COLORREF Clr) PURE;
+ STDMETHOD(GetBorderColor)(THIS_ COLORREF* pClr) PURE;
+ STDMETHOD(SetRenderingPrefs)(THIS_ DWORD dwRenderFlags) PURE;
+ STDMETHOD(GetRenderingPrefs)(THIS_ DWORD* pdwRenderFlags) PURE;
+ STDMETHOD(SetFullScreen)(THIS_ BOOL fFullscreen) PURE;
+ STDMETHOD(GetFullScreen)(THIS_ BOOL* pfFullscreen) PURE;
+};
+#undef INTERFACE
+#define INTERFACE IMFVideoMixerControl
+DECLARE_INTERFACE_(IMFVideoMixerControl, IUnknown)
+{
+ STDMETHOD(SetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD dwZ) PURE;
+ STDMETHOD(GetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD* pdwZ) PURE;
+ STDMETHOD(SetStreamOutputRect)(THIS_ DWORD dwStreamID, const MFVideoNormalizedRect* pnrcOutput) PURE;
+ STDMETHOD(GetStreamOutputRect)(THIS_ DWORD dwStreamID, MFVideoNormalizedRect* pnrcOutput) PURE;
+};
+#undef INTERFACE
+#define INTERFACE IMFVideoProcessor
+DECLARE_INTERFACE_(IMFVideoProcessor, IUnknown)
+{
+ STDMETHOD(GetAvailableVideoProcessorModes)(THIS_ UINT* lpdwNumProcessingModes, GUID** ppVideoProcessingModes) PURE;
+ STDMETHOD(GetVideoProcessorCaps)(THIS_ LPGUID lpVideoProcessorMode, DXVA2_VideoProcessorCaps* lpVideoProcessorCaps) PURE;
+ STDMETHOD(GetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE;
+ STDMETHOD(SetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE;
+ STDMETHOD(GetProcAmpRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE;
+ STDMETHOD(GetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* Values) PURE;
+ STDMETHOD(SetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* pValues) PURE;
+ STDMETHOD(GetFilteringRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE;
+ STDMETHOD(GetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE;
+ STDMETHOD(SetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE;
+ STDMETHOD(GetBackgroundColor)(THIS_ COLORREF* lpClrBkg) PURE;
+ STDMETHOD(SetBackgroundColor)(THIS_ COLORREF ClrBkg) PURE;
+};
+#undef INTERFACE
+#define INTERFACE IMFGetService
+DECLARE_INTERFACE_(IMFGetService, IUnknown)
+{
+ STDMETHOD(GetService)(THIS_ REFGUID guidService, REFIID riid, LPVOID* ppvObject) PURE;
+};
+#undef INTERFACE
diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.cpp b/src/3rdparty/phonon/ds9/videorenderer_default.cpp
new file mode 100644
index 0000000..9d82255
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/videorenderer_default.cpp
@@ -0,0 +1,153 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "videorenderer_default.h"
+
+#ifndef QT_NO_PHONON_VIDEO
+
+#include <QtGui/QWidget>
+#include <QtGui/QPainter>
+
+#include <uuids.h>
+
+QT_BEGIN_NAMESPACE
+
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ VideoRendererDefault::~VideoRendererVMR9()
+ {
+ }
+
+ bool VideoRendererDefault::isNative() const
+ {
+ return true;
+ }
+
+
+ VideoRendererDefault::VideoRendererDefault(QWidget *target) : m_target(target)
+ {
+ m_target->setAttribute(Qt::WA_PaintOnScreen, true);
+ m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter);
+ }
+
+ QSize VideoRendererDefault::videoSize() const
+ {
+ LONG w = 0,
+ h = 0;
+ ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
+ if (basic) {
+ basic->GetVideoSize( &w, &h);
+ }
+ return QSize(w, h);
+ }
+
+ void VideoRendererDefault::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/)
+ {
+ //nothing to do here: the renderer paints everything
+ }
+
+ void VideoRendererDefault::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio,
+ Phonon::VideoWidget::ScaleMode scaleMode)
+ {
+ if (!isActive()) {
+ ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
+ if (basic) {
+ basic->SetDestinationPosition(0, 0, 0, 0);
+ }
+ return;
+ }
+
+ ComPointer<IVideoWindow> video(m_filter, IID_IVideoWindow);
+
+ OAHWND owner;
+ HRESULT hr = video->get_Owner(&owner);
+ if (FAILED(hr)) {
+ return;
+ }
+
+ const OAHWND newOwner = reinterpret_cast<OAHWND>(m_target->winId());
+ if (owner != newOwner) {
+ video->put_Owner(newOwner);
+ video->put_MessageDrain(newOwner);
+ video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
+ }
+
+ //make sure the widget takes the whole size of the parent
+ video->SetWindowPosition(0, 0, size.width(), size.height());
+
+ const QSize vsize = videoSize();
+ internalNotifyResize(size, vsize, aspectRatio, scaleMode);
+
+ ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
+ if (basic) {
+ basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight);
+ }
+ }
+
+ void VideoRendererDefault::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/)
+ {
+ //this can't be supported for the default renderer
+ }
+
+ QImage VideoRendererDefault::snapshot() const
+ {
+ ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
+ if (basic) {
+ LONG bufferSize = 0;
+ //1st we get the buffer size
+ basic->GetCurrentImage(&bufferSize, 0);
+
+ QByteArray buffer;
+ buffer.resize(bufferSize);
+ HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast<long*>(buffer.data()));
+
+ if (SUCCEEDED(hr)) {
+
+ const BITMAPINFOHEADER *bmi = reinterpret_cast<const BITMAPINFOHEADER*>(buffer.constData());
+
+ const int w = qAbs(bmi->biWidth),
+ h = qAbs(bmi->biHeight);
+
+ // Create image and copy data into image.
+ QImage ret(w, h, QImage::Format_RGB32);
+
+ if (!ret.isNull()) {
+ const char *data = buffer.constData() + bmi->biSize;
+ const int bytes_per_line = w * sizeof(QRgb);
+ for (int y = h - 1; y >= 0; --y) {
+ qMemCopy(ret.scanLine(y), //destination
+ data, //source
+ bytes_per_line);
+ data += bytes_per_line;
+ }
+ }
+ return ret;
+ }
+ }
+ return QImage();
+ }
+
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif //QT_NO_PHONON_VIDEO
diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.h b/src/3rdparty/phonon/ds9/videorenderer_default.h
new file mode 100644
index 0000000..43768d9
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/videorenderer_default.h
@@ -0,0 +1,55 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PHONON_VIDEORENDERER_DEFAULT_H
+#define PHONON_VIDEORENDERER_DEFAULT_H
+
+#include "abstractvideorenderer.h"
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_PHONON_VIDEO
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ class VideoRendererDefault : public AbstractVideoRenderer
+ {
+ public:
+ VideoRendererDefault(QWidget *target);
+ ~VideoRendererDefault();
+
+ //Implementation from AbstractVideoRenderer
+ void repaintCurrentFrame(QWidget *target, const QRect &rect);
+ void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode);
+ QSize videoSize() const;
+ QImage snapshot() const;
+ void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation);
+ bool isNative() const;
+ private:
+ QWidget *m_target;
+ };
+ }
+}
+
+#endif //QT_NO_PHONON_VIDEO
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp
index 3c6ee0d..d23d9ce 100644
--- a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp
+++ b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp
@@ -1,197 +1,215 @@
-/* This file is part of the KDE project.
-
-Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-
-This library is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation, either version 2.1 or 3 of the License.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this library. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-
-#include "videorenderer_evr.h"
-
-#ifndef QT_NO_PHONON_VIDEO
-
-#include <QtGui/QWidget>
-#include <QtGui/QPainter>
-#include <QtCore/QTimerEvent>
-
-#include <d3d9.h>
-#include <Evr9.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace Phonon
-{
- namespace DS9
- {
- VideoRendererEVR::~VideoRendererEVR()
- {
- }
-
- bool VideoRendererEVR::isNative() const
- {
- return true;
- }
-
- VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target)
- {
- m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter);
- if (!m_filter) {
- qWarning("the video widget could not be initialized correctly");
- return;
- }
-
- ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
-
- filterControl->SetVideoWindow(reinterpret_cast<HWND>(target->winId()));
- filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size
- }
-
- QImage VideoRendererEVR::snapshot() const
- {
- // TODO test
- // This will always capture black areas where no video is drawn, if any are present.
- // Due to the hack in notifyResize()
- ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
- if (filterControl) {
- BITMAPINFOHEADER bmi;
- BYTE *buffer = 0;
- DWORD bufferSize;
- LONGLONG timeStamp;
-
- bmi.biSize = sizeof(BITMAPINFOHEADER);
-
- HRESULT hr = filterControl->GetCurrentImage(&bmi, &buffer, &bufferSize, &timeStamp);
- if (SUCCEEDED(hr)) {
-
- const int w = qAbs(bmi.biWidth),
- h = qAbs(bmi.biHeight);
-
- // Create image and copy data into image.
- QImage ret(w, h, QImage::Format_RGB32);
-
- if (!ret.isNull()) {
- uchar *data = buffer;
- const int bytes_per_line = w * sizeof(QRgb);
- for (int y = h - 1; y >= 0; --y) {
- qMemCopy(ret.scanLine(y), //destination
- data, //source
- bytes_per_line);
- data += bytes_per_line;
- }
- }
- ::CoTaskMemFree(buffer);
- return ret;
- }
- }
- return QImage();
- }
-
- QSize VideoRendererEVR::videoSize() const
- {
- SIZE nativeSize;
- SIZE aspectRatioSize;
-
- ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
-
- filterControl->GetNativeVideoSize(&nativeSize, &aspectRatioSize);
-
- return QSize(nativeSize.cx, nativeSize.cy);
- }
-
- void VideoRendererEVR::repaintCurrentFrame(QWidget *target, const QRect &rect)
- {
- // repaint the video
- ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
- // All failed results can be safely ignored
- filterControl->RepaintVideo();
- }
-
- void VideoRendererEVR::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio,
- Phonon::VideoWidget::ScaleMode scaleMode)
- {
- if (!isActive()) {
- RECT dummyRect = { 0, 0, 0, 0};
- ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
- filterControl->SetVideoPosition(0, &dummyRect);
- return;
- }
-
- const QSize vsize = videoSize();
- internalNotifyResize(size, vsize, aspectRatio, scaleMode);
-
- RECT dstRectWin = { 0, 0, size.width(), size.height()};
-
- // Resize the Stream output rect instead of the destination rect.
- // Hacky workaround for flicker in the areas outside of the destination rect
- // This way these areas don't exist
- MFVideoNormalizedRect streamOutputRect = { float(m_dstX) / float(size.width()), float(m_dstY) / float(size.height()),
- float(m_dstWidth + m_dstX) / float(size.width()), float(m_dstHeight + m_dstY) / float(size.height())};
-
- ComPointer<IMFVideoMixerControl> filterMixer = getService<IMFVideoMixerControl>(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl);
- ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
-
- filterMixer->SetStreamOutputRect(0, &streamOutputRect);
- filterControl->SetVideoPosition(0, &dstRectWin);
- }
-
- void VideoRendererEVR::applyMixerSettings(qreal brightness, qreal contrast, qreal hue, qreal saturation)
- {
- InputPin sink = BackendNode::pins(m_filter, PINDIR_INPUT).first();
- OutputPin source;
- if (FAILED(sink->ConnectedTo(source.pparam()))) {
- return; //it must be connected to work
- }
-
- // Get the "Video Processor" (used for brightness/contrast/saturation/hue)
- ComPointer<IMFVideoProcessor> processor = getService<IMFVideoProcessor>(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor);
- Q_ASSERT(processor);
-
- DXVA2_ValueRange contrastRange;
- DXVA2_ValueRange brightnessRange;
- DXVA2_ValueRange saturationRange;
- DXVA2_ValueRange hueRange;
-
- if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Contrast, &contrastRange)))
- return;
- if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Brightness, &brightnessRange)))
- return;
- if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Saturation, &saturationRange)))
- return;
- if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Hue, &hueRange)))
- return;
-
- DXVA2_ProcAmpValues values;
-
- values.Contrast = DXVA2FloatToFixed(((contrast < 0
- ? DXVA2FixedToFloat(contrastRange.MinValue) : DXVA2FixedToFloat(contrastRange.MaxValue))
- - DXVA2FixedToFloat(contrastRange.DefaultValue)) * qAbs(contrast) + DXVA2FixedToFloat(contrastRange.DefaultValue));
- values.Brightness = DXVA2FloatToFixed(((brightness < 0
- ? DXVA2FixedToFloat(brightnessRange.MinValue) : DXVA2FixedToFloat(brightnessRange.MaxValue))
- - DXVA2FixedToFloat(brightnessRange.DefaultValue)) * qAbs(brightness) + DXVA2FixedToFloat(brightnessRange.DefaultValue));
- values.Saturation = DXVA2FloatToFixed(((saturation < 0
- ? DXVA2FixedToFloat(saturationRange.MinValue) : DXVA2FixedToFloat(saturationRange.MaxValue))
- - DXVA2FixedToFloat(saturationRange.DefaultValue)) * qAbs(saturation) + DXVA2FixedToFloat(saturationRange.DefaultValue));
- values.Hue = DXVA2FloatToFixed(((hue < 0
- ? DXVA2FixedToFloat(hueRange.MinValue) : DXVA2FixedToFloat(hueRange.MaxValue))
- - DXVA2FixedToFloat(hueRange.DefaultValue)) * qAbs(hue) + DXVA2FixedToFloat(hueRange.DefaultValue));
-
- //finally set the settings
- processor->SetProcAmpValues(DXVA2_ProcAmp_Contrast | DXVA2_ProcAmp_Brightness | DXVA2_ProcAmp_Saturation | DXVA2_ProcAmp_Hue, &values);
-
- }
- }
-}
-
-QT_END_NAMESPACE
-
-#endif //QT_NO_PHONON_VIDEO
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "videorenderer_evr.h"
+#include "qevr9.h"
+
+#ifndef QT_NO_PHONON_VIDEO
+
+#include <QtGui/QWidget>
+#include <QtGui/QPainter>
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ //we have to define them here because not all compilers/sdk have them
+ static const GUID MR_VIDEO_RENDER_SERVICE = {0x1092a86c, 0xab1a, 0x459a, {0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff} };
+ static const GUID MR_VIDEO_MIXER_SERVICE = { 0x73cd2fc, 0x6cf4, 0x40b7, {0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8} };
+ static const IID IID_IMFVideoDisplayControl = {0xa490b1e4, 0xab84, 0x4d31, {0xa1, 0xb2, 0x18, 0x1e, 0x03, 0xb1, 0x07, 0x7a} };
+ static const IID IID_IMFVideoMixerControl = {0xA5C6C53F, 0xC202, 0x4aa5, {0x96, 0x95, 0x17, 0x5B, 0xA8, 0xC5, 0x08, 0xA5} };
+ static const IID IID_IMFVideoProcessor = {0x6AB0000C, 0xFECE, 0x4d1f, {0xA2, 0xAC, 0xA9, 0x57, 0x35, 0x30, 0x65, 0x6E} };
+ static const IID IID_IMFGetService = {0xFA993888, 0x4383, 0x415A, {0xA9, 0x30, 0xDD, 0x47, 0x2A, 0x8C, 0xF6, 0xF7} };
+ static const GUID CLSID_EnhancedVideoRenderer = {0xfa10746c, 0x9b63, 0x4b6c, {0xbc, 0x49, 0xfc, 0x30, 0xe, 0xa5, 0xf2, 0x56} };
+
+ template <typename T> ComPointer<T> getService(const Filter &filter, REFGUID guidService, REFIID riid)
+ {
+ //normally we should use IID_IMFGetService but this introduces another dependency
+ //so here we simply define our own IId with the same value
+ ComPointer<IMFGetService> getService(filter, IID_IMFGetService);
+ Q_ASSERT(getService);
+ T *ptr = 0;
+ HRESULT hr = getService->GetService(guidService, riid, reinterpret_cast<void **>(&ptr));
+ if (!SUCCEEDED(hr) || ptr == 0)
+ Q_ASSERT(!SUCCEEDED(hr) && ptr != 0);
+ ComPointer<T> service(ptr);
+ return service;
+ }
+
+ VideoRendererEVR::~VideoRendererEVR()
+ {
+ }
+
+ bool VideoRendererEVR::isNative() const
+ {
+ return true;
+ }
+
+ VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target)
+ {
+ m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter);
+ if (!m_filter) {
+ return;
+ }
+
+ ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
+
+ filterControl->SetVideoWindow(reinterpret_cast<HWND>(target->winId()));
+ filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size
+ }
+
+ QImage VideoRendererEVR::snapshot() const
+ {
+ // This will always capture black areas where no video is drawn, if any are present.
+ // Due to the hack in notifyResize()
+ ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
+ if (filterControl) {
+ BITMAPINFOHEADER bmi;
+ BYTE *buffer = 0;
+ DWORD bufferSize;
+ LONGLONG timeStamp;
+
+ bmi.biSize = sizeof(BITMAPINFOHEADER);
+
+ HRESULT hr = filterControl->GetCurrentImage(&bmi, &buffer, &bufferSize, &timeStamp);
+ if (SUCCEEDED(hr)) {
+
+ const int w = qAbs(bmi.biWidth),
+ h = qAbs(bmi.biHeight);
+
+ // Create image and copy data into image.
+ QImage ret(w, h, QImage::Format_RGB32);
+
+ if (!ret.isNull()) {
+ uchar *data = buffer;
+ const int bytes_per_line = w * sizeof(QRgb);
+ for (int y = h - 1; y >= 0; --y) {
+ qMemCopy(ret.scanLine(y), //destination
+ data, //source
+ bytes_per_line);
+ data += bytes_per_line;
+ }
+ }
+ ::CoTaskMemFree(buffer);
+ return ret;
+ }
+ }
+ return QImage();
+ }
+
+ QSize VideoRendererEVR::videoSize() const
+ {
+ SIZE nativeSize;
+ SIZE aspectRatioSize;
+
+ ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
+
+ filterControl->GetNativeVideoSize(&nativeSize, &aspectRatioSize);
+
+ return QSize(nativeSize.cx, nativeSize.cy);
+ }
+
+ void VideoRendererEVR::repaintCurrentFrame(QWidget *target, const QRect &rect)
+ {
+ // repaint the video
+ ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
+ // All failed results can be safely ignored
+ filterControl->RepaintVideo();
+ }
+
+ void VideoRendererEVR::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio,
+ Phonon::VideoWidget::ScaleMode scaleMode)
+ {
+ if (!isActive()) {
+ RECT dummyRect = { 0, 0, 0, 0};
+ ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
+ filterControl->SetVideoPosition(0, &dummyRect);
+ return;
+ }
+
+ const QSize vsize = videoSize();
+ internalNotifyResize(size, vsize, aspectRatio, scaleMode);
+
+ RECT dstRectWin = { 0, 0, size.width(), size.height()};
+
+ // Resize the Stream output rect instead of the destination rect.
+ // Hacky workaround for flicker in the areas outside of the destination rect
+ // This way these areas don't exist
+ MFVideoNormalizedRect streamOutputRect = { float(m_dstX) / float(size.width()), float(m_dstY) / float(size.height()),
+ float(m_dstWidth + m_dstX) / float(size.width()), float(m_dstHeight + m_dstY) / float(size.height())};
+
+ ComPointer<IMFVideoMixerControl> filterMixer = getService<IMFVideoMixerControl>(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl);
+ ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl);
+
+ filterMixer->SetStreamOutputRect(0, &streamOutputRect);
+ filterControl->SetVideoPosition(0, &dstRectWin);
+ }
+
+ void VideoRendererEVR::applyMixerSettings(qreal brightness, qreal contrast, qreal hue, qreal saturation)
+ {
+ InputPin sink = BackendNode::pins(m_filter, PINDIR_INPUT).first();
+ OutputPin source;
+ if (FAILED(sink->ConnectedTo(source.pparam()))) {
+ return; //it must be connected to work
+ }
+
+ // Get the "Video Processor" (used for brightness/contrast/saturation/hue)
+ ComPointer<IMFVideoProcessor> processor = getService<IMFVideoProcessor>(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor);
+ Q_ASSERT(processor);
+
+ DXVA2_ValueRange contrastRange;
+ DXVA2_ValueRange brightnessRange;
+ DXVA2_ValueRange saturationRange;
+ DXVA2_ValueRange hueRange;
+
+ if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Contrast, &contrastRange)))
+ return;
+ if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Brightness, &brightnessRange)))
+ return;
+ if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Saturation, &saturationRange)))
+ return;
+ if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Hue, &hueRange)))
+ return;
+
+ DXVA2_ProcAmpValues values;
+
+ values.Contrast = DXVA2FloatToFixed(((contrast < 0
+ ? DXVA2FixedToFloat(contrastRange.MinValue) : DXVA2FixedToFloat(contrastRange.MaxValue))
+ - DXVA2FixedToFloat(contrastRange.DefaultValue)) * qAbs(contrast) + DXVA2FixedToFloat(contrastRange.DefaultValue));
+ values.Brightness = DXVA2FloatToFixed(((brightness < 0
+ ? DXVA2FixedToFloat(brightnessRange.MinValue) : DXVA2FixedToFloat(brightnessRange.MaxValue))
+ - DXVA2FixedToFloat(brightnessRange.DefaultValue)) * qAbs(brightness) + DXVA2FixedToFloat(brightnessRange.DefaultValue));
+ values.Saturation = DXVA2FloatToFixed(((saturation < 0
+ ? DXVA2FixedToFloat(saturationRange.MinValue) : DXVA2FixedToFloat(saturationRange.MaxValue))
+ - DXVA2FixedToFloat(saturationRange.DefaultValue)) * qAbs(saturation) + DXVA2FixedToFloat(saturationRange.DefaultValue));
+ values.Hue = DXVA2FloatToFixed(((hue < 0
+ ? DXVA2FixedToFloat(hueRange.MinValue) : DXVA2FixedToFloat(hueRange.MaxValue))
+ - DXVA2FixedToFloat(hueRange.DefaultValue)) * qAbs(hue) + DXVA2FixedToFloat(hueRange.DefaultValue));
+
+ //finally set the settings
+ processor->SetProcAmpValues(DXVA2_ProcAmp_Contrast | DXVA2_ProcAmp_Brightness | DXVA2_ProcAmp_Saturation | DXVA2_ProcAmp_Hue, &values);
+
+ }
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif //QT_NO_PHONON_VIDEO
diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.h b/src/3rdparty/phonon/ds9/videorenderer_evr.h
index 055e618..229c36d 100644
--- a/src/3rdparty/phonon/ds9/videorenderer_evr.h
+++ b/src/3rdparty/phonon/ds9/videorenderer_evr.h
@@ -1,70 +1,56 @@
-/* This file is part of the KDE project.
-
-Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-
-This library is free software: you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation, either version 2.1 or 3 of the License.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with this library. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef PHONON_VIDEORENDERER_EVR_H
-#define PHONON_VIDEORENDERER_EVR_H
-
-#include "abstractvideorenderer.h"
-#include "compointer.h"
-
-#include <Mfidl.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_PHONON_VIDEO
-
-namespace Phonon
-{
- namespace DS9
- {
- class VideoRendererEVR : public AbstractVideoRenderer
- {
- public:
- VideoRendererEVR(QWidget *target);
- ~VideoRendererEVR();
-
- //Implementation from AbstractVideoRenderer
- void repaintCurrentFrame(QWidget *target, const QRect &rect);
- void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode);
- QSize videoSize() const;
- QImage snapshot() const;
- void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation);
- bool isNative() const;
- private:
- QWidget *m_target;
-
- template <typename T> ComPointer<T> getService(REFGUID guidService, REFIID riid) const
- {
- ComPointer<IMFGetService> getService(m_filter, IID_IMFGetService);
- Q_ASSERT(getService);
- T *ptr = 0;
- HRESULT hr = getService->GetService(guidService, riid, (void **) &ptr);
- if (!SUCCEEDED(hr) || ptr == 0)
- Q_ASSERT(!SUCCEEDED(hr) && ptr != 0);
- ComPointer<T> service(ptr);
- return service;
- }
- };
- }
-}
-
-#endif //QT_NO_PHONON_VIDEO
-
-QT_END_NAMESPACE
-
-#endif
-
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PHONON_VIDEORENDERER_EVR_H
+#define PHONON_VIDEORENDERER_EVR_H
+
+#include "abstractvideorenderer.h"
+#include "compointer.h"
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_PHONON_VIDEO
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ class VideoRendererEVR : public AbstractVideoRenderer
+ {
+ public:
+ VideoRendererEVR(QWidget *target);
+ ~VideoRendererEVR();
+
+ //Implementation from AbstractVideoRenderer
+ void repaintCurrentFrame(QWidget *target, const QRect &rect);
+ void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode);
+ QSize videoSize() const;
+ QImage snapshot() const;
+ void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation);
+ bool isNative() const;
+ private:
+ QWidget *m_target;
+ };
+ }
+}
+
+#endif //QT_NO_PHONON_VIDEO
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp
index 81ebb8b..545b31e 100644
--- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp
+++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp
@@ -22,14 +22,9 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <QtGui/QWidget>
#include <QtGui/QPainter>
-#include <QtCore/QTimerEvent>
-#ifndef Q_OS_WINCE
#include <d3d9.h>
#include <vmr9.h>
-#else
-#include <uuids.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -48,116 +43,10 @@ namespace Phonon
}
-#ifdef Q_OS_WINCE
- VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target)
- {
- m_target->setAttribute(Qt::WA_PaintOnScreen, true);
- m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter);
- }
-
- QSize VideoRendererVMR9::videoSize() const
- {
- LONG w = 0,
- h = 0;
- ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
- if (basic) {
- basic->GetVideoSize( &w, &h);
- }
- return QSize(w, h);
- }
-
- void VideoRendererVMR9::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/)
- {
- //nothing to do here: the renderer paints everything
- }
-
- void VideoRendererVMR9::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio,
- Phonon::VideoWidget::ScaleMode scaleMode)
- {
- if (!isActive()) {
- ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
- if (basic) {
- basic->SetDestinationPosition(0, 0, 0, 0);
- }
- return;
- }
-
- ComPointer<IVideoWindow> video(m_filter, IID_IVideoWindow);
-
- OAHWND owner;
- HRESULT hr = video->get_Owner(&owner);
- if (FAILED(hr)) {
- return;
- }
-
- const OAHWND newOwner = reinterpret_cast<OAHWND>(m_target->winId());
- if (owner != newOwner) {
- video->put_Owner(newOwner);
- video->put_MessageDrain(newOwner);
- video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
- }
-
- //make sure the widget takes the whole size of the parent
- video->SetWindowPosition(0, 0, size.width(), size.height());
-
- const QSize vsize = videoSize();
- internalNotifyResize(size, vsize, aspectRatio, scaleMode);
-
- ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
- if (basic) {
- basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight);
- }
- }
-
- void VideoRendererVMR9::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/)
- {
- //this can't be supported for WinCE
- }
-
- QImage VideoRendererVMR9::snapshot() const
- {
- ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo);
- if (basic) {
- LONG bufferSize = 0;
- //1st we get the buffer size
- basic->GetCurrentImage(&bufferSize, 0);
-
- QByteArray buffer;
- buffer.resize(bufferSize);
- HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast<long*>(buffer.data()));
-
- if (SUCCEEDED(hr)) {
-
- const BITMAPINFOHEADER *bmi = reinterpret_cast<const BITMAPINFOHEADER*>(buffer.constData());
-
- const int w = qAbs(bmi->biWidth),
- h = qAbs(bmi->biHeight);
-
- // Create image and copy data into image.
- QImage ret(w, h, QImage::Format_RGB32);
-
- if (!ret.isNull()) {
- const char *data = buffer.constData() + bmi->biSize;
- const int bytes_per_line = w * sizeof(QRgb);
- for (int y = h - 1; y >= 0; --y) {
- qMemCopy(ret.scanLine(y), //destination
- data, //source
- bytes_per_line);
- data += bytes_per_line;
- }
- }
- return ret;
- }
- }
- return QImage();
- }
-
-#else
VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target)
{
m_filter = Filter(CLSID_VideoMixingRenderer9, IID_IBaseFilter);
if (!m_filter) {
- qWarning("the video widget could not be initialized correctly");
return;
}
@@ -325,7 +214,6 @@ namespace Phonon
//finally set the settings
mixer->SetProcAmpControl(0, &ctrl);
}
-#endif
}
}
diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h
index 4eb237e..516d79d 100644
--- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h
+++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h
@@ -19,7 +19,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#define PHONON_VIDEORENDERER_VMR9_H
#include "abstractvideorenderer.h"
-#include "compointer.h"
QT_BEGIN_NAMESPACE
diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp
index f71eb6f..59abb04 100644
--- a/src/3rdparty/phonon/ds9/videowidget.cpp
+++ b/src/3rdparty/phonon/ds9/videowidget.cpp
@@ -24,8 +24,12 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "mediaobject.h"
+#ifndef Q_OS_WINCE
#include "videorenderer_evr.h"
#include "videorenderer_vmr9.h"
+#else
+#include "videorenderer_default.h"
+#endif
#include "videorenderer_soft.h"
QT_BEGIN_NAMESPACE
@@ -351,20 +355,28 @@ namespace Phonon
if (m_renderers[index] == 0 && autoCreate) {
AbstractVideoRenderer *renderer = 0;
if (type == Native) {
+#ifndef Q_OS_WINCE
renderer = new VideoRendererEVR(m_widget);
if (renderer->getFilter() == 0) {
delete renderer;
- renderer = 0;
- }
- if (renderer == 0) {
+ //EVR not present, let's try VMR
renderer = new VideoRendererVMR9(m_widget);
if (renderer->getFilter() == 0) {
- //instanciating the renderer might fail with error VFW_E_DDRAW_CAPS_NOT_SUITABLE (0x80040273)
+ //instanciating the renderer might fail
m_noNativeRendererSupported = true;
delete renderer;
renderer = 0;
}
}
+#else
+ renderer = new VideoRendererVMR9(m_widget);
+ if (renderer->getFilter() == 0) {
+ //instanciating the renderer might fail
+ m_noNativeRendererSupported = true;
+ delete renderer;
+ renderer = 0;
+ }
+#endif
}
if (renderer == 0) {
diff --git a/src/plugins/phonon/ds9/ds9.pro b/src/plugins/phonon/ds9/ds9.pro
index 440f2c5..301808e 100644
--- a/src/plugins/phonon/ds9/ds9.pro
+++ b/src/plugins/phonon/ds9/ds9.pro
@@ -3,7 +3,7 @@ QT += phonon
win32:!wince*:contains(QT_CONFIG,opengl):LIBS += -lopengl32
win32:!wince*:LIBS += -lgdi32
win32-msvc2005:DEFINES += _CRT_SECURE_NO_WARNINGS
-LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 -lMfuuid -lStrmiids
+LIBS += -lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32
TARGET = phonon_ds9
DEFINES += PHONON_MAKE_QT_ONLY_BACKEND
@@ -22,8 +22,6 @@ HEADERS += \
$$PHONON_DS9_DIR/mediaobject.h \
$$PHONON_DS9_DIR/videowidget.h \
$$PHONON_DS9_DIR/videorenderer_soft.h \
- $$PHONON_DS9_DIR/videorenderer_vmr9.h \
- $$PHONON_DS9_DIR/videorenderer_evr.h \
$$PHONON_DS9_DIR/volumeeffect.h \
$$PHONON_DS9_DIR/qbasefilter.h \
$$PHONON_DS9_DIR/qpin.h \
@@ -46,8 +44,6 @@ SOURCES += \
$$PHONON_DS9_DIR/mediaobject.cpp \
$$PHONON_DS9_DIR/videowidget.cpp \
$$PHONON_DS9_DIR/videorenderer_soft.cpp \
- $$PHONON_DS9_DIR/videorenderer_vmr9.cpp \
- $$PHONON_DS9_DIR/videorenderer_evr.cpp \
$$PHONON_DS9_DIR/volumeeffect.cpp \
$$PHONON_DS9_DIR/qbasefilter.cpp \
$$PHONON_DS9_DIR/qpin.cpp \
@@ -55,6 +51,14 @@ SOURCES += \
$$PHONON_DS9_DIR/qaudiocdreader.cpp \
$$PHONON_DS9_DIR/qmeminputpin.cpp
+#the EVR renderer (only available on desktop)
+!wince*:SOURCES += $$PHONON_DS9_DIR/videorenderer_evr.cpp \
+ $$PHONON_DS9_DIR/videorenderer_vmr9.cpp
+!wince*:HEADERS += $$PHONON_DS9_DIR/qevr9.h \
+ $$PHONON_DS9_DIR/videorenderer_evr.h \
+ $$PHONON_DS9_DIR/videorenderer_vmr9.h
+wince*:SOURCES += $$PHONON_DS9_DIR/videorenderer_default.cpp
+wince*:HEADERS += $$PHONON_DS9_DIR/videorenderer_default.h
target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend
INSTALLS += target