summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-09-23 17:18:59 -0700
committerJake Petroules <jake.petroules@qt.io>2017-09-29 17:18:52 +0000
commit41ef172d1cee40c42d14ff7824baedf11060b987 (patch)
treec7bc7828123f90130fea66f5a3438af1f0cd413a
parent0c6faf31e643dda71f7068e5124f2e1889918cd2 (diff)
Remove obsolete version checksv5.10.0-beta1
Our iOS deployment target is now 8; this code will always be executed. Change-Id: Ia42bfa9e1fc96cb8048806a80c80bf3dda35a180 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
-rw-r--r--src/plugins/avfoundation/camera/avfcameraservice.mm6
-rw-r--r--src/plugins/avfoundation/camera/avfcamerautility.mm11
-rw-r--r--src/plugins/avfoundation/camera/avfimageencodercontrol.mm53
3 files changed, 29 insertions, 41 deletions
diff --git a/src/plugins/avfoundation/camera/avfcameraservice.mm b/src/plugins/avfoundation/camera/avfcameraservice.mm
index 7fd04250..71ea31e5 100644
--- a/src/plugins/avfoundation/camera/avfcameraservice.mm
+++ b/src/plugins/avfoundation/camera/avfcameraservice.mm
@@ -37,7 +37,6 @@
**
****************************************************************************/
-#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qvariant.h>
#include <QtCore/qdebug.h>
@@ -95,9 +94,8 @@ AVFCameraService::AVFCameraService(QObject *parent):
m_imageCaptureControl = new AVFImageCaptureControl(this);
m_cameraFocusControl = new AVFCameraFocusControl(this);
m_cameraExposureControl = 0;
-#if defined(Q_OS_IOS) && QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8))
- m_cameraExposureControl = new AVFCameraExposureControl(this);
+#ifdef Q_OS_IOS
+ m_cameraExposureControl = new AVFCameraExposureControl(this);
#endif
m_cameraZoomControl = 0;
diff --git a/src/plugins/avfoundation/camera/avfcamerautility.mm b/src/plugins/avfoundation/camera/avfcamerautility.mm
index 872075e0..22713d61 100644
--- a/src/plugins/avfoundation/camera/avfcamerautility.mm
+++ b/src/plugins/avfoundation/camera/avfcamerautility.mm
@@ -40,7 +40,6 @@
#include "avfcamerautility.h"
#include "avfcameradebug.h"
-#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qvector.h>
#include <QtCore/qpair.h>
#include <private/qmultimediautils_p.h>
@@ -180,12 +179,10 @@ QSize qt_device_format_high_resolution(AVCaptureDeviceFormat *format)
{
Q_ASSERT(format);
QSize res;
-#if defined(Q_OS_IOS) && QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) {
- const CMVideoDimensions hrDim(format.highResolutionStillImageDimensions);
- res.setWidth(hrDim.width);
- res.setHeight(hrDim.height);
- }
+#if defined(Q_OS_IOS)
+ const CMVideoDimensions hrDim(format.highResolutionStillImageDimensions);
+ res.setWidth(hrDim.width);
+ res.setHeight(hrDim.height);
#endif
return res;
}
diff --git a/src/plugins/avfoundation/camera/avfimageencodercontrol.mm b/src/plugins/avfoundation/camera/avfimageencodercontrol.mm
index 8384ce6a..e858d93c 100644
--- a/src/plugins/avfoundation/camera/avfimageencodercontrol.mm
+++ b/src/plugins/avfoundation/camera/avfimageencodercontrol.mm
@@ -48,7 +48,6 @@
#include <QtMultimedia/qmediaencodersettings.h>
-#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qdebug.h>
#include <AVFoundation/AVFoundation.h>
@@ -94,17 +93,15 @@ QList<QSize> AVFImageEncoderControl::supportedResolutions(const QImageEncoderSet
const QSize res(qt_device_format_resolution(format));
if (!res.isNull() && res.isValid())
resolutions << res;
-#if defined(Q_OS_IOS) && QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) {
- // From Apple's docs (iOS):
- // By default, AVCaptureStillImageOutput emits images with the same dimensions as
- // its source AVCaptureDevice instance’s activeFormat.formatDescription. However,
- // if you set this property to YES, the receiver emits still images at the capture
- // device’s highResolutionStillImageDimensions value.
- const QSize hrRes(qt_device_format_high_resolution(format));
- if (!hrRes.isNull() && hrRes.isValid())
- resolutions << res;
- }
+#ifdef Q_OS_IOS
+ // From Apple's docs (iOS):
+ // By default, AVCaptureStillImageOutput emits images with the same dimensions as
+ // its source AVCaptureDevice instance’s activeFormat.formatDescription. However,
+ // if you set this property to YES, the receiver emits still images at the capture
+ // device’s highResolutionStillImageDimensions value.
+ const QSize hrRes(qt_device_format_high_resolution(format));
+ if (!hrRes.isNull() && hrRes.isValid())
+ resolutions << res;
#endif
}
@@ -133,17 +130,15 @@ QImageEncoderSettings AVFImageEncoderControl::imageSettings() const
}
QSize res(qt_device_format_resolution(captureDevice.activeFormat));
-#if defined(Q_OS_IOS) && QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) {
- if (!m_service->imageCaptureControl() || !m_service->imageCaptureControl()->stillImageOutput()) {
- qDebugCamera() << Q_FUNC_INFO << "no still image output";
- return settings;
- }
-
- AVCaptureStillImageOutput *stillImageOutput = m_service->imageCaptureControl()->stillImageOutput();
- if (stillImageOutput.highResolutionStillImageOutputEnabled)
- res = qt_device_format_high_resolution(captureDevice.activeFormat);
+#ifdef Q_OS_IOS
+ if (!m_service->imageCaptureControl() || !m_service->imageCaptureControl()->stillImageOutput()) {
+ qDebugCamera() << Q_FUNC_INFO << "no still image output";
+ return settings;
}
+
+ AVCaptureStillImageOutput *stillImageOutput = m_service->imageCaptureControl()->stillImageOutput();
+ if (stillImageOutput.highResolutionStillImageOutputEnabled)
+ res = qt_device_format_high_resolution(captureDevice.activeFormat);
#endif
if (res.isNull() || !res.isValid()) {
qDebugCamera() << Q_FUNC_INFO << "failed to exctract the image resolution";
@@ -217,14 +212,12 @@ bool AVFImageEncoderControl::applySettings()
activeFormatChanged = qt_set_active_format(captureDevice, match, true);
-#if defined(Q_OS_IOS) && QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_8_0)
- if (QOperatingSystemVersion::current() >= QOperatingSystemVersion(QOperatingSystemVersion::IOS, 8)) {
- AVCaptureStillImageOutput *imageOutput = m_service->imageCaptureControl()->stillImageOutput();
- if (res == qt_device_format_high_resolution(captureDevice.activeFormat))
- imageOutput.highResolutionStillImageOutputEnabled = YES;
- else
- imageOutput.highResolutionStillImageOutputEnabled = NO;
- }
+#ifdef Q_OS_IOS
+ AVCaptureStillImageOutput *imageOutput = m_service->imageCaptureControl()->stillImageOutput();
+ if (res == qt_device_format_high_resolution(captureDevice.activeFormat))
+ imageOutput.highResolutionStillImageOutputEnabled = YES;
+ else
+ imageOutput.highResolutionStillImageOutputEnabled = NO;
#endif
return activeFormatChanged;