diff options
author | Andreas Holzammer <andreas.holzammer@kdab.com> | 2016-03-09 11:28:00 +0100 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2016-03-09 12:09:49 +0000 |
commit | 77c9ab4a3871110c6fb569c4e7b17181867c17ad (patch) | |
tree | d4a7513b5ed2db2a1ce6a60dde84b27974037b4c /src/plugins/directshow/player/directshowplayerservice.cpp | |
parent | 3198bf4944edd8f25996c2b4c4516f606165af59 (diff) | |
download | qtmultimedia-77c9ab4a3871110c6fb569c4e7b17181867c17ad.tar.gz |
Port DirectShow backend to wince
dshow.h needs to be included before Qt headers as they include the
windows header with NOMINMAX macro set. DirectShow header needs min/max
macro definition to compile. The min/max macro then conflicts with
QDateTime header, hence needs to be undefined again for some occasions.
Windows Embedded Compact then defines INTERFACE as macro, which conflicts.
Windows Embedded Compact does not support audio end point selection.
Feature has been disabled for this platform.
Windows Embedded Compact does not support setting meta data, control has
been disabled.
Windows Embedded Compact does not support VMR, feature was disabled.
Direct Show renders always top to buttom.
Change-Id: Id17700835e2105fb127b12e3448bea16e3b52546
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/plugins/directshow/player/directshowplayerservice.cpp')
-rw-r--r-- | src/plugins/directshow/player/directshowplayerservice.cpp | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/plugins/directshow/player/directshowplayerservice.cpp b/src/plugins/directshow/player/directshowplayerservice.cpp index 8e9e50cbf..73279accb 100644 --- a/src/plugins/directshow/player/directshowplayerservice.cpp +++ b/src/plugins/directshow/player/directshowplayerservice.cpp @@ -31,14 +31,25 @@ ** ****************************************************************************/ +#include <dshow.h> +#ifdef min +#undef min +#endif +#ifdef max +#undef max +#endif + #include "directshowplayerservice.h" +#ifndef Q_OS_WINCE #include "directshowaudioendpointcontrol.h" -#include "directshowiosource.h" #include "directshowmetadatacontrol.h" +#include "vmr9videowindowcontrol.h" +#endif +#include "directshowiosource.h" #include "directshowplayercontrol.h" #include "directshowvideorenderercontrol.h" -#include "vmr9videowindowcontrol.h" + #ifdef HAVE_EVR #include "directshowevrvideowindowcontrol.h" @@ -79,10 +90,14 @@ private: DirectShowPlayerService::DirectShowPlayerService(QObject *parent) : QMediaService(parent) , m_playerControl(0) +#ifndef Q_OS_WINCE , m_metaDataControl(0) +#endif , m_videoRendererControl(0) +#ifndef Q_OS_WINCE , m_videoWindowControl(0) , m_audioEndpointControl(0) +#endif , m_taskThread(0) , m_loop(qt_directShowEventLoop()) , m_pendingTasks(0) @@ -106,8 +121,10 @@ DirectShowPlayerService::DirectShowPlayerService(QObject *parent) , m_dontCacheNextSeekResult(false) { m_playerControl = new DirectShowPlayerControl(this); +#ifndef Q_OS_WINCE m_metaDataControl = new DirectShowMetaDataControl(this); m_audioEndpointControl = new DirectShowAudioEndpointControl(this); +#endif m_taskThread = new DirectShowPlayerServiceThread(this); m_taskThread->start(); @@ -138,10 +155,14 @@ DirectShowPlayerService::~DirectShowPlayerService() } delete m_playerControl; +#ifndef Q_OS_WINCE delete m_audioEndpointControl; delete m_metaDataControl; +#endif delete m_videoRendererControl; +#ifndef Q_OS_WINCE delete m_videoWindowControl; +#endif ::CloseHandle(m_taskHandle); } @@ -150,12 +171,18 @@ QMediaControl *DirectShowPlayerService::requestControl(const char *name) { if (qstrcmp(name, QMediaPlayerControl_iid) == 0) { return m_playerControl; +#ifndef Q_OS_WINCE } else if (qstrcmp(name, QAudioOutputSelectorControl_iid) == 0) { return m_audioEndpointControl; } else if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) { return m_metaDataControl; +#endif } else if (qstrcmp(name, QVideoRendererControl_iid) == 0) { - if (!m_videoRendererControl && !m_videoWindowControl) { + if (!m_videoRendererControl +#ifndef Q_OS_WINCE + && !m_videoWindowControl +#endif + ){ m_videoRendererControl = new DirectShowVideoRendererControl(m_loop); connect(m_videoRendererControl, SIGNAL(filterChanged()), @@ -163,6 +190,7 @@ QMediaControl *DirectShowPlayerService::requestControl(const char *name) return m_videoRendererControl; } +#ifndef Q_OS_WINCE } else if (qstrcmp(name, QVideoWindowControl_iid) == 0) { if (!m_videoRendererControl && !m_videoWindowControl) { IBaseFilter *filter; @@ -185,6 +213,7 @@ QMediaControl *DirectShowPlayerService::requestControl(const char *name) return m_videoWindowControl; } +#endif } return 0; } @@ -200,12 +229,14 @@ void DirectShowPlayerService::releaseControl(QMediaControl *control) delete m_videoRendererControl; m_videoRendererControl = 0; +#ifndef Q_OS_WINCE } else if (control == m_videoWindowControl) { setVideoOutput(0); delete m_videoWindowControl; m_videoWindowControl = 0; +#endif } } @@ -231,7 +262,9 @@ void DirectShowPlayerService::load(const QMediaContent &media, QIODevice *stream m_seekable = false; m_atEnd = false; m_dontCacheNextSeekResult = false; +#ifndef Q_OS_WINCE m_metaDataControl->reset(); +#endif if (m_resources.isEmpty() && !stream) { m_pendingTasks = 0; @@ -1135,7 +1168,9 @@ void DirectShowPlayerService::customEvent(QEvent *event) QMutexLocker locker(&m_mutex); m_playerControl->updateMediaInfo(m_duration, m_streamTypes, m_seekable); +#ifndef Q_OS_WINCE m_metaDataControl->updateMetadata(m_graph, m_source, m_url.toString()); +#endif updateStatus(); } else if (event->type() == QEvent::Type(Error)) { |