diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-02-28 09:22:52 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-02-28 09:22:52 +0100 |
commit | 1024c8684bbe947cac122e68d0fc3594ff81fa4f (patch) | |
tree | 76a689ab714b0f93e618757774717e9719619000 /src/plugins | |
parent | 2422d893392d25a94323ea7faf88ae9e8527ce31 (diff) | |
parent | 1df2974e0c30c34cf3c458c9c89047fe9685b84d (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I3ca1ee161afb0d74b00e62d835c70cf00964230f
Diffstat (limited to 'src/plugins')
8 files changed, 50 insertions, 30 deletions
diff --git a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp index a5aff51cd..bdc7ed403 100644 --- a/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp +++ b/src/plugins/android/src/mediacapture/qandroidcapturesession.cpp @@ -46,6 +46,8 @@ #include "qandroidvideooutput.h" #include "qandroidglobal.h" +#include <algorithm> + QT_BEGIN_NAMESPACE QAndroidCaptureSession::QAndroidCaptureSession(QAndroidCameraSession *cameraSession) @@ -495,8 +497,8 @@ void QAndroidCaptureSession::onCameraOpened() } } - qSort(m_supportedResolutions.begin(), m_supportedResolutions.end(), qt_sizeLessThan); - qSort(m_supportedFramerates.begin(), m_supportedFramerates.end()); + std::sort(m_supportedResolutions.begin(), m_supportedResolutions.end(), qt_sizeLessThan); + std::sort(m_supportedFramerates.begin(), m_supportedFramerates.end()); applySettings(); } diff --git a/src/plugins/audiocapture/audioencodercontrol.cpp b/src/plugins/audiocapture/audioencodercontrol.cpp index f4c560e0e..d8a83bf26 100644 --- a/src/plugins/audiocapture/audioencodercontrol.cpp +++ b/src/plugins/audiocapture/audioencodercontrol.cpp @@ -44,6 +44,8 @@ #include <QtCore/qdebug.h> +#include <algorithm> + QT_BEGIN_NAMESPACE static QAudioFormat audioSettingsToAudioFormat(const QAudioEncoderSettings &settings) @@ -167,7 +169,7 @@ void AudioEncoderControl::update() m_sampleRates.append(rate); } } - qSort(m_sampleRates); + std::sort(m_sampleRates.begin(), m_sampleRates.end()); } QT_END_NAMESPACE diff --git a/src/plugins/avfoundation/camera/avfcameraexposurecontrol.mm b/src/plugins/avfoundation/camera/avfcameraexposurecontrol.mm index 9e901f83b..7540ab86c 100644 --- a/src/plugins/avfoundation/camera/avfcameraexposurecontrol.mm +++ b/src/plugins/avfoundation/camera/avfcameraexposurecontrol.mm @@ -56,10 +56,9 @@ QT_BEGIN_NAMESPACE namespace { -// All these methods to work with exposure/ISO/SS in custom mode -// are quite new (iOS 8 or later and no OS X support). +// All these methods to work with exposure/ISO/SS in custom mode do not support macOS. -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS // Misc. helpers to check values/ranges: @@ -213,7 +212,7 @@ void qt_set_duration_iso(QPointer<AVFCameraService> service, QPointer<AVFCameraE completionHandler:completionHandler]; } -#endif // QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#endif // defined(Q_OS_IOS) } // Unnamed namespace. @@ -230,7 +229,7 @@ AVFCameraExposureControl::AVFCameraExposureControl(AVFCameraService *service) bool AVFCameraExposureControl::isParameterSupported(ExposureParameter parameter) const { -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS AVCaptureDevice *captureDevice = m_session->videoCaptureDevice(); if (!captureDevice) return false; @@ -250,7 +249,7 @@ QVariantList AVFCameraExposureControl::supportedParameterRange(ExposureParameter bool *continuous) const { QVariantList parameterRange; -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS AVCaptureDevice *captureDevice = m_session->videoCaptureDevice(); if (!captureDevice || !isParameterSupported(parameter)) { @@ -333,7 +332,7 @@ QVariant AVFCameraExposureControl::requestedValue(ExposureParameter parameter) c QVariant AVFCameraExposureControl::actualValue(ExposureParameter parameter) const { -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS AVCaptureDevice *captureDevice = m_session->videoCaptureDevice(); if (!captureDevice || !isParameterSupported(parameter)) { // Actually, at the moment !captiredevice => !isParameterSupported. @@ -386,7 +385,7 @@ bool AVFCameraExposureControl::setValue(ExposureParameter parameter, const QVari bool AVFCameraExposureControl::setExposureMode(const QVariant &value) { -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS if (!value.canConvert<QCameraExposure::ExposureMode>()) { qDebugCamera() << Q_FUNC_INFO << "invalid exposure mode value," << "QCameraExposure::ExposureMode expected"; @@ -433,7 +432,7 @@ bool AVFCameraExposureControl::setExposureMode(const QVariant &value) bool AVFCameraExposureControl::setExposureCompensation(const QVariant &value) { -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS if (!value.canConvert<qreal>()) { qDebugCamera() << Q_FUNC_INFO << "invalid exposure compensation" <<"value, floating point number expected"; @@ -474,7 +473,7 @@ bool AVFCameraExposureControl::setExposureCompensation(const QVariant &value) bool AVFCameraExposureControl::setShutterSpeed(const QVariant &value) { -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS if (value.isNull()) return setExposureMode(QVariant::fromValue(QCameraExposure::ExposureAuto)); @@ -521,7 +520,7 @@ bool AVFCameraExposureControl::setShutterSpeed(const QVariant &value) bool AVFCameraExposureControl::setISO(const QVariant &value) { -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS if (value.isNull()) return setExposureMode(QVariant::fromValue(QCameraExposure::ExposureAuto)); @@ -565,7 +564,7 @@ bool AVFCameraExposureControl::setISO(const QVariant &value) void AVFCameraExposureControl::cameraStateChanged() { -#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0) +#ifdef Q_OS_IOS if (m_session->state() != QCamera::ActiveState) return; diff --git a/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm b/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm index 4952551dc..5727cb0f4 100644 --- a/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm +++ b/src/plugins/avfoundation/mediaplayer/avfvideowindowcontrol.mm @@ -41,6 +41,14 @@ #include <AVFoundation/AVFoundation.h> +#if QT_HAS_INCLUDE(<AppKit/AppKit.h>) +#include <AppKit/AppKit.h> +#endif + +#if QT_HAS_INCLUDE(<UIKit/UIKit.h>) +#include <UIKit/UIKit.h> +#endif + QT_USE_NAMESPACE AVFVideoWindowControl::AVFVideoWindowControl(QObject *parent) diff --git a/src/plugins/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index cfac61c01..39f97e989 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -80,6 +80,8 @@ #include <QtGui/qimage.h> #include <QtCore/qdatetime.h> +#include <algorithm> + //#define CAMERABIN_DEBUG 1 //#define CAMERABIN_DEBUG_DUMP_BIN 1 #define ENUM_NAME(c,e,v) (c::staticMetaObject.enumerator(c::staticMetaObject.indexOfEnumerator(e)).valueToKey((v))) @@ -732,21 +734,18 @@ void CameraBinSession::setState(QCamera::State newState) if (newState == m_pendingState) return; - emit pendingStateChanged(newState); + m_pendingState = newState; + emit pendingStateChanged(m_pendingState); #if CAMERABIN_DEBUG qDebug() << Q_FUNC_INFO << newState; #endif setStateHelper(newState); - m_pendingState = newState; } void CameraBinSession::setStateHelper(QCamera::State state) { - if (state == m_pendingState) - return; - switch (state) { case QCamera::UnloadedState: unload(); @@ -1260,7 +1259,7 @@ QList< QPair<int,int> > CameraBinSession::supportedFrameRates(const QSize &frame readValue(rateValue, &res, continuous); } - qSort(res.begin(), res.end(), rateLessThan); + std::sort(res.begin(), res.end(), rateLessThan); #if CAMERABIN_DEBUG qDebug() << "Supported rates:" << caps; @@ -1387,7 +1386,7 @@ QList<QSize> CameraBinSession::supportedResolutions(QPair<int,int> rate, } - qSort(res.begin(), res.end(), resolutionLessThan); + std::sort(res.begin(), res.end(), resolutionLessThan); //if the range is continuos, populate is with the common rates if (isContinuous && res.size() >= 2) { diff --git a/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp b/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp index 9139f1fe2..ef0832f7e 100644 --- a/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp +++ b/src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp @@ -45,6 +45,8 @@ #include <private/qcore_unix_p.h> #include <linux/videodev2.h> +#include <algorithm> + QT_BEGIN_NAMESPACE static inline uint qHash(const QSize& key) { return uint(key.width()*256+key.height()); } @@ -252,10 +254,10 @@ void QGstreamerV4L2Input::updateSupportedResolutions(const QByteArray &device) m_frameRates.append(rate/1000.0); } - qSort(m_frameRates); + std::sort(m_frameRates.begin(), m_frameRates.end()); m_resolutions = allResolutions.toList(); - qSort(m_resolutions); + std::sort(m_resolutions.begin(), m_resolutions.end()); //qDebug() << "frame rates:" << m_frameRates; //qDebug() << "resolutions:" << m_resolutions; diff --git a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp index cc7aef367..a96da66f8 100644 --- a/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp +++ b/src/plugins/gstreamer/mediaplayer/qgstreamerplayersession.cpp @@ -1541,10 +1541,17 @@ void QGstreamerPlayerSession::playbinNotifySource(GObject *o, GParamSpec *p, gpo //set timeout property to 30 seconds const int timeout = 30; if (qstrcmp(G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(source)), "GstUDPSrc") == 0) { - //udpsrc timeout unit = microsecond - //The udpsrc is always a live source. - g_object_set(G_OBJECT(source), "timeout", G_GUINT64_CONSTANT(timeout*1000000), NULL); + quint64 convertedTimeout = timeout; +#if GST_CHECK_VERSION(1,0,0) + // Gst 1.x -> nanosecond + convertedTimeout *= 1000000000; +#else + // Gst 0.10 -> microsecond + convertedTimeout *= 1000000; +#endif + g_object_set(G_OBJECT(source), "timeout", convertedTimeout, NULL); self->m_sourceType = UDPSrc; + //The udpsrc is always a live source. self->m_isLiveSource = true; } else if (qstrcmp(G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(source)), "GstSoupHTTPSrc") == 0) { //souphttpsrc timeout unit = second diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp index 4c515bc3d..0086e92e9 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.cpp +++ b/src/plugins/winrt/qwinrtcameracontrol.cpp @@ -62,6 +62,8 @@ #include <windows.storage.streams.h> #include <windows.media.devices.h> +#include <algorithm> + using namespace Microsoft::WRL; using namespace Microsoft::WRL::Wrappers; using namespace ABI::Windows::Devices::Enumeration; @@ -1416,9 +1418,8 @@ HRESULT QWinRTCameraControl::onInitializationCompleted(IAsyncAction *, AsyncStat if (qAbs(aspectRatio - captureAspectRatio) <= ASPECTRATIO_EPSILON) filtered.append(resolution); } - qSort(filtered.begin(), - filtered.end(), - [](QSize size1, QSize size2) { return size1.width() * size1.height() < size2.width() * size2.height(); }); + std::sort(filtered.begin(), filtered.end(), + [](QSize size1, QSize size2) { return size1.width() * size1.height() < size2.width() * size2.height(); }); const QSize &viewfinderResolution = filtered.first(); const quint32 viewfinderResolutionIndex = previewResolutions.indexOf(viewfinderResolution); |