From 135c762ea0bb2c13f9568b9c85b10633f0c6ce34 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Tue, 26 Jun 2018 15:20:53 +0200 Subject: AVFoundation: Do not use AVFVideoRendererControl if no opengl Removed code to use AVFVideoRendererControl to avoid link error. Task-number: QTBUG-69076 Change-Id: Iea87570fa6bb95541507d2ed84b6a1aa70984370 Reviewed-by: Andy Shaw --- src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/plugins/avfoundation') diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm index 6218401b3..91def6b3b 100644 --- a/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm +++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm @@ -42,7 +42,9 @@ #include "avfmediaplayercontrol.h" #include "avfmediaplayermetadatacontrol.h" #include "avfvideooutput.h" +#if QT_CONFIG(opengl) #include "avfvideorenderercontrol.h" +#endif #ifndef QT_NO_WIDGETS # include "avfvideowidgetcontrol.h" #endif @@ -84,7 +86,7 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name) if (qstrcmp(name, QMetaDataReaderControl_iid) == 0) return m_playerMetaDataControl; - +#if QT_CONFIG(opengl) if (qstrcmp(name, QVideoRendererControl_iid) == 0) { if (!m_videoOutput) m_videoOutput = new AVFVideoRendererControl(this); @@ -92,7 +94,7 @@ QMediaControl *AVFMediaPlayerService::requestControl(const char *name) m_session->setVideoOutput(qobject_cast(m_videoOutput)); return m_videoOutput; } - +#endif #ifndef QT_NO_WIDGETS if (qstrcmp(name, QVideoWidgetControl_iid) == 0) { if (!m_videoOutput) @@ -118,11 +120,12 @@ void AVFMediaPlayerService::releaseControl(QMediaControl *control) qDebug() << Q_FUNC_INFO << control; #endif if (m_videoOutput == control) { +#if QT_CONFIG(opengl) AVFVideoRendererControl *renderControl = qobject_cast(m_videoOutput); if (renderControl) renderControl->setSurface(0); - +#endif m_videoOutput = 0; m_session->setVideoOutput(0); -- cgit v1.2.3