summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-27 21:30:18 +0100
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-27 21:30:18 +0100
commit8e14e71dcbefb71fb764a625f7b1b590bb935fc4 (patch)
tree9ece09c27650465dc4e1366b5a87e2da3d9481db
parent615b4b5fba61daf4884f7e2c04fc71a4ab9e0a30 (diff)
parent9a83cfb179f98824f024193afafff6c4a767f45e (diff)
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging: Rebuild configure.exe Make the Direct Show media service compile with a Qt namespace. Make the Direct Show media service compile with mingw. QT7; Fix warnings. Qt namespace fixes. Fixed QTMoview object leak. QMediaContent: Add a convenience method to retrieve the QNetworkRequest. Use the monitor color space for video output. Test for the existance of the Windows Media SDK in configure. Try to start media playback on all load state changes. Remove all uses of __uuidof from the Direct Show media service. QT7; Add support for setting cookies when loading a movie.
-rw-r--r--src/multimedia/base/qmediacontent.cpp9
-rw-r--r--src/multimedia/base/qmediacontent.h1
-rw-r--r--src/multimedia/qml/qsoundeffect_pulse_p.cpp5
-rw-r--r--src/multimedia/qml/qsoundeffect_qmedia_p.cpp4
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp11
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h81
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp10
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h4
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp34
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp4
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h3
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp98
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h1
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp18
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h4
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp27
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp5
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp5
-rw-r--r--src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp6
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp3
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp4
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp6
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp5
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp5
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp6
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp6
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h4
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp6
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp4
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp6
-rw-r--r--src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h6
-rw-r--r--src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp6
-rw-r--r--src/plugins/mediaservices/gstreamer/qx11videosurface.cpp6
-rw-r--r--src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm74
-rw-r--r--src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm3
-rw-r--r--src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h6
-rw-r--r--src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm94
-rw-r--r--src/plugins/mediaservices/qt7/qt7movierenderer.mm21
-rw-r--r--src/plugins/mediaservices/qt7/qt7movievideowidget.mm17
-rw-r--r--tests/auto/qmediacontent/tst_qmediacontent.cpp1
-rw-r--r--tools/configure/configureapp.cpp11
44 files changed, 467 insertions, 169 deletions
diff --git a/src/multimedia/base/qmediacontent.cpp b/src/multimedia/base/qmediacontent.cpp
index 6f158d262b..b6bf56b267 100644
--- a/src/multimedia/base/qmediacontent.cpp
+++ b/src/multimedia/base/qmediacontent.cpp
@@ -207,6 +207,15 @@ QUrl QMediaContent::canonicalUrl() const
}
/*!
+ Returns a QNetworkRequest that represents that canonical resource for this media content.
+*/
+
+QNetworkRequest QMediaContent::canonicalRequest() const
+{
+ return canonicalResource().request();
+}
+
+/*!
Returns a QMediaResource that represents that canonical resource for this media content.
*/
diff --git a/src/multimedia/base/qmediacontent.h b/src/multimedia/base/qmediacontent.h
index b6f30177ac..5a279c1ede 100644
--- a/src/multimedia/base/qmediacontent.h
+++ b/src/multimedia/base/qmediacontent.h
@@ -75,6 +75,7 @@ public:
bool isNull() const;
QUrl canonicalUrl() const;
+ QNetworkRequest canonicalRequest() const;
QMediaResource canonicalResource() const;
QMediaResourceList resources() const;
diff --git a/src/multimedia/qml/qsoundeffect_pulse_p.cpp b/src/multimedia/qml/qsoundeffect_pulse_p.cpp
index ec851aa5c3..7e9a25c9ea 100644
--- a/src/multimedia/qml/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/qml/qsoundeffect_pulse_p.cpp
@@ -72,6 +72,8 @@
// Less than ideal
#define PA_SCACHE_ENTRY_SIZE_MAX (1024*1024*16)
+QT_BEGIN_NAMESPACE
+
namespace
{
inline pa_sample_spec audioFormatToSampleSpec(const QAudioFormat &format)
@@ -502,3 +504,6 @@ void QSoundEffectPrivate::play_callback(pa_context *c, int success, void *userda
}
}
+QT_END_NAMESPACE
+
+
diff --git a/src/multimedia/qml/qsoundeffect_qmedia_p.cpp b/src/multimedia/qml/qsoundeffect_qmedia_p.cpp
index 886380a482..48fb257605 100644
--- a/src/multimedia/qml/qsoundeffect_qmedia_p.cpp
+++ b/src/multimedia/qml/qsoundeffect_qmedia_p.cpp
@@ -59,6 +59,8 @@
#include "qsoundeffect_qmedia_p.h"
+QT_BEGIN_NAMESPACE
+
QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent):
QObject(parent),
m_muted(false),
@@ -161,3 +163,5 @@ void QSoundEffectPrivate::setMedia(const QMediaContent &media)
m_player->setMedia(media.canonicalUrl());
}
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
index 570b44a293..5f72ca6ed5 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowaudioendpointcontrol.cpp
@@ -55,7 +55,7 @@ DirectShowAudioEndpointControl::DirectShowAudioEndpointControl(
, m_deviceEnumerator(0)
{
if (CreateBindCtx(0, &m_bindContext) == S_OK) {
- m_deviceEnumerator = com_new<ICreateDevEnum>(CLSID_SystemDeviceEnum);
+ m_deviceEnumerator = com_new<ICreateDevEnum>(CLSID_SystemDeviceEnum, IID_ICreateDevEnum);
updateEndpoints();
@@ -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)) {
@@ -96,7 +97,11 @@ QString DirectShowAudioEndpointControl::endpointDescription(const QString &name)
propertyBag->Release();
}
}
- return description;;
+
+ return description;
+#else
+ return name.section(QLatin1Char('\\'), -1);
+#endif
}
QString DirectShowAudioEndpointControl::defaultEndpoint() const
@@ -120,7 +125,7 @@ void DirectShowAudioEndpointControl::setActiveEndpoint(const QString &name)
if (moniker->BindToObject(
m_bindContext,
0,
- __uuidof(IBaseFilter),
+ IID_IBaseFilter,
reinterpret_cast<void **>(&filter)) == S_OK) {
m_service->setAudioOutput(filter);
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
index 1c9fe54e86..e43e2a727c 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowglobal.h
@@ -42,30 +42,30 @@
#ifndef DIRECTSHOWGLOBAL_H
#define DIRECTSHOWGLOBAL_H
-#include <dshow.h>
+#include <QtCore/qglobal.h>
+#include <dshow.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-template <typename T> T *com_cast(IUnknown *unknown)
+template <typename T> T *com_cast(IUnknown *unknown, const IID &iid)
{
T *iface = 0;
- return unknown && unknown->QueryInterface(
- __uuidof(T), reinterpret_cast<void **>(&iface)) == S_OK
+ return unknown && unknown->QueryInterface(iid, reinterpret_cast<void **>(&iface)) == S_OK
? iface
: 0;
}
-template <typename T> T *com_new(const IID &clsid)
+template <typename T> T *com_new(const IID &clsid, const IID &iid)
{
T *object = 0;
return CoCreateInstance(
clsid,
NULL,
CLSCTX_INPROC_SERVER,
- __uuidof(T),
+ iid,
reinterpret_cast<void **>(&object)) == S_OK
? object
: 0;
@@ -75,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/directshowioreader.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp
index 54446b8c0a..7369099ac6 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowioreader.cpp
@@ -143,7 +143,7 @@ HRESULT DirectShowIOReader::RequestAllocator(
return S_OK;
} else {
- *ppActual = com_new<IMemAllocator>(CLSID_MemoryAllocator);
+ *ppActual = com_new<IMemAllocator>(CLSID_MemoryAllocator, IID_IMemAllocator);
if (*ppActual) {
if ((*ppActual)->SetProperties(pProps, &actualProperties) != S_OK) {
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.cpp
index 1dca465a24..7b66d56c24 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);
@@ -414,8 +418,8 @@ HRESULT DirectShowIOSource::tryConnect(IPin *pin, const AM_MEDIA_TYPE *type)
} else if (!m_allocator) {
hr = VFW_E_NO_TRANSPORT;
- if (IMemInputPin *memPin = com_cast<IMemInputPin>(pin)) {
- if ((m_allocator = com_new<IMemAllocator>(CLSID_MemoryAllocator))) {
+ if (IMemInputPin *memPin = com_cast<IMemInputPin>(pin, IID_IMemInputPin)) {
+ if ((m_allocator = com_new<IMemAllocator>(CLSID_MemoryAllocator, IID_IMemAllocator))) {
ALLOCATOR_PROPERTIES properties;
if (memPin->GetAllocatorRequirements(&properties) == S_OK
|| m_allocator->GetProperties(&properties) == S_OK) {
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h
index b6264737da..1d917dfcba 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowiosource.h
@@ -42,17 +42,17 @@
#ifndef DIRECTSHOWIOSOURCE_H
#define DIRECTSHOWIOSOURCE_H
+#include "directshowglobal.h"
#include "directshowioreader.h"
#include "directshowmediatype.h"
#include "directshowmediatypelist.h"
+#include <QtCore/qfile.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-#include <QtCore/qfile.h>
-
class DirectShowIOSource
: public DirectShowMediaTypeList
, public IBaseFilter
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmediatype.cpp
index f719b29360..cf6d45bca7 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 7b2552f3e5..89821c49b3 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);
}
@@ -344,7 +344,7 @@ void DirectShowMetaDataControl::updateGraph(IFilterGraph2 *graph, IBaseFilter *s
if (m_headerInfo)
m_headerInfo->Release();
- m_headerInfo = com_cast<IWMHeaderInfo>(source);
+ m_headerInfo = com_cast<IWMHeaderInfo>(source, IID_IWMHeaderInfo);
#endif
// DirectShowMediaPlayerService holds a lock at this point so defer emitting signals to a later
// time.
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h
index 966f9b84cc..9a81ba842a 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/directshowplayercontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp
index b024557fa7..bb7bac3429 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp
@@ -371,7 +371,7 @@ void DirectShowPlayerControl::updateAudioOutput(IBaseFilter *filter)
if (m_audio)
m_audio->Release();
- m_audio = com_cast<IBasicAudio>(filter);
+ m_audio = com_cast<IBasicAudio>(filter, IID_IBasicAudio);
}
void DirectShowPlayerControl::updateError(QMediaPlayer::Error error, const QString &errorString)
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp
index 57f4becd71..317fa5c439 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);
+ m_graph = com_new<IFilterGraph2>(CLSID_FilterGraph, iid_IFilterGraph2);
if (stream)
m_pendingTasks = SetStreamSource;
@@ -231,15 +232,22 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker)
HRESULT hr = E_FAIL;
-#ifndef QT_NO_WMSDK
if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("https")) {
- if (IFileSourceFilter *fileSource = com_new<IFileSourceFilter>(CLSID_WMAsfReader)) {
+ 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)) {
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)) {
- source = com_cast<IBaseFilter>(fileSource);
+ source = com_cast<IBaseFilter>(fileSource, IID_IBaseFilter);
if (!SUCCEEDED(hr = m_graph->AddFilter(source, L"Source")) && source) {
source->Release();
@@ -259,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;
@@ -299,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;
}
@@ -342,7 +348,7 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker)
{
m_pendingTasks |= m_executedTasks & (Play | Pause);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -393,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;
@@ -448,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));
}
}
@@ -462,11 +468,11 @@ void DirectShowPlayerService::doRender(QMutexLocker *locker)
void DirectShowPlayerService::doFinalizeLoad(QMutexLocker *locker)
{
if (m_graphStatus != Loaded) {
- if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph)) {
+ if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph, IID_IMediaEvent)) {
event->GetEventHandle(reinterpret_cast<OAEVENT *>(&m_eventHandle));
event->Release();
}
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG duration = 0;
seeking->GetDuration(&duration);
m_duration = duration / 10;
@@ -496,7 +502,12 @@ void DirectShowPlayerService::releaseGraph()
{
if (m_graph) {
if (m_executingTask != 0) {
- if (IAMOpenProgress *progress = com_cast<IAMOpenProgress>(m_graph)) {
+ // {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)) {
progress->AbortOperation();
progress->Release();
}
@@ -515,7 +526,7 @@ void DirectShowPlayerService::doReleaseGraph(QMutexLocker *locker)
{
Q_UNUSED(locker);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -630,7 +641,7 @@ void DirectShowPlayerService::play()
void DirectShowPlayerService::doPlay(QMutexLocker *locker)
{
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
locker->unlock();
HRESULT hr = control->Run();
locker->relock();
@@ -644,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)));
}
@@ -672,7 +683,7 @@ void DirectShowPlayerService::pause()
void DirectShowPlayerService::doPause(QMutexLocker *locker)
{
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
locker->unlock();
HRESULT hr = control->Pause();
locker->relock();
@@ -680,7 +691,7 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker)
control->Release();
if (SUCCEEDED(hr)) {
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -697,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)));
}
@@ -723,12 +734,12 @@ void DirectShowPlayerService::stop()
void DirectShowPlayerService::doStop(QMutexLocker *locker)
{
if (m_executedTasks & (Play | Pause)) {
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -763,7 +774,7 @@ void DirectShowPlayerService::setRate(qreal rate)
void DirectShowPlayerService::doSetRate(QMutexLocker *locker)
{
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
// Cache current values as we can't query IMediaSeeking during a seek due to the
// possibility of a deadlock when flushing the VideoSurfaceFilter.
LONGLONG currentPosition = 0;
@@ -801,7 +812,7 @@ qint64 DirectShowPlayerService::position() const
if (m_graphStatus == Loaded) {
if (m_executingTask == Seek || m_executingTask == SetRate) {
return m_position;
- } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -822,7 +833,7 @@ QMediaTimeRange DirectShowPlayerService::availablePlaybackRanges() const
if (m_graphStatus == Loaded) {
if (m_executingTask == Seek || m_executingTask == SetRate) {
return m_playbackRange;
- } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ } else if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG minimum = 0;
LONGLONG maximum = 0;
@@ -850,7 +861,7 @@ void DirectShowPlayerService::seek(qint64 position)
void DirectShowPlayerService::doSeek(QMutexLocker *locker)
{
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG seekPosition = LONGLONG(m_position) * 10;
// Cache current values as we can't query IMediaSeeking during a seek due to the
@@ -886,7 +897,8 @@ int DirectShowPlayerService::bufferStatus() const
#ifndef QT_NO_WMSDK
QMutexLocker locker(const_cast<QMutex *>(&m_mutex));
- if (IWMReaderAdvanced2 *reader = com_cast<IWMReaderAdvanced2>(m_source)) {
+ if (IWMReaderAdvanced2 *reader = com_cast<IWMReaderAdvanced2>(
+ m_source, IID_IWMReaderAdvanced2)) {
DWORD percentage = 0;
reader->GetBufferProgress(&percentage, 0);
@@ -949,7 +961,7 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker)
{
m_pendingTasks |= m_executedTasks & (Play | Pause);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -960,7 +972,11 @@ void DirectShowPlayerService::doReleaseAudioOutput(QMutexLocker *locker)
decoder->AddRef();
}
- if (IFilterChain *chain = com_cast<IFilterChain>(m_graph)) {
+ // {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 {
@@ -1018,7 +1034,7 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker)
{
m_pendingTasks |= m_executedTasks & (Play | Pause);
- if (IMediaControl *control = com_cast<IMediaControl>(m_graph)) {
+ if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) {
control->Stop();
control->Release();
}
@@ -1035,7 +1051,11 @@ void DirectShowPlayerService::doReleaseVideoOutput(QMutexLocker *locker)
decoder->AddRef();
}
- if (IFilterChain *chain = com_cast<IFilterChain>(m_graph)) {
+ // {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 {
@@ -1118,7 +1138,7 @@ void DirectShowPlayerService::videoOutputChanged()
void DirectShowPlayerService::graphEvent(QMutexLocker *locker)
{
- if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph)) {
+ if (IMediaEvent *event = com_cast<IMediaEvent>(m_graph, IID_IMediaEvent)) {
long eventCode;
LONG_PTR param1;
LONG_PTR param2;
@@ -1137,7 +1157,7 @@ void DirectShowPlayerService::graphEvent(QMutexLocker *locker)
m_buffering = false;
m_atEnd = true;
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG position = 0;
seeking->GetCurrentPosition(&position);
@@ -1149,7 +1169,7 @@ void DirectShowPlayerService::graphEvent(QMutexLocker *locker)
QCoreApplication::postEvent(this, new QEvent(QEvent::Type(EndOfMedia)));
break;
case EC_LENGTH_CHANGED:
- if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph)) {
+ if (IMediaSeeking *seeking = com_cast<IMediaSeeking>(m_graph, IID_IMediaSeeking)) {
LONGLONG duration = 0;
seeking->GetDuration(&duration);
m_duration = duration / 10;
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h
index a5da9a4829..23515d0ede 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.h
@@ -57,7 +57,6 @@
#include <QtCore/private/qwineventnotifier_p.h>
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri b/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri
index a7adb38153..99a11919fb 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri
+++ b/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri
@@ -2,7 +2,7 @@ INCLUDEPATH += $$PWD
DEFINES += QMEDIA_DIRECTSHOW_PLAYER
-win32-g++: DEFINES += QT_NO_WMSDK
+!contains(QT_CONFIG, wmsdk): DEFINES += QT_NO_WMSDK
HEADERS += \
$$PWD/directshowaudioendpointcontrol.h \
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.cpp
index 7b4aad5805..a471c6869a 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);
@@ -446,7 +450,7 @@ HRESULT VideoSurfaceFilter::EndOfStream()
QMutexLocker locker(&m_mutex);
if (!m_sampleScheduler.scheduleEndOfStream()) {
- if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph)) {
+ if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph, IID_IMediaEventSink)) {
sink->Notify(
EC_COMPLETE,
S_OK,
@@ -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);
}
@@ -610,7 +618,7 @@ void VideoSurfaceFilter::sampleReady()
sample->Release();
if (eos) {
- if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph)) {
+ if (IMediaEventSink *sink = com_cast<IMediaEventSink>(m_graph, IID_IMediaEventSink)) {
sink->Notify(
EC_COMPLETE,
S_OK,
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h b/src/plugins/mediaservices/directshow/mediaplayer/videosurfacefilter.h
index 8f3a101932..0607fd398e 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
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
index a564e14399..b1ddd985c6 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/vmr9videowindowcontrol.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent)
: QVideoWindowControl(parent)
- , m_filter(com_new<IBaseFilter>(CLSID_VideoMixingRenderer9))
+ , m_filter(com_new<IBaseFilter>(CLSID_VideoMixingRenderer9, IID_IBaseFilter))
, m_windowId(0)
, m_dirtyValues(0)
, m_brightness(0)
@@ -57,7 +57,7 @@ Vmr9VideoWindowControl::Vmr9VideoWindowControl(QObject *parent)
, m_saturation(0)
, m_fullScreen(false)
{
- if (IVMRFilterConfig9 *config = com_cast<IVMRFilterConfig9>(m_filter)) {
+ if (IVMRFilterConfig9 *config = com_cast<IVMRFilterConfig9>(m_filter, IID_IVMRFilterConfig9)) {
config->SetRenderingMode(VMR9Mode_Windowless);
config->SetNumberOfStreams(1);
config->Release();
@@ -81,7 +81,8 @@ void Vmr9VideoWindowControl::setWinId(WId id)
{
m_windowId = id;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
control->SetVideoClippingWindow(m_windowId);
control->Release();
}
@@ -91,7 +92,8 @@ QRect Vmr9VideoWindowControl::displayRect() const
{
QRect rect;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
RECT sourceRect;
RECT displayRect;
@@ -109,7 +111,8 @@ QRect Vmr9VideoWindowControl::displayRect() const
void Vmr9VideoWindowControl::setDisplayRect(const QRect &rect)
{
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
RECT sourceRect = { 0, 0, 0, 0 };
RECT displayRect = { rect.left(), rect.top(), rect.right(), rect.bottom() };
@@ -134,7 +137,8 @@ void Vmr9VideoWindowControl::repaint()
if (QWidget *widget = QWidget::find(m_windowId)) {
HDC dc = widget->getDC();
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
control->RepaintVideo(m_windowId, dc);
control->Release();
}
@@ -146,7 +150,8 @@ QSize Vmr9VideoWindowControl::nativeSize() const
{
QSize size;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
LONG width;
LONG height;
@@ -161,7 +166,8 @@ QVideoWidget::AspectRatioMode Vmr9VideoWindowControl::aspectRatioMode() const
{
QVideoWidget::AspectRatioMode mode = QVideoWidget::KeepAspectRatio;
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
DWORD arMode;
if (control->GetAspectRatioMode(&arMode) == S_OK && arMode == VMR9ARMode_None)
@@ -173,7 +179,8 @@ QVideoWidget::AspectRatioMode Vmr9VideoWindowControl::aspectRatioMode() const
void Vmr9VideoWindowControl::setAspectRatioMode(QVideoWidget::AspectRatioMode mode)
{
- if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(m_filter)) {
+ if (IVMRWindowlessControl9 *control = com_cast<IVMRWindowlessControl9>(
+ m_filter, IID_IVMRWindowlessControl9)) {
switch (mode) {
case QVideoWidget::IgnoreAspectRatio:
control->SetAspectRatioMode(VMR9ARMode_None);
@@ -254,7 +261,7 @@ void Vmr9VideoWindowControl::setSaturation(int saturation)
void Vmr9VideoWindowControl::setProcAmpValues()
{
- if (IVMRMixerControl9 *control = com_cast<IVMRMixerControl9>(m_filter)) {
+ if (IVMRMixerControl9 *control = com_cast<IVMRMixerControl9>(m_filter, IID_IVMRMixerControl9)) {
VMR9ProcAmpControl procAmp;
procAmp.dwSize = sizeof(VMR9ProcAmpControl);
procAmp.dwFlags = m_dirtyValues;
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
index 4d0ffe4afd..eff6ea42da 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamermetadataprovider.cpp
@@ -45,6 +45,8 @@
#include <gst/gstversion.h>
+QT_BEGIN_NAMESPACE
+
struct QGstreamerMetaDataKeyLookup
{
QtMultimedia::MetaData key;
@@ -202,3 +204,6 @@ void QGstreamerMetaDataProvider::updateTags()
{
emit metaDataChanged();
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
index d417266c02..2d7aaa8b22 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayercontrol.cpp
@@ -54,6 +54,8 @@
#include <fcntl.h>
#include <unistd.h>
+QT_BEGIN_NAMESPACE
+
QGstreamerPlayerControl::QGstreamerPlayerControl(QGstreamerPlayerSession *session, QObject *parent)
: QMediaPlayerControl(parent)
, m_session(session)
@@ -341,3 +343,6 @@ void QGstreamerPlayerControl::closeFifo()
m_bufferOffset = 0;
}
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
index 2e5d10fe84..600621e010 100644
--- a/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
+++ b/src/plugins/mediaservices/gstreamer/mediaplayer/qgstreamerplayersession.cpp
@@ -51,6 +51,9 @@
//#define USE_PLAYBIN2
+
+QT_BEGIN_NAMESPACE
+
QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
:QObject(parent),
m_state(QMediaPlayer::StoppedState),
@@ -710,3 +713,6 @@ void QGstreamerPlayerSession::getStreamsInfo()
emit streamsChanged();
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp b/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp
index 59ae5be43d..5049fa17dd 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamerbushelper.cpp
@@ -45,6 +45,7 @@
#include "qgstreamerbushelper.h"
+QT_BEGIN_NAMESPACE
#ifndef QT_NO_GLIB
class QGstreamerBusHelperPrivate : public QObject
@@ -200,4 +201,6 @@ void QGstreamerBusHelper::installSyncEventFilter(QGstreamerSyncEventFilter *filt
d->filter = filter;
}
+QT_END_NAMESPACE
+
#include "qgstreamerbushelper.moc"
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp b/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp
index 13a2454cf4..863b6d4331 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamermessage.cpp
@@ -44,6 +44,8 @@
#include "qgstreamermessage.h"
+QT_BEGIN_NAMESPACE
+
static int wuchi = qRegisterMetaType<QGstreamerMessage>();
@@ -91,3 +93,5 @@ QGstreamerMessage& QGstreamerMessage::operator=(QGstreamerMessage const& rhs)
return *this;
}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp
index 94ae847368..406cefe111 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideoinputdevicecontrol.cpp
@@ -57,6 +57,9 @@
#include <sys/mman.h>
#include <linux/videodev2.h>
+
+QT_BEGIN_NAMESPACE
+
QGstreamerVideoInputDeviceControl::QGstreamerVideoInputDeviceControl(QObject *parent)
:QVideoDeviceControl(parent), m_selectedDevice(0)
{
@@ -155,3 +158,6 @@ void QGstreamerVideoInputDeviceControl::update()
::close(fd);
}
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp
index decf5248e9..f406bff60c 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooutputcontrol.cpp
@@ -41,6 +41,8 @@
#include "qgstreamervideooutputcontrol.h"
+QT_BEGIN_NAMESPACE
+
QGstreamerVideoOutputControl::QGstreamerVideoOutputControl(QObject *parent)
: QVideoOutputControl(parent)
, m_output(NoOutput)
@@ -70,3 +72,6 @@ void QGstreamerVideoOutputControl::setOutput(Output output)
if (m_output != output)
emit outputChanged(m_output = output);
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp
index 6c6c8029d0..846a24abea 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideooverlay.cpp
@@ -46,6 +46,8 @@
#include "qx11videosurface.h"
+QT_BEGIN_NAMESPACE
+
QGstreamerVideoOverlay::QGstreamerVideoOverlay(QObject *parent)
: QVideoWindowControl(parent)
, m_surface(new QX11VideoSurface)
@@ -208,3 +210,6 @@ void QGstreamerVideoOverlay::setScaledDisplayRect()
break;
};
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp
index 25a53cfe15..1f0399025c 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorenderer.cpp
@@ -47,6 +47,9 @@
#include <gst/gst.h>
+
+QT_BEGIN_NAMESPACE
+
QGstreamerVideoRenderer::QGstreamerVideoRenderer(QObject *parent)
:QVideoRendererControl(parent),m_videoSink(0)
{
@@ -80,3 +83,6 @@ void QGstreamerVideoRenderer::setSurface(QAbstractVideoSurface *surface)
m_surface = surface;
}
+QT_END_NAMESPACE
+
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp
index 0a1c20df13..886a0644ef 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.cpp
@@ -41,6 +41,12 @@
#include "qgstreamervideorendererinterface.h"
+
+QT_BEGIN_NAMESPACE
+
QGstreamerVideoRendererInterface::~QGstreamerVideoRendererInterface()
{
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h
index 39deee81e1..c63a75708b 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideorendererinterface.h
@@ -59,11 +59,11 @@ public:
virtual void precessNewStream() {}
};
-QT_END_NAMESPACE
-
#define QGstreamerVideoRendererInterface_iid "com.nokia.Qt.QGstreamerVideoRendererInterface/1.0"
Q_DECLARE_INTERFACE(QGstreamerVideoRendererInterface, QGstreamerVideoRendererInterface_iid)
+QT_END_NAMESPACE
+
QT_END_HEADER
#endif
diff --git a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp
index 1d8d43df7a..47fb451d56 100644
--- a/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstreamervideowidget.cpp
@@ -51,6 +51,9 @@
#include <gst/interfaces/xoverlay.h>
#include <gst/interfaces/propertyprobe.h>
+
+QT_BEGIN_NAMESPACE
+
class QGstreamerVideoWidget : public QWidget
{
public:
@@ -320,3 +323,6 @@ void QGstreamerVideoWidgetControl::setSaturation(int saturation)
emit saturationChanged(saturation);
}
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp b/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp
index 9519db6de5..76289bfc7c 100644
--- a/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstvideobuffer.cpp
@@ -42,6 +42,8 @@
#include "qgstvideobuffer.h"
+QT_BEGIN_NAMESPACE
+
QGstVideoBuffer::QGstVideoBuffer(GstBuffer *buffer, int bytesPerLine)
: QAbstractVideoBuffer(NoHandle)
, m_buffer(buffer)
@@ -95,3 +97,5 @@ void QGstVideoBuffer::unmap()
m_mode = NotMapped;
}
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp
index 5b99817f9c..b2e633d988 100644
--- a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp
+++ b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.cpp
@@ -47,6 +47,9 @@
#include "qgstxvimagebuffer.h"
#include "qvideosurfacegstsink.h"
+
+QT_BEGIN_NAMESPACE
+
GstBufferClass *QGstXvImageBuffer::parent_class = NULL;
GType QGstXvImageBuffer::get_type(void)
@@ -274,3 +277,6 @@ void QGstXvImageBufferPool::destroyBuffer(QGstXvImageBuffer *xvBuffer)
if (m_imagesToDestroy.size() == 1)
QMetaObject::invokeMethod(this, "queuedDestroy", Qt::QueuedConnection);
}
+
+QT_END_NAMESPACE
+
diff --git a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h
index beeb01f1fe..30f77d154b 100644
--- a/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h
+++ b/src/plugins/mediaservices/gstreamer/qgstxvimagebuffer.h
@@ -56,14 +56,13 @@
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
-
#include <gst/gst.h>
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-
class QGstXvImageBufferPool;
struct QGstXvImageBuffer {
@@ -82,7 +81,6 @@ struct QGstXvImageBuffer {
const QAbstractVideoBuffer::HandleType XvHandleType = QAbstractVideoBuffer::HandleType(4);
-Q_DECLARE_METATYPE(XvImage*)
class QGstXvImageBufferPool : public QObject {
@@ -125,6 +123,8 @@ private:
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(::XvImage*)
+
QT_END_HEADER
diff --git a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp
index 402a225d56..76d87cedb7 100644
--- a/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp
+++ b/src/plugins/mediaservices/gstreamer/qvideosurfacegstsink.cpp
@@ -52,8 +52,11 @@
#include "qgstxvimagebuffer.h"
+
Q_DECLARE_METATYPE(QVideoSurfaceFormat)
+QT_BEGIN_NAMESPACE
+
QVideoSurfaceGstDelegate::QVideoSurfaceGstDelegate(QAbstractVideoSurface *surface)
: m_surface(surface)
, m_renderReturn(GST_FLOW_ERROR)
@@ -691,3 +694,6 @@ GstFlowReturn QVideoSurfaceGstSink::render(GstBaseSink *base, GstBuffer *buffer)
return sink->delegate->render(buffer);
}
+QT_END_NAMESPACE
+
+
diff --git a/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp b/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp
index 6e282ffdc0..cbd5a765a8 100644
--- a/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp
+++ b/src/plugins/mediaservices/gstreamer/qx11videosurface.cpp
@@ -46,7 +46,9 @@
#include "qx11videosurface.h"
-Q_DECLARE_METATYPE(XvImage*);
+Q_DECLARE_METATYPE(::XvImage*);
+
+QT_BEGIN_NAMESPACE
static QAbstractVideoBuffer::HandleType XvHandleType = QAbstractVideoBuffer::HandleType(4);
@@ -507,3 +509,5 @@ void QX11VideoSurface::querySupportedFormats()
XFree(attributes);
}
}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm
index a14981a5b2..b04667233f 100644
--- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm
+++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playermetadata.mm
@@ -132,15 +132,19 @@ static OSStatus readMetaValue(QTMetaDataRef metaDataRef, QTMetaDataItem item, QT
UInt32 propFlags;
OSStatus err = QTMetaDataGetItemPropertyInfo(metaDataRef, item, propClass, id, &type, &propSize, &propFlags);
-
- *value = malloc(propSize);
-
- err = QTMetaDataGetItemProperty(metaDataRef, item, propClass, id, propSize, *value, size);
-
- if (type == 'code' || type == 'itsk' || type == 'itlk') {
- // convert from native endian to big endian
- OSTypePtr pType = (OSTypePtr)*value;
- *pType = EndianU32_NtoB(*pType);
+ if (err == noErr) {
+ *value = malloc(propSize);
+ if (*value != 0) {
+ err = QTMetaDataGetItemProperty(metaDataRef, item, propClass, id, propSize, *value, size);
+
+ if (err == noErr && (type == 'code' || type == 'itsk' || type == 'itlk')) {
+ // convert from native endian to big endian
+ OSTypePtr pType = (OSTypePtr)*value;
+ *pType = EndianU32_NtoB(*pType);
+ }
+ }
+ else
+ return -1;
}
return err;
@@ -153,10 +157,14 @@ static UInt32 getMetaType(QTMetaDataRef metaDataRef, QTMetaDataItem item)
OSStatus err = readMetaValue(
metaDataRef, item, kPropertyClass_MetaDataItem, kQTMetaDataItemPropertyID_DataType, &value, &ignore);
- UInt32 type = *((UInt32 *) value);
- if (value)
- free(value);
- return type;
+ if (err == noErr) {
+ UInt32 type = *((UInt32 *) value);
+ if (value)
+ free(value);
+ return type;
+ }
+
+ return 0;
}
static QString cFStringToQString(CFStringRef str)
@@ -179,23 +187,26 @@ static QString getMetaValue(QTMetaDataRef metaDataRef, QTMetaDataItem item, SInt
QTPropertyValuePtr value = 0;
ByteCount size = 0;
OSStatus err = readMetaValue(metaDataRef, item, kPropertyClass_MetaDataItem, id, &value, &size);
-
QString string;
- UInt32 dataType = getMetaType(metaDataRef, item);
- switch (dataType){
- case kQTMetaDataTypeUTF8:
- case kQTMetaDataTypeMacEncodedText:
- string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF8, false));
- break;
- case kQTMetaDataTypeUTF16BE:
- string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF16BE, false));
- break;
- default:
- break;
+
+ if (err == noErr) {
+ UInt32 dataType = getMetaType(metaDataRef, item);
+ switch (dataType){
+ case kQTMetaDataTypeUTF8:
+ case kQTMetaDataTypeMacEncodedText:
+ string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF8, false));
+ break;
+ case kQTMetaDataTypeUTF16BE:
+ string = cFStringToQString(CFStringCreateWithBytes(0, (UInt8*)value, size, kCFStringEncodingUTF16BE, false));
+ break;
+ default:
+ break;
+ }
+
+ if (value)
+ free(value);
}
- if (value)
- free(value);
return string;
}
@@ -234,10 +245,11 @@ void QT7PlayerMetaDataControl::updateTags()
#ifdef QUICKTIME_C_API_AVAILABLE
QTMetaDataRef metaDataRef;
OSStatus err = QTCopyMovieMetaData([movie quickTimeMovie], &metaDataRef);
-
- readFormattedData(metaDataRef, kQTMetaDataStorageFormatUserData, metaMap);
- readFormattedData(metaDataRef, kQTMetaDataStorageFormatQuickTime, metaMap);
- readFormattedData(metaDataRef, kQTMetaDataStorageFormatiTunes, metaMap);
+ if (err == noErr) {
+ readFormattedData(metaDataRef, kQTMetaDataStorageFormatUserData, metaMap);
+ readFormattedData(metaDataRef, kQTMetaDataStorageFormatQuickTime, metaMap);
+ readFormattedData(metaDataRef, kQTMetaDataStorageFormatiTunes, metaMap);
+ }
#else
NSString *name = [movie attributeForKey:@"QTMovieDisplayNameAttribute"];
metaMap.insert(QLatin1String("nam"), QString::fromUtf8([name UTF8String]));
diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm
index faf75d12bd..205e862d09 100644
--- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm
+++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playerservice.mm
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
QT7PlayerService::QT7PlayerService(QObject *parent):
QMediaService(parent)
{
- m_session = new QT7PlayerSession;
+ m_session = new QT7PlayerSession(this);
m_control = new QT7PlayerControl(this);
m_control->setSession(m_session);
@@ -102,6 +102,7 @@ QT7PlayerService::QT7PlayerService(QObject *parent):
QT7PlayerService::~QT7PlayerService()
{
+ m_session->setVideoOutput(0);
}
QMediaControl *QT7PlayerService::control(const char *name) const
diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h
index 4742e2e7e7..0ba3041005 100644
--- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h
+++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.h
@@ -107,7 +107,7 @@ public slots:
void setMuted(bool muted);
void processEOS();
- void processStateChange();
+ void processLoadStateChange();
void processVolumeChange();
void processNaturalSizeChange();
@@ -138,6 +138,10 @@ private:
bool m_muted;
int m_volume;
qreal m_rate;
+
+ qint64 m_duration;
+ bool m_videoAvailable;
+ bool m_audioAvailable;
};
QT_END_NAMESPACE
diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm
index 3f198b9e37..d83c0e3ff4 100644
--- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm
+++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm
@@ -48,10 +48,13 @@
#include "qt7playercontrol.h"
#include "qt7videooutputcontrol.h"
+#include <QtNetwork/qnetworkcookie.h>
#include <QtMultimedia/qmediaplaylistnavigator.h>
#include <CoreFoundation/CoreFoundation.h>
+#include <Foundation/Foundation.h>
+#include <QtCore/qdatetime.h>
#include <QtCore/qurl.h>
#include <QtCore/qdebug.h>
@@ -65,7 +68,9 @@
- (QTMovieObserver *) initWithPlayerSession:(QT7PlayerSession*)session;
- (void) setMovie:(QTMovie *)movie;
- (void) processEOS:(NSNotification *)notification;
-- (void) processStateChange:(NSNotification *)notification;
+- (void) processLoadStateChange:(NSNotification *)notification;
+- (void) processVolumeChange:(NSNotification *)notification;
+- (void) processNaturalSizeChange :(NSNotification *)notification;
@end
@implementation QTMovieObserver
@@ -98,7 +103,7 @@
object:m_movie];
[[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(processStateChange:)
+ selector:@selector(processLoadStateChange:)
name:QTMovieLoadStateDidChangeNotification
object:m_movie];
@@ -126,10 +131,10 @@
m_session->processEOS();
}
-- (void) processStateChange:(NSNotification *)notification
+- (void) processLoadStateChange:(NSNotification *)notification
{
Q_UNUSED(notification);
- m_session->processStateChange();
+ m_session->processLoadStateChange();
}
- (void) processVolumeChange:(NSNotification *)notification
@@ -164,6 +169,9 @@ QT7PlayerSession::QT7PlayerSession(QObject *parent)
, m_muted(false)
, m_volume(100)
, m_rate(1.0)
+ , m_duration(0)
+ , m_videoAvailable(false)
+ , m_audioAvailable(false)
{
m_movieObserver = [[QTMovieObserver alloc] initWithPlayerSession:this];
}
@@ -172,6 +180,7 @@ QT7PlayerSession::~QT7PlayerSession()
{
[(QTMovieObserver*)m_movieObserver setMovie:nil];
[(QTMovieObserver*)m_movieObserver release];
+ [(QTMovie*)m_QTMovie release];
}
void *QT7PlayerSession::movie() const
@@ -365,17 +374,37 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream)
m_mediaStream = stream;
m_mediaStatus = QMediaPlayer::NoMedia;
- QUrl url;
+ QNetworkRequest request;
if (!content.isNull())
- url = content.canonicalUrl();
+ request = content.canonicalResource().request();
else
return;
-// qDebug() << "Open media" << url;
+ QVariant cookies = request.header(QNetworkRequest::CookieHeader);
+ if (cookies.isValid()) {
+ NSHTTPCookieStorage *store = [NSHTTPCookieStorage sharedHTTPCookieStorage];
+ QList<QNetworkCookie> cookieList = cookies.value<QList<QNetworkCookie> >();
+
+ foreach (const QNetworkCookie &requestCookie, cookieList) {
+ NSMutableDictionary *p = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ (NSString*)qString2CFStringRef(requestCookie.name()), NSHTTPCookieName,
+ (NSString*)qString2CFStringRef(requestCookie.value()), NSHTTPCookieValue,
+ (NSString*)qString2CFStringRef(requestCookie.domain()), NSHTTPCookieDomain,
+ (NSString*)qString2CFStringRef(requestCookie.path()), NSHTTPCookiePath,
+ nil
+ ];
+ if (requestCookie.isSessionCookie())
+ [p setObject:[NSString stringWithUTF8String:"TRUE"] forKey:NSHTTPCookieDiscard];
+ else
+ [p setObject:[NSDate dateWithTimeIntervalSince1970:requestCookie.expirationDate().toTime_t()] forKey:NSHTTPCookieExpires];
+
+ [store setCookie:[NSHTTPCookie cookieWithProperties:p]];
+ }
+ }
NSError *err = 0;
- NSString *urlString = (NSString *)qString2CFStringRef(url.toString());
+ NSString *urlString = (NSString *)qString2CFStringRef(request.url().toString());
NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys:
[NSURL URLWithString:urlString], QTMovieURLAttribute,
@@ -400,7 +429,7 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream)
m_videoOutput->setMovie(m_QTMovie);
m_videoOutput->setEnabled(true);
}
- processStateChange();
+ processLoadStateChange();
[(QTMovie*)m_QTMovie setMuted:m_muted];
setVolume(m_volume);
@@ -432,8 +461,11 @@ void QT7PlayerSession::processEOS()
emit mediaStatusChanged(m_mediaStatus);
}
-void QT7PlayerSession::processStateChange()
+void QT7PlayerSession::processLoadStateChange()
{
+ if (!m_QTMovie)
+ return;
+
signed long state = [[(QTMovie*)m_QTMovie attributeForKey:QTMovieLoadStateAttribute]
longValue];
// qDebug() << "Moview load state changed:" << state;
@@ -461,32 +493,30 @@ void QT7PlayerSession::processStateChange()
if (state == kMovieLoadStateError) {
newStatus = QMediaPlayer::InvalidMedia;
- emit error(QMediaPlayer::FormatError, tr("Playback failed"));
+ emit error(QMediaPlayer::FormatError, tr("Failed to load media"));
+ emit stateChanged(m_state = QMediaPlayer::StoppedState);
}
- if (newStatus != m_mediaStatus) {
- switch (newStatus) {
- case QMediaPlayer::BufferedMedia:
- case QMediaPlayer::BufferingMedia:
- //delayed playback start is necessary for network sources
- if (m_state == QMediaPlayer::PlayingState) {
- QMetaObject::invokeMethod(this, "play", Qt::QueuedConnection);
- }
- //fall
- case QMediaPlayer::LoadedMedia:
- case QMediaPlayer::LoadingMedia:
- emit durationChanged(duration());
- emit audioAvailableChanged(isAudioAvailable());
- emit videoAvailableChanged(isVideoAvailable());
- break;
- case QMediaPlayer::InvalidMedia:
- emit stateChanged(m_state = QMediaPlayer::StoppedState);
- default:
- break;
- }
+ if (state >= kMovieLoadStatePlayable &&
+ m_state == QMediaPlayer::PlayingState &&
+ [(QTMovie*)m_QTMovie rate] == 0) {
+ QMetaObject::invokeMethod(this, "play", Qt::QueuedConnection);
+ }
- emit mediaStatusChanged(m_mediaStatus = newStatus);
+ if (state >= kMovieLoadStateLoaded) {
+ qint64 currentDuration = duration();
+ if (m_duration != currentDuration)
+ emit durationChanged(m_duration = currentDuration);
+
+ if (m_audioAvailable != isAudioAvailable())
+ emit audioAvailableChanged(m_audioAvailable = !m_audioAvailable);
+
+ if (m_videoAvailable != isVideoAvailable())
+ emit videoAvailableChanged(m_videoAvailable = !m_videoAvailable);
}
+
+ if (newStatus != m_mediaStatus)
+ emit mediaStatusChanged(m_mediaStatus = newStatus);
}
void QT7PlayerSession::processVolumeChange()
diff --git a/src/plugins/mediaservices/qt7/qt7movierenderer.mm b/src/plugins/mediaservices/qt7/qt7movierenderer.mm
index 6b9fd2107e..1c1f5e4e8b 100644
--- a/src/plugins/mediaservices/qt7/qt7movierenderer.mm
+++ b/src/plugins/mediaservices/qt7/qt7movierenderer.mm
@@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE
+//#define USE_MAIN_MONITOR_COLOR_SPACE 1
+
class CVGLTextureVideoBuffer : public QAbstractVideoBuffer
{
public:
@@ -233,7 +235,24 @@ bool QT7MovieRenderer::createPixelBufferVisualContext()
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(visualContextOptions, kQTVisualContextPixelBufferAttributesKey, pixelBufferOptions);
- CFDictionarySetValue(visualContextOptions, kQTVisualContextWorkingColorSpaceKey, CGColorSpaceCreateDeviceRGB());
+
+ CGColorSpaceRef colorSpace = NULL;
+
+#if USE_MAIN_MONITOR_COLOR_SPACE
+ CMProfileRef sysprof = NULL;
+
+ // Get the Systems Profile for the main display
+ if (CMGetSystemProfile(&sysprof) == noErr) {
+ // Create a colorspace with the systems profile
+ colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysprof);
+ CMCloseProfile(sysprof);
+ }
+#endif
+
+ if (!colorSpace)
+ colorSpace = CGColorSpaceCreateDeviceRGB();
+
+ CFDictionarySetValue(visualContextOptions, kQTVisualContextOutputColorSpaceKey, colorSpace);
OSStatus err = QTPixelBufferContextCreate(kCFAllocatorDefault,
visualContextOptions,
diff --git a/src/plugins/mediaservices/qt7/qt7movievideowidget.mm b/src/plugins/mediaservices/qt7/qt7movievideowidget.mm
index 404333085d..00ceffcbac 100644
--- a/src/plugins/mediaservices/qt7/qt7movievideowidget.mm
+++ b/src/plugins/mediaservices/qt7/qt7movievideowidget.mm
@@ -199,7 +199,6 @@ QT7MovieVideoWidget::QT7MovieVideoWidget(QObject *parent)
}
}
-
bool QT7MovieVideoWidget::createVisualContext()
{
#ifdef QUICKTIME_C_API_AVAILABLE
@@ -210,8 +209,20 @@ bool QT7MovieVideoWidget::createVisualContext()
NSOpenGLPixelFormat *nsglPixelFormat = [NSOpenGLView defaultPixelFormat];
CGLPixelFormatObj cglPixelFormat = static_cast<CGLPixelFormatObj>([nsglPixelFormat CGLPixelFormatObj]);
- CFTypeRef keys[] = { kQTVisualContextWorkingColorSpaceKey };
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ CFTypeRef keys[] = { kQTVisualContextOutputColorSpaceKey };
+ CGColorSpaceRef colorSpace = NULL;
+ CMProfileRef sysprof = NULL;
+
+ // Get the Systems Profile for the main display
+ if (CMGetSystemProfile(&sysprof) == noErr) {
+ // Create a colorspace with the systems profile
+ colorSpace = CGColorSpaceCreateWithPlatformColorSpace(sysprof);
+ CMCloseProfile(sysprof);
+ }
+
+ if (!colorSpace)
+ colorSpace = CGColorSpaceCreateDeviceRGB();
+
CFDictionaryRef textureContextAttributes = CFDictionaryCreate(kCFAllocatorDefault,
(const void **)keys,
(const void **)&colorSpace, 1,
diff --git a/tests/auto/qmediacontent/tst_qmediacontent.cpp b/tests/auto/qmediacontent/tst_qmediacontent.cpp
index 8987241692..a0a9bdb1dc 100644
--- a/tests/auto/qmediacontent/tst_qmediacontent.cpp
+++ b/tests/auto/qmediacontent/tst_qmediacontent.cpp
@@ -85,6 +85,7 @@ void tst_QMediaContent::testRequestCtor()
QMediaContent media(request);
+ QCOMPARE(media.canonicalRequest(), request);
QCOMPARE(media.canonicalUrl(), QUrl("http://example.com/movie.mov"));
QCOMPARE(media.canonicalResource().request(), request);
QCOMPARE(media.canonicalResource().url(), QUrl("http://example.com/movie.mov"));
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index c0a29ca86f..6b7740e69d 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -249,6 +249,7 @@ Configure::Configure( int& argc, char** argv )
dictionary[ "MULTIMEDIA" ] = "yes";
dictionary[ "AUDIO_BACKEND" ] = "auto";
dictionary[ "MEDIASERVICE"] = "auto";
+ dictionary[ "WMSDK" ] = "auto";
dictionary[ "DIRECTSHOW" ] = "no";
dictionary[ "WEBKIT" ] = "auto";
dictionary[ "DECLARATIVE" ] = "auto";
@@ -1592,6 +1593,7 @@ bool Configure::displayHelp()
"[-qtnamespace <namespace>] [-qtlibinfix <infix>] [-no-phonon]\n"
"[-phonon] [-no-phonon-backend] [-phonon-backend]\n"
"[-no-multimedia] [-multimedia] [-no-audio-backend] [-audio-backend]\n"
+ "[-no-mediaservice] [-mediaservice]\n"
"[-no-script] [-script] [-no-scripttools] [-scripttools]\n"
"[-no-webkit] [-webkit] [-graphicssystem raster|opengl|openvg]\n\n", 0, 7);
@@ -2077,6 +2079,8 @@ bool Configure::checkAvailability(const QString &part)
if (!findFile("msdmo.lib")) cout << "msdmo.lib not found" << endl;
if (!findFile("d3d9.h")) cout << "d3d9.h not found" << endl;
}
+ } else if (part == "WMSDK") {
+ available = findFile("wmsdk.h");
} else if (part == "MULTIMEDIA" || part == "SCRIPT" || part == "SCRIPTTOOLS") {
available = true;
} else if (part == "WEBKIT") {
@@ -2221,6 +2225,8 @@ void Configure::autoDetection()
dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no";
if (dictionary["MEDIASERVICE"] == "auto")
dictionary["MEDIASERVICE"] = checkAvailability("MEDIASERVICE") ? "yes" : "no";
+ if (dictionary["WMSDK"] == "auto")
+ dictionary["WMSDK"] = checkAvailability("WMSDK") ? "yes" : "no";
// Qt/WinCE remote test application
if (dictionary["CETEST"] == "auto")
@@ -2611,8 +2617,11 @@ void Configure::generateOutputVars()
qtConfig += "multimedia";
if (dictionary["AUDIO_BACKEND"] == "yes")
qtConfig += "audio-backend";
- if (dictionary["MEDIASERVICE"] == "yes")
+ if (dictionary["MEDIASERVICE"] == "yes") {
qtConfig += "mediaservice";
+ if (dictionary["WMSDK"] == "yes")
+ qtConfig += "wmsdk";
+ }
}
if (dictionary["WEBKIT"] == "yes")