summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-02-22 03:01:21 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-02-22 03:01:21 +0100
commit70f5eb4f707ce84cbf153899d33d6bd8656be682 (patch)
treef95dcf6c1ecb9d09f84e1313e84042c66c0501e1
parentccde3b75e4ff53e711439e82e1c5640fac225d8e (diff)
parent12460a14bde44d1ff7bedd75bc87c7f22d096588 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.155.15
-rw-r--r--src/multimedia/playback/qmediaplayer.cpp1
-rw-r--r--src/multimediawidgets/multimediawidgets.pro3
-rw-r--r--src/plugins/avfoundation/camera/avfcamerautility.h2
-rw-r--r--src/plugins/avfoundation/camera/avfcamerautility.mm7
-rw-r--r--src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm11
-rw-r--r--src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm8
-rw-r--r--src/plugins/wmf/player/mfplayersession.cpp3
7 files changed, 26 insertions, 9 deletions
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp
index 9d26e8d38..6f7d9b8bb 100644
--- a/src/multimedia/playback/qmediaplayer.cpp
+++ b/src/multimedia/playback/qmediaplayer.cpp
@@ -59,6 +59,7 @@
#include <QtCore/qpointer.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qtemporaryfile.h>
+#include <QDir>
QT_BEGIN_NAMESPACE
diff --git a/src/multimediawidgets/multimediawidgets.pro b/src/multimediawidgets/multimediawidgets.pro
index 57d4194ec..1919e8107 100644
--- a/src/multimediawidgets/multimediawidgets.pro
+++ b/src/multimediawidgets/multimediawidgets.pro
@@ -1,6 +1,7 @@
# distinct from Qt Multimedia
TARGET = QtMultimediaWidgets
-QT = core gui multimedia-private widgets-private
+QT = core gui multimedia widgets-private
+QT_PRIVATE += multimedia-private
qtHaveModule(opengl): \
QT_PRIVATE += opengl
diff --git a/src/plugins/avfoundation/camera/avfcamerautility.h b/src/plugins/avfoundation/camera/avfcamerautility.h
index 370302b1c..33956fc8a 100644
--- a/src/plugins/avfoundation/camera/avfcamerautility.h
+++ b/src/plugins/avfoundation/camera/avfcamerautility.h
@@ -161,7 +161,7 @@ QSize qt_device_format_high_resolution(AVCaptureDeviceFormat *format);
QSize qt_device_format_pixel_aspect_ratio(AVCaptureDeviceFormat *format);
QVector<AVFPSRange> qt_device_format_framerates(AVCaptureDeviceFormat *format);
AVCaptureDeviceFormat *qt_find_best_resolution_match(AVCaptureDevice *captureDevice, const QSize &res,
- FourCharCode preferredFormat);
+ FourCharCode preferredFormat, bool stillImage = true);
AVCaptureDeviceFormat *qt_find_best_framerate_match(AVCaptureDevice *captureDevice,
FourCharCode preferredFormat,
Float64 fps);
diff --git a/src/plugins/avfoundation/camera/avfcamerautility.mm b/src/plugins/avfoundation/camera/avfcamerautility.mm
index 8c743dcbc..25ccc4b01 100644
--- a/src/plugins/avfoundation/camera/avfcamerautility.mm
+++ b/src/plugins/avfoundation/camera/avfcamerautility.mm
@@ -239,7 +239,8 @@ QSize qt_device_format_pixel_aspect_ratio(AVCaptureDeviceFormat *format)
AVCaptureDeviceFormat *qt_find_best_resolution_match(AVCaptureDevice *captureDevice,
const QSize &request,
- FourCharCode filter)
+ FourCharCode filter,
+ bool stillImage)
{
Q_ASSERT(captureDevice);
Q_ASSERT(!request.isNull() && request.isValid());
@@ -254,7 +255,7 @@ AVCaptureDeviceFormat *qt_find_best_resolution_match(AVCaptureDevice *captureDev
if (qt_device_format_resolution(format) == request)
return format;
// iOS only (still images).
- if (qt_device_format_high_resolution(format) == request)
+ if (stillImage && qt_device_format_high_resolution(format) == request)
return format;
}
@@ -272,7 +273,7 @@ AVCaptureDeviceFormat *qt_find_best_resolution_match(AVCaptureDevice *captureDev
if (!res.isNull() && res.isValid() && qt_area_sane(res))
pairs << FormatPair(res, format);
const QSize highRes(qt_device_format_high_resolution(format));
- if (!highRes.isNull() && highRes.isValid() && qt_area_sane(highRes))
+ if (stillImage && !highRes.isNull() && highRes.isValid() && qt_area_sane(highRes))
pairs << FormatPair(highRes, format);
}
diff --git a/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm b/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
index a77d7de03..0f7a0560b 100644
--- a/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
+++ b/src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm
@@ -185,7 +185,16 @@ void AVFCameraViewfinderSettingsControl2::setViewfinderSettings(const QCameraVie
return;
m_settings = settings;
+#if defined(Q_OS_IOS)
+ bool active = m_service->session()->state() == QCamera::ActiveState;
+ if (active)
+ [m_service->session()->captureSession() beginConfiguration];
applySettings(m_settings);
+ if (active)
+ [m_service->session()->captureSession() commitConfiguration];
+#else
+ applySettings(m_settings);
+#endif
}
QVideoFrame::PixelFormat AVFCameraViewfinderSettingsControl2::QtPixelFormatFromCVFormat(unsigned avPixelFormat)
@@ -264,7 +273,7 @@ AVCaptureDeviceFormat *AVFCameraViewfinderSettingsControl2::findBestFormatMatch(
// Either the exact match (including high resolution for images on iOS)
// or a format with a resolution close to the requested one.
return qt_find_best_resolution_match(captureDevice, resolution,
- m_service->session()->defaultCodec());
+ m_service->session()->defaultCodec(), false);
}
// No resolution requested, what about framerates?
diff --git a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
index 6a2dba6a0..424f30008 100644
--- a/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
+++ b/src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm
@@ -940,9 +940,11 @@ void AVFMediaPlayerSession::processLoadStateChange(QMediaPlayer::State newState)
// Get the native size of the video, and reset the bounds of the player layer
AVPlayerLayer *playerLayer = [static_cast<AVFMediaPlayerSessionObserver*>(m_observer) playerLayer];
if (videoTrack && playerLayer) {
- playerLayer.bounds = CGRectMake(0.0f, 0.0f,
- videoTrack.naturalSize.width,
- videoTrack.naturalSize.height);
+ if (!playerLayer.bounds.size.width || !playerLayer.bounds.size.height) {
+ playerLayer.bounds = CGRectMake(0.0f, 0.0f,
+ videoTrack.naturalSize.width,
+ videoTrack.naturalSize.height);
+ }
if (m_videoOutput && newState != QMediaPlayer::StoppedState) {
m_videoOutput->setLayer(playerLayer);
diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp
index 10ba25998..24bfda833 100644
--- a/src/plugins/wmf/player/mfplayersession.cpp
+++ b/src/plugins/wmf/player/mfplayersession.cpp
@@ -288,6 +288,9 @@ MFPlayerSession::MediaType MFPlayerSession::getStreamType(IMFStreamDescriptor *s
}
}
+ if (typeHandler)
+ typeHandler->Release();
+
return Unknown;
}