summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/mediaplayer
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2016-09-21 10:27:33 -0700
committerJake Petroules <jake.petroules@qt.io>2016-09-23 04:05:48 +0000
commit4d3dae3fa63d64cc97226969c4bf7d6d91b63b57 (patch)
tree84b405be3c1a6520c34fddfda0b3c97a311f4460 /src/plugins/avfoundation/mediaplayer
parente1ae1235f259393e72e4a2e0d77278e9054405fb (diff)
Remove deprecated QSysInfo APIs and dead code from macOS/iOS backend
Deployment targets are currently macOS 10.9 and iOS 7.0. Change-Id: I500a95c00eb3be6e693e38f0f2205941f7bc9601 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/plugins/avfoundation/mediaplayer')
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h1
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm15
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h3
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm17
4 files changed, 2 insertions, 34 deletions
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h
index b18862b55..4460a4867 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.h
@@ -63,7 +63,6 @@ private:
AVFMediaPlayerControl *m_control;
QMediaControl *m_videoOutput;
AVFMediaPlayerMetaDataControl *m_playerMetaDataControl;
- bool m_enableRenderControl;
};
QT_END_NAMESPACE
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
index 526c36cc6..6218401b3 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm
@@ -48,32 +48,19 @@
#endif
#include "avfvideowindowcontrol.h"
-#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_6_0)
#import <AVFoundation/AVFoundation.h>
-#endif
QT_USE_NAMESPACE
AVFMediaPlayerService::AVFMediaPlayerService(QObject *parent)
: QMediaService(parent)
, m_videoOutput(0)
- , m_enableRenderControl(true)
{
m_session = new AVFMediaPlayerSession(this);
m_control = new AVFMediaPlayerControl(this);
m_control->setSession(m_session);
m_playerMetaDataControl = new AVFMediaPlayerMetaDataControl(m_session, this);
-#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_8, __IPHONE_6_0)
- // AVPlayerItemVideoOutput is available in SDK
- #if QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_10_8, __IPHONE_6_0)
- // might not be available at runtime
- #if defined(Q_OS_IOS) || defined(Q_OS_TVOS)
- m_enableRenderControl = [AVPlayerItemVideoOutput class] != 0;
- #endif
- #endif
-#endif
-
connect(m_control, SIGNAL(mediaChanged(QMediaContent)), m_playerMetaDataControl, SLOT(updateTags()));
}
@@ -98,7 +85,7 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name)
return m_playerMetaDataControl;
- if (m_enableRenderControl && (qstrcmp(name, QVideoRendererControl_iid) == 0)) {
+ if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
if (!m_videoOutput)
m_videoOutput = new AVFVideoRendererControl(this);
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h
index f0cb46aaa..5696faf15 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h
@@ -86,8 +86,6 @@ public:
qreal playbackRate() const;
- inline bool isVolumeSupported() const { return m_volumeSupported; }
-
public Q_SLOTS:
void setPlaybackRate(qreal rate);
@@ -169,7 +167,6 @@ private:
QMediaContent m_resources;
ResourceHandler m_resourceHandler;
- const bool m_volumeSupported;
bool m_muted;
bool m_tryingAsync;
int m_volume;
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
index 473a18884..e15c2e44a 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
@@ -233,7 +233,7 @@ static void *AVFMediaPlayerSessionObserverCurrentItemObservationContext = &AVFMe
[m_player retain];
//Set the initial volume on new player object
- if (self.session && self.session->isVolumeSupported()) {
+ if (self.session) {
[m_player setVolume:m_session->volume() / 100.0f];
[m_player setMuted:m_session->isMuted()];
}
@@ -380,11 +380,6 @@ AVFMediaPlayerSession::AVFMediaPlayerSession(AVFMediaPlayerService *service, QOb
, m_state(QMediaPlayer::StoppedState)
, m_mediaStatus(QMediaPlayer::NoMedia)
, m_mediaStream(0)
-#ifdef Q_OS_IOS
- , m_volumeSupported(QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_7_0)
-#else
- , m_volumeSupported(true)
-#endif
, m_muted(false)
, m_tryingAsync(false)
, m_volume(100)
@@ -749,11 +744,6 @@ void AVFMediaPlayerSession::setVolume(int volume)
qDebug() << Q_FUNC_INFO << volume;
#endif
- if (!m_volumeSupported) {
- qWarning("%s not implemented, requires iOS 7 or later", Q_FUNC_INFO);
- return;
- }
-
if (m_volume == volume)
return;
@@ -772,11 +762,6 @@ void AVFMediaPlayerSession::setMuted(bool muted)
qDebug() << Q_FUNC_INFO << muted;
#endif
- if (!m_volumeSupported) {
- qWarning("%s not implemented, requires iOS 7 or later", Q_FUNC_INFO);
- return;
- }
-
if (m_muted == muted)
return;