diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2010-02-03 01:50:12 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2010-02-03 01:50:12 (GMT) |
commit | 3cd93dfb61eee61523af02cfc117c53ef9ee1336 (patch) | |
tree | 84ece0e9809659e3e136602211fdc05b6512d26a | |
parent | 3c90f04c31d266a640ccf3b187d6971f7ade7500 (diff) | |
download | Qt-3cd93dfb61eee61523af02cfc117c53ef9ee1336.zip Qt-3cd93dfb61eee61523af02cfc117c53ef9ee1336.tar.gz Qt-3cd93dfb61eee61523af02cfc117c53ef9ee1336.tar.bz2 |
Enable building the Direct Show plugin without the Window Media SDK.
4 files changed, 38 insertions, 4 deletions
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp index 7335e3d..e95ddcd 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.cpp @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_WMSDK namespace { struct QWMMetaDataKeyLookup @@ -227,11 +228,14 @@ static QVariant getValue(IWMHeaderInfo *header, const wchar_t *key) } return QVariant(); } +#endif DirectShowMetaDataControl::DirectShowMetaDataControl(QObject *parent) : QMetaDataControl(parent) , m_content(0) +#ifndef QT_NO_WMSDK , m_headerInfo(0) +#endif { } @@ -246,13 +250,18 @@ bool DirectShowMetaDataControl::isWritable() const bool DirectShowMetaDataControl::isMetaDataAvailable() const { +#ifndef QT_NO_WMSDK return m_content || m_headerInfo; +#else + return m_content; +#endif } QVariant DirectShowMetaDataControl::metaData(QtMedia::MetaData key) const { QVariant value; +#ifndef QT_NO_WMSDK if (m_headerInfo) { static const int count = sizeof(qt_wmMetaDataKeys) / sizeof(QWMMetaDataKeyLookup); for (int i = 0; i < count; ++i) { @@ -262,6 +271,9 @@ QVariant DirectShowMetaDataControl::metaData(QtMedia::MetaData key) const } } } else if (m_content) { +#else + if (m_content) { +#endif BSTR string = 0; switch (key) { @@ -321,16 +333,19 @@ void DirectShowMetaDataControl::updateGraph(IFilterGraph2 *graph, IBaseFilter *s if (m_content) m_content->Release(); - if (m_headerInfo) - m_headerInfo->Release(); - if (!graph || graph->QueryInterface( IID_IAMMediaContent, reinterpret_cast<void **>(&m_content)) != S_OK) { m_content = 0; } - m_headerInfo = com_cast<IWMHeaderInfo>(source); +#ifdef QT_NO_WMSDK + Q_UNUSED(source); +#else + if (m_headerInfo) + m_headerInfo->Release(); + m_headerInfo = com_cast<IWMHeaderInfo>(source); +#endif // DirectShowMediaPlayerService holds a lock at this point so defer emitting signals to a later // time. QCoreApplication::postEvent(this, new QEvent(QEvent::Type(MetaDataChanged))); @@ -342,7 +357,11 @@ void DirectShowMetaDataControl::customEvent(QEvent *event) event->accept(); emit metaDataChanged(); +#ifndef QT_NO_WMSDK emit metaDataAvailableChanged(m_content || m_headerInfo); +#else + emit metaDataAvailableChanged(m_content); +#endif } else { QMetaDataControl::customEvent(event); } diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h index 9bb5fcc..eb3bbb7 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowmetadatacontrol.h @@ -46,7 +46,10 @@ #include <dshow.h> #include <qnetwork.h> + +#ifndef QT_NO_WMSDK #include <wmsdk.h> +#endif #include <QtCore/qcoreevent.h> @@ -88,7 +91,9 @@ private: }; IAMMediaContent *m_content; +#ifndef QT_NO_WMSDK IWMHeaderInfo *m_headerInfo; +#endif }; QT_END_NAMESPACE diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp index a3362db..fdbee81 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp @@ -222,6 +222,7 @@ 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)) { locker->unlock(); @@ -242,10 +243,13 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker) } if (!SUCCEEDED(hr)) { +#endif locker->unlock(); hr = m_graph->AddSourceFilter(url.toString().utf16(), L"Source", &source); locker->relock(); +#ifndef QT_NO_WMSDK } +#endif if (SUCCEEDED(hr)) { m_executedTasks = SetSource; @@ -807,6 +811,7 @@ void DirectShowPlayerService::doSeek(QMutexLocker *locker) int DirectShowPlayerService::bufferStatus() const { +#ifndef QT_NO_WMSDK QMutexLocker locker(const_cast<QMutex *>(&m_mutex)); if (IWMReaderAdvanced2 *reader = com_cast<IWMReaderAdvanced2>(m_source)) { @@ -819,6 +824,9 @@ int DirectShowPlayerService::bufferStatus() const } else { return 0; } +#else + return 0; +#endif } void DirectShowPlayerService::setAudioOutput(IBaseFilter *filter) diff --git a/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri b/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri index 49ee9e5..a7adb38 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri +++ b/src/plugins/mediaservices/directshow/mediaplayer/mediaplayer.pri @@ -2,6 +2,8 @@ INCLUDEPATH += $$PWD DEFINES += QMEDIA_DIRECTSHOW_PLAYER +win32-g++: DEFINES += QT_NO_WMSDK + HEADERS += \ $$PWD/directshowaudioendpointcontrol.h \ $$PWD/directshoweventloop.h \ |