summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2013-08-14 16:42:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-27 14:15:54 +0200
commit17a700292ad9289e8de199dc50b3e222ede42e1d (patch)
treeefdd51bbb96f3a71525d2b956b301bbc84f70d36 /src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
parentd3531cb0cc41a901b11a02d41685532684511bbd (diff)
AVFoundation: Enable use of QMediaPlayer for audio on iOS
This commit disables the video components of the AVFoundation mediaplayer backend when building for iOS and enables the use of QMediaPlayer with audio assets. Change-Id: Iadd6f9c61ed1e656301326e90a22cbca6428b654 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm')
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
index b916f47d4..668a26ee3 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
@@ -43,11 +43,13 @@
#include "avfmediaplayersession.h"
#include "avfmediaplayercontrol.h"
#include "avfmediaplayermetadatacontrol.h"
-#include "avfvideooutput.h"
-#include "avfvideorenderercontrol.h"
+#if defined(Q_OS_OSX)
+# include "avfvideooutput.h"
+# include "avfvideorenderercontrol.h"
-#ifndef QT_NO_WIDGETS
-#include "avfvideowidgetcontrol.h"
+# ifndef QT_NO_WIDGETS
+# include "avfvideowidgetcontrol.h"
+# endif
#endif
QT_USE_NAMESPACE
@@ -83,7 +85,7 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name)
if (qstrcmp(name, QMetaDataReaderControl_iid) == 0)
return m_playerMetaDataControl;
-
+#if defined(Q_OS_OSX)
if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
if (!m_videoOutput)
m_videoOutput = new AVFVideoRendererControl(this);
@@ -91,7 +93,7 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name)
m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput));
return m_videoOutput;
}
-#ifndef QT_NO_WIDGETS
+# ifndef QT_NO_WIDGETS
if (qstrcmp(name, QVideoWidgetControl_iid) == 0) {
if (!m_videoOutput)
m_videoOutput = new AVFVideoWidgetControl(this);
@@ -99,8 +101,8 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name)
m_session->setVideoOutput(qobject_cast<AVFVideoOutput*>(m_videoOutput));
return m_videoOutput;
}
+# endif
#endif
-
return 0;
}
@@ -109,7 +111,7 @@ void AVFMediaPlayerService::releaseControl(QMediaControl *control)
#ifdef QT_DEBUG_AVF
qDebug() << Q_FUNC_INFO << control;
#endif
-
+#if defined(Q_OS_OSX)
if (m_videoOutput == control) {
AVFVideoRendererControl *renderControl = qobject_cast<AVFVideoRendererControl*>(m_videoOutput);
if (renderControl)
@@ -118,4 +120,5 @@ void AVFMediaPlayerService::releaseControl(QMediaControl *control)
m_session->setVideoOutput(0);
delete control;
}
+#endif
}