summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2010-02-25 07:32:40 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2010-02-25 07:32:40 (GMT)
commit4124bff7eb55ca2026bb89198950991a0804d0e6 (patch)
treee900aa7dd7eee878e0914fd410e3cde44bb57465
parent44accdad194251062be74aeafac2cc9d856df479 (diff)
downloadQt-4124bff7eb55ca2026bb89198950991a0804d0e6.zip
Qt-4124bff7eb55ca2026bb89198950991a0804d0e6.tar.gz
Qt-4124bff7eb55ca2026bb89198950991a0804d0e6.tar.bz2
Make the Direct Show media service compile with mingw.
There a number of interfaces and guid constants used by the media service that aren't defined by mingw. Define these locally. Reviewed-by: Justin McPherson
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp6
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h71
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp6
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp34
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h3
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp55
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp14
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h4
10 files changed, 152 insertions, 45 deletions
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
index 30c05ed..5f72ca6 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
@@ -82,6 +82,7 @@ QList<QString> DirectShowAudioEndpointControl::availableEndpoints() const
QString DirectShowAudioEndpointControl::endpointDescription(const QString &name) const
{
+#ifdef __IPropertyBag_INTERFACE_DEFINED__
QString description;
if (IMoniker *moniker = m_devices.value(name, 0)) {
@@ -97,7 +98,10 @@ QString DirectShowAudioEndpointControl::endpointDescription(const QString &name)
}
}
- return description;;
+ return description;
+#else
+ return name.section(QLatin1Char('\\'), -1);
+#endif
}
QString DirectShowAudioEndpointControl::defaultEndpoint() const
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
index 7601672..e43e2a7 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
@@ -42,6 +42,8 @@
#ifndef DIRECTSHOWGLOBAL_H
#define DIRECTSHOWGLOBAL_H
+#include <QtCore/qglobal.h>
+
#include <dshow.h>
QT_BEGIN_HEADER
@@ -73,4 +75,73 @@ QT_END_NAMESPACE
QT_END_HEADER
+#ifndef __IFilterGraph2_INTERFACE_DEFINED__
+#define __IFilterGraph2_INTERFACE_DEFINED__
+#define INTERFACE IFilterGraph2
+DECLARE_INTERFACE_(IFilterGraph2 ,IGraphBuilder)
+{
+ STDMETHOD(AddSourceFilterForMoniker)(THIS_ IMoniker *, IBindCtx *, LPCWSTR,IBaseFilter **) PURE;
+ STDMETHOD(ReconnectEx)(THIS_ IPin *, const AM_MEDIA_TYPE *) PURE;
+ STDMETHOD(RenderEx)(IPin *, DWORD, DWORD *) PURE;
+};
+#undef INTERFACE
+#endif
+
+#ifndef __IAMFilterMiscFlags_INTERFACE_DEFINED__
+#define __IAMFilterMiscFlags_INTERFACE_DEFINED__
+#define INTERFACE IAMFilterMiscFlags
+DECLARE_INTERFACE_(IAMFilterMiscFlags ,IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ STDMETHOD_(ULONG,GetMiscFlags)(THIS) PURE;
+};
+#undef INTERFACE
+#endif
+
+#ifndef __IFileSourceFilter_INTERFACE_DEFINED__
+#define __IFileSourceFilter_INTERFACE_DEFINED__
+#define INTERFACE IFileSourceFilter
+DECLARE_INTERFACE_(IFileSourceFilter ,IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ STDMETHOD(Load)(THIS_ LPCOLESTR, const AM_MEDIA_TYPE *) PURE;
+ STDMETHOD(GetCurFile)(THIS_ LPOLESTR *ppszFileName, AM_MEDIA_TYPE *) PURE;
+};
+#undef INTERFACE
+#endif
+
+#ifndef __IAMOpenProgress_INTERFACE_DEFINED__
+#define __IAMOpenProgress_INTERFACE_DEFINED__
+#define INTERFACE IAMOpenProgress
+DECLARE_INTERFACE_(IAMOpenProgress ,IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ STDMETHOD(QueryProgress)(THIS_ LONGLONG *, LONGLONG *) PURE;
+ STDMETHOD(AbortOperation)(THIS) PURE;
+};
+#undef INTERFACE
+#endif
+
+#ifndef __IFilterChain_INTERFACE_DEFINED__
+#define __IFilterChain_INTERFACE_DEFINED__
+#define INTERFACE IFilterChain
+DECLARE_INTERFACE_(IFilterChain ,IUnknown)
+{
+ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+ STDMETHOD(StartChain)(IBaseFilter *, IBaseFilter *) PURE;
+ STDMETHOD(PauseChain)(IBaseFilter *, IBaseFilter *) PURE;
+ STDMETHOD(StopChain)(IBaseFilter *, IBaseFilter *) PURE;
+ STDMETHOD(RemoveChain)(IBaseFilter *, IBaseFilter *) PURE;
+};
+#undef INTERFACE
+#endif
+
#endif
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp
index 15bfea5..7b66d56 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp
@@ -121,6 +121,10 @@ void DirectShowIOSource::setAllocator(IMemAllocator *allocator)
// IUnknown
HRESULT DirectShowIOSource::QueryInterface(REFIID riid, void **ppvObject)
{
+ // 2dd74950-a890-11d1-abe8-00a0c905f375
+ static const GUID iid_IAmFilterMiscFlags = {
+ 0x2dd74950, 0xa890, 0x11d1, {0xab, 0xe8, 0x00, 0xa0, 0xc9, 0x05, 0xf3, 0x75}};
+
if (!ppvObject) {
return E_POINTER;
} else if (riid == IID_IUnknown
@@ -128,7 +132,7 @@ HRESULT DirectShowIOSource::QueryInterface(REFIID riid, void **ppvObject)
|| riid == IID_IMediaFilter
|| riid == IID_IBaseFilter) {
*ppvObject = static_cast<IBaseFilter *>(this);
- } else if (riid == IID_IAMFilterMiscFlags) {
+ } else if (riid == iid_IAmFilterMiscFlags) {
*ppvObject = static_cast<IAMFilterMiscFlags *>(this);
} else if (riid == IID_IPin) {
*ppvObject = static_cast<IPin *>(this);
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h
index b626473..3eb9a88 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h
@@ -42,11 +42,11 @@
#ifndef DIRECTSHOWIOSOURCE_H
#define DIRECTSHOWIOSOURCE_H
+#include "directshowglobal.h"
#include "directshowioreader.h"
#include "directshowmediatype.h"
#include "directshowmediatypelist.h"
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp
index f719b29..cf6d45b 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp
@@ -54,20 +54,20 @@ namespace
static const TypeLookup qt_typeLookup[] =
{
- { QVideoFrame::Format_RGB32, MEDIASUBTYPE_RGB32 },
- { QVideoFrame::Format_BGR24, MEDIASUBTYPE_RGB24 },
- { QVideoFrame::Format_RGB565, MEDIASUBTYPE_RGB565 },
- { QVideoFrame::Format_RGB555, MEDIASUBTYPE_RGB555 },
- { QVideoFrame::Format_AYUV444, MEDIASUBTYPE_AYUV },
- { QVideoFrame::Format_YUYV, MEDIASUBTYPE_YUY2 },
- { QVideoFrame::Format_UYVY, MEDIASUBTYPE_UYVY },
- { QVideoFrame::Format_IMC1, MEDIASUBTYPE_IMC1 },
- { QVideoFrame::Format_IMC2, MEDIASUBTYPE_IMC2 },
- { QVideoFrame::Format_IMC3, MEDIASUBTYPE_IMC3 },
- { QVideoFrame::Format_IMC4, MEDIASUBTYPE_IMC4 },
- { QVideoFrame::Format_YV12, MEDIASUBTYPE_YV12 },
- { QVideoFrame::Format_NV12, MEDIASUBTYPE_NV12 },
- { QVideoFrame::Format_YUV420P, MEDIASUBTYPE_IYUV }
+ { QVideoFrame::Format_RGB32, /*MEDIASUBTYPE_RGB32*/ {0xe436eb7e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} },
+ { QVideoFrame::Format_BGR24, /*MEDIASUBTYPE_RGB24*/ {0xe436eb7d, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} },
+ { QVideoFrame::Format_RGB565, /*MEDIASUBTYPE_RGB565*/ {0xe436eb7b, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} },
+ { QVideoFrame::Format_RGB555, /*MEDIASUBTYPE_RGB555*/ {0xe436eb7c, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}} },
+ { QVideoFrame::Format_AYUV444, /*MEDIASUBTYPE_AYUV*/ {0x56555941, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_YUYV, /*MEDIASUBTYPE_YUY2*/ {0x32595559, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_UYVY, /*MEDIASUBTYPE_UYVY*/ {0x59565955, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_IMC1, /*MEDIASUBTYPE_IMC1*/ {0x31434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_IMC2, /*MEDIASUBTYPE_IMC2*/ {0x32434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_IMC3, /*MEDIASUBTYPE_IMC3*/ {0x33434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_IMC4, /*MEDIASUBTYPE_IMC4*/ {0x34434D49, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_YV12, /*MEDIASUBTYPE_YV12*/ {0x32315659, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_NV12, /*MEDIASUBTYPE_NV12*/ {0x3231564E, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} },
+ { QVideoFrame::Format_YUV420P, /*MEDIASUBTYPE_IYUV*/ {0x56555949, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} }
};
}
@@ -102,12 +102,16 @@ void DirectShowMediaType::freeData(AM_MEDIA_TYPE *type)
GUID DirectShowMediaType::convertPixelFormat(QVideoFrame::PixelFormat format)
{
+ // MEDIASUBTYPE_None;
+ static const GUID none = {
+ 0xe436eb8e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} };
+
const int count = sizeof(qt_typeLookup) / sizeof(TypeLookup);
for (int i = 0; i < count; ++i)
if (qt_typeLookup[i].pixelFormat == format)
return qt_typeLookup[i].mediaType;
- return MEDIASUBTYPE_None;
+ return none;
}
QVideoSurfaceFormat DirectShowMediaType::formatFromType(const AM_MEDIA_TYPE &type)
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp
index a33041e..89821c4 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp
@@ -297,7 +297,7 @@ QVariant DirectShowMetaDataControl::metaData(QtMultimedia::MetaData key) const
}
if (string) {
- value = QString::fromUtf16(string, ::SysStringLen(string));
+ value = QString::fromUtf16(reinterpret_cast<ushort *>(string), ::SysStringLen(string));
::SysFreeString(string);
}
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h
index 966f9b8..9a81ba8 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h
@@ -42,9 +42,10 @@
#ifndef DIRECTSHOWMETADATACONTROL_H
#define DIRECTSHOWMETADATACONTROL_H
+#include "directshowglobal.h"
+
#include <QtMultimedia/qmetadatacontrol.h>
-#include <dshow.h>
#include <qnetwork.h>
#ifndef QT_NO_WMSDK
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp
index 649f3fb..317fa5c 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp
@@ -56,8 +56,6 @@
#include <QtCore/qthread.h>
#include <QtCore/qvarlengtharray.h>
-#include <uuids.h>
-
Q_GLOBAL_STATIC(DirectShowEventLoop, qt_directShowEventLoop)
QT_BEGIN_NAMESPACE
@@ -80,11 +78,11 @@ private:
DirectShowPlayerService::DirectShowPlayerService(QObject *parent)
: QMediaService(parent)
, m_playerControl(0)
- , m_audioEndpointControl(0)
, m_metaDataControl(0)
, m_videoOutputControl(0)
, m_videoRendererControl(0)
, m_videoWindowControl(0)
+ , m_audioEndpointControl(0)
, m_taskThread(0)
, m_loop(qt_directShowEventLoop())
, m_pendingTasks(0)
@@ -203,9 +201,12 @@ void DirectShowPlayerService::load(const QMediaContent &media, QIODevice *stream
m_graphStatus = InvalidMedia;
m_error = QMediaPlayer::ResourceError;
} else {
+ // {36b73882-c2c8-11cf-8b46-00805f6cef60}
+ static const GUID iid_IFilterGraph2 = {
+ 0x36b73882, 0xc2c8, 0x11cf, {0x8b, 0x46, 0x00, 0x80, 0x5f, 0x6c, 0xef, 0x60} };
m_graphStatus = Loading;
- m_graph = com_new<IFilterGraph2>(CLSID_FilterGraph, IID_IFilterGraph2);
+ m_graph = com_new<IFilterGraph2>(CLSID_FilterGraph, iid_IFilterGraph2);
if (stream)
m_pendingTasks = SetStreamSource;
@@ -231,12 +232,18 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker)
HRESULT hr = E_FAIL;
-#ifndef QT_NO_WMSDK
if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("https")) {
+ static const GUID clsid_WMAsfReader = {
+ 0x187463a0, 0x5bb7, 0x11d3, {0xac, 0xbe, 0x00, 0x80, 0xc7, 0x5e, 0x24, 0x6e} };
+
+ // {56a868a6-0ad4-11ce-b03a-0020af0ba770}
+ static const GUID iid_IFileSourceFilter = {
+ 0x56a868a6, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} };
+
if (IFileSourceFilter *fileSource = com_new<IFileSourceFilter>(
- CLSID_WMAsfReader, IID_IFileSourceFilter)) {
+ clsid_WMAsfReader, iid_IFileSourceFilter)) {
locker->unlock();
- hr = fileSource->Load(url.toString().utf16(), 0);
+ hr = fileSource->Load(reinterpret_cast<const OLECHAR *>(url.toString().utf16()), 0);
locker->relock();
if (SUCCEEDED(hr)) {
@@ -260,13 +267,11 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker)
}
if (!SUCCEEDED(hr)) {
-#endif
locker->unlock();
- hr = m_graph->AddSourceFilter(url.toString().utf16(), L"Source", &source);
+ hr = m_graph->AddSourceFilter(
+ reinterpret_cast<const OLECHAR *>(url.toString().utf16()), L"Source", &source);
locker->relock();
-#ifndef QT_NO_WMSDK
}
-#endif
if (SUCCEEDED(hr)) {
m_executedTasks = SetSource;
@@ -300,7 +305,7 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker)
default:
m_error = QMediaPlayer::ResourceError;
m_errorString = QString();
- qWarning("DirectShowPlayerService::doSetUrlSource: Unresolved error code %x", hr);
+ qWarning("DirectShowPlayerService::doSetUrlSource: Unresolved error code %x", uint(hr));
break;
}
@@ -394,7 +399,7 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker)
locker->unlock();
HRESULT hr;
if (SUCCEEDED(hr = graph->RenderEx(
- pin, AM_RENDEREX_RENDERTOEXISTINGRENDERERS, 0))) {
+ pin, /*AM_RENDEREX_RENDERTOEXISTINGRENDERERS*/ 1, 0))) {
rendered = true;
} else if (renderHr == S_OK || renderHr == VFW_E_NO_DECOMPRESSOR){
renderHr = hr;
@@ -449,7 +454,7 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker)
m_error = QMediaPlayer::ResourceError;
m_errorString = QString();
qWarning("DirectShowPlayerService::doRender: Unresolved error code %x",
- renderHr);
+ uint(renderHr));
}
}
@@ -497,8 +502,12 @@ void DirectShowPlayerService::releaseGraph()
{
if (m_graph) {
if (m_executingTask != 0) {
+ // {8E1C39A1-DE53-11cf-AA63-0080C744528D}
+ static const GUID iid_IAMOpenProgress = {
+ 0x8E1C39A1, 0xDE53, 0x11cf, {0xAA, 0x63, 0x00, 0x80, 0xC7, 0x44, 0x52, 0x8D} };
+
if (IAMOpenProgress *progress = com_cast<IAMOpenProgress>(
- m_graph, IID_IAMOpenProgress)) {
+ m_graph, iid_IAMOpenProgress)) {
progress->AbortOperation();
progress->Release();
}
@@ -646,7 +655,7 @@ void DirectShowPlayerService::doPlay(QMutexLocker *locker)
} else {
m_error = QMediaPlayer::ResourceError;
m_errorString = QString();
- qWarning("DirectShowPlayerService::doPlay: Unresolved error code %x", hr);
+ qWarning("DirectShowPlayerService::doPlay: Unresolved error code %x", uint(hr));
QCoreApplication::postEvent(this, new QEvent(QEvent::Type(Error)));
}
@@ -699,7 +708,7 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker)
} else {
m_error = QMediaPlayer::ResourceError;
m_errorString = QString();
- qWarning("DirectShowPlayerService::doPause: Unresolved error code %x", hr);
+ qWarning("DirectShowPlayerService::doPause: Unresolved error code %x", uint(hr));
QCoreApplication::postEvent(this, new QEvent(QEvent::Type(Error)));
}
@@ -963,7 +972,11 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker)
decoder->AddRef();
}
- if (IFilterChain *chain = com_cast<IFilterChain>(m_graph, IID_IFilterChain)) {
+ // {DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29}
+ static const GUID iid_IFilterChain = {
+ 0xDCFBDCF6, 0x0DC2, 0x45f5, {0x9A, 0xB2, 0x7C, 0x33, 0x0E, 0xA0, 0x9C, 0x29} };
+
+ if (IFilterChain *chain = com_cast<IFilterChain>(m_graph, iid_IFilterChain)) {
chain->RemoveChain(decoder, m_audioOutput);
chain->Release();
} else {
@@ -1038,7 +1051,11 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker)
decoder->AddRef();
}
- if (IFilterChain *chain = com_cast<IFilterChain>(m_graph, IID_IFilterChain)) {
+ // {DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29}
+ static const GUID iid_IFilterChain = {
+ 0xDCFBDCF6, 0x0DC2, 0x45f5, {0x9A, 0xB2, 0x7C, 0x33, 0x0E, 0xA0, 0x9C, 0x29} };
+
+ if (IFilterChain *chain = com_cast<IFilterChain>(m_graph, iid_IFilterChain)) {
chain->RemoveChain(decoder, m_videoOutput);
chain->Release();
} else {
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp
index 94b6f24..a471c68 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp
@@ -84,7 +84,11 @@ VideoSurfaceFilter::~VideoSurfaceFilter()
}
HRESULT VideoSurfaceFilter::QueryInterface(REFIID riid, void **ppvObject)
-{
+{
+ // 2dd74950-a890-11d1-abe8-00a0c905f375
+ static const GUID iid_IAmFilterMiscFlags = {
+ 0x2dd74950, 0xa890, 0x11d1, {0xab, 0xe8, 0x00, 0xa0, 0xc9, 0x05, 0xf3, 0x75} };
+
if (!ppvObject) {
return E_POINTER;
} else if (riid == IID_IUnknown
@@ -92,7 +96,7 @@ HRESULT VideoSurfaceFilter::QueryInterface(REFIID riid, void **ppvObject)
|| riid == IID_IMediaFilter
|| riid == IID_IBaseFilter) {
*ppvObject = static_cast<IBaseFilter *>(this);
- } else if (riid == IID_IAMFilterMiscFlags) {
+ } else if (riid == iid_IAmFilterMiscFlags) {
*ppvObject = static_cast<IAMFilterMiscFlags *>(this);
} else if (riid == IID_IPin) {
*ppvObject = static_cast<IPin *>(this);
@@ -570,6 +574,10 @@ void VideoSurfaceFilter::supportedFormatsChanged()
{
QMutexLocker locker(&m_mutex);
+ // MEDIASUBTYPE_None;
+ static const GUID none = {
+ 0xe436eb8e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} };
+
QList<QVideoFrame::PixelFormat> formats = m_surface->supportedPixelFormats();
QVector<AM_MEDIA_TYPE> mediaTypes;
@@ -588,7 +596,7 @@ void VideoSurfaceFilter::supportedFormatsChanged()
foreach (QVideoFrame::PixelFormat format, formats) {
type.subtype = DirectShowMediaType::convertPixelFormat(format);
- if (type.subtype != MEDIASUBTYPE_None)
+ if (type.subtype != none)
mediaTypes.append(type);
}
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h
index 8f3a101..0607fd3 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h
@@ -41,6 +41,7 @@
#ifndef VIDEOSURFACEFILTER_H
#define VIDEOSURFACEFILTER_H
+#include "directshowglobal.h"
#include "directshowmediatypelist.h"
#include "directshowsamplescheduler.h"
#include "directshowmediatype.h"
@@ -52,9 +53,6 @@
#include <QtCore/qstring.h>
#include <QtCore/qwaitcondition.h>
-#include <dshow.h>
-
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE