Bugfix:setting capture framerate always defaults to 30fps.

Bug: webrtc:7777
Change-Id: Ia8db06eea29d271fe8a74db203b68cabd4fa5939
Reviewed-on: https://chromium-review.googlesource.com/539641
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Daniela Jovanoska Petrenko <denicija@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#18673}
This commit is contained in:
Daniela
2017-06-19 16:10:31 +02:00
committed by Commit Bot
parent e8d2bd61db
commit a9b848abc9

View File

@ -129,18 +129,16 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) {
_currentDevice = device;
NSError *error = nil;
if ([_currentDevice lockForConfiguration:&error]) {
[self updateDeviceCaptureFormat:format fps:fps];
} else {
RTCLogError(@"Failed to lock device %@. Error: %@", _currentDevice,
error.userInfo);
if (![_currentDevice lockForConfiguration:&error]) {
RTCLogError(
@"Failed to lock device %@. Error: %@", _currentDevice, error.userInfo);
return;
}
[self reconfigureCaptureSessionInput];
[self updateOrientation];
[_captureSession startRunning];
[self updateDeviceCaptureFormat:format fps:fps];
[_currentDevice unlockForConfiguration];
_isRunning = true;
}];
@ -366,6 +364,7 @@ static inline BOOL IsMediaSubTypeSupported(FourCharCode mediaSubType) {
@try {
_currentDevice.activeFormat = format;
_currentDevice.activeVideoMinFrameDuration = CMTimeMake(1, fps);
_currentDevice.activeVideoMaxFrameDuration = CMTimeMake(1, fps);
} @catch (NSException *exception) {
RTCLogError(@"Failed to set active format!\n User info:%@", exception.userInfo);
return;