From 1df2974e0c30c34cf3c458c9c89047fe9685b84d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 15 Feb 2018 14:52:31 +0100 Subject: Replace deprecated qSort() by std::sort() Change-Id: I74ffd5bafaef9ebbe7f12600ad831c8deb58ae64 Reviewed-by: Oliver Wolff --- src/plugins/android/src/mediacapture/qandroidcapturesession.cpp | 6 ++++-- src/plugins/audiocapture/audioencodercontrol.cpp | 4 +++- src/plugins/gstreamer/camerabin/camerabinsession.cpp | 6 ++++-- src/plugins/gstreamer/mediacapture/qgstreamerv4l2input.cpp | 6 ++++-- src/plugins/winrt/qwinrtcameracontrol.cpp | 7 ++++--- 5 files changed, 19 insertions(+), 10 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 + 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 +#include + 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/gstreamer/camerabin/camerabinsession.cpp b/src/plugins/gstreamer/camerabin/camerabinsession.cpp index 823cfe408..39f97e989 100644 --- a/src/plugins/gstreamer/camerabin/camerabinsession.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinsession.cpp @@ -80,6 +80,8 @@ #include #include +#include + //#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))) @@ -1257,7 +1259,7 @@ QList< QPair > 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; @@ -1384,7 +1386,7 @@ QList CameraBinSession::supportedResolutions(QPair 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 #include +#include + 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/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 #include +#include + 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); -- cgit v1.2.3