AVFoundation: additional build fixes for OSX < 10.9.
0df8d839 didn't fix all of the problems.
Task-number: QTBUG-46159
Change-Id: I4f2a390da1cca13775302aeef60c522e0da55a1a
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
This commit is contained in:
@@ -180,12 +180,21 @@ void qt_set_framerate_limits(AVCaptureDevice *captureDevice,
|
|||||||
#ifdef Q_OS_IOS
|
#ifdef Q_OS_IOS
|
||||||
[captureDevice setActiveVideoMinFrameDuration:minFrameDuration];
|
[captureDevice setActiveVideoMinFrameDuration:minFrameDuration];
|
||||||
[captureDevice setActiveVideoMaxFrameDuration:maxFrameDuration];
|
[captureDevice setActiveVideoMaxFrameDuration:maxFrameDuration];
|
||||||
#else
|
#else // Q_OS_OSX
|
||||||
|
|
||||||
if (CMTimeCompare(minFrameDuration, kCMTimeInvalid))
|
if (CMTimeCompare(minFrameDuration, kCMTimeInvalid))
|
||||||
[captureDevice setActiveVideoMinFrameDuration:minFrameDuration];
|
[captureDevice setActiveVideoMinFrameDuration:minFrameDuration];
|
||||||
if (CMTimeCompare(maxFrameDuration, kCMTimeInvalid))
|
|
||||||
[captureDevice setActiveVideoMaxFrameDuration:maxFrameDuration];
|
#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9)
|
||||||
|
#if QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_9)
|
||||||
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_9)
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
if (CMTimeCompare(maxFrameDuration, kCMTimeInvalid))
|
||||||
|
[captureDevice setActiveVideoMaxFrameDuration:maxFrameDuration];
|
||||||
|
}
|
||||||
|
#endif // QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9)
|
||||||
|
#endif // Q_OS_OSX
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // Platform SDK >= 10.9, >= 7.0.
|
#endif // Platform SDK >= 10.9, >= 7.0.
|
||||||
@@ -206,15 +215,23 @@ AVFPSRange qt_current_framerates(AVCaptureDevice *captureDevice, AVCaptureConnec
|
|||||||
fps.second = 1. / minSeconds; // Max FPS = 1 / MinDuration.
|
fps.second = 1. / minSeconds; // Max FPS = 1 / MinDuration.
|
||||||
}
|
}
|
||||||
|
|
||||||
const CMTime maxDuration = captureDevice.activeVideoMaxFrameDuration;
|
#if QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9)
|
||||||
if (CMTimeCompare(maxDuration, kCMTimeInvalid)) {
|
#if QT_OSX_DEPLOYMENT_TARGET_BELOW(__MAC_10_9)
|
||||||
if (const Float64 maxSeconds = CMTimeGetSeconds(maxDuration))
|
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_9)
|
||||||
fps.first = 1. / maxSeconds; // Min FPS = 1 / MaxDuration.
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
|
const CMTime maxDuration = captureDevice.activeVideoMaxFrameDuration;
|
||||||
|
if (CMTimeCompare(maxDuration, kCMTimeInvalid)) {
|
||||||
|
if (const Float64 maxSeconds = CMTimeGetSeconds(maxDuration))
|
||||||
|
fps.first = 1. / maxSeconds; // Min FPS = 1 / MaxDuration.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_9)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
#else // OSX < 10.7 or iOS < 7.0
|
||||||
|
{
|
||||||
|
#endif // QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_7, __IPHONE_7_0)
|
||||||
fps = qt_connection_framerates(videoConnection);
|
fps = qt_connection_framerates(videoConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user