summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-06-30 03:00:46 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-06-30 03:00:46 +0200
commitaf5404a28aa10bfbec23905443132e6a9882dc79 (patch)
treecce08c8a49cc0c923e14d1b0117704d0beb0e672
parent60ee6f64e145c10a4ea3577da9dd7f38252f9a2e (diff)
parent135c762ea0bb2c13f9568b9c85b10633f0c6ce34 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
-rw-r--r--src/plugins/avfoundation/camera/avfimagecapturecontrol.mm3
-rw-r--r--src/plugins/avfoundation/camera/avfmediarecordercontrol.mm3
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayerservice.mm9
3 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/avfoundation/camera/avfimagecapturecontrol.mm b/src/plugins/avfoundation/camera/avfimagecapturecontrol.mm
index bad1b362b..dbaf3ed41 100644
--- a/src/plugins/avfoundation/camera/avfimagecapturecontrol.mm
+++ b/src/plugins/avfoundation/camera/avfimagecapturecontrol.mm
@@ -226,7 +226,8 @@ void AVFImageCaptureControl::cancelCapture()
void AVFImageCaptureControl::updateCaptureConnection()
{
- if (m_cameraControl->captureMode().testFlag(QCamera::CaptureStillImage)) {
+ if (m_session->videoCaptureDevice()
+ && m_cameraControl->captureMode().testFlag(QCamera::CaptureStillImage)) {
qDebugCamera() << Q_FUNC_INFO;
AVCaptureSession *captureSession = m_session->captureSession();
diff --git a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm
index 02261027d..546eabf89 100644
--- a/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm
+++ b/src/plugins/avfoundation/camera/avfmediarecordercontrol.mm
@@ -364,6 +364,9 @@ void AVFMediaRecorderControl::handleRecordingFailed(const QString &message)
void AVFMediaRecorderControl::setupSessionForCapture()
{
+ if (!m_session->videoCaptureDevice())
+ return;
+
//adding movie output causes high CPU usage even when while recording is not active,
//connect it only while video capture mode is enabled.
// Similarly, connect the Audio input only in that mode, since it's only necessary
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<AVFVideoOutput*>(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<AVFVideoRendererControl*>(m_videoOutput);
if (renderControl)
renderControl->setSurface(0);
-
+#endif
m_videoOutput = 0;
m_session->setVideoOutput(0);