Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1237)

Unified Diff: webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.mm

Issue 2733773003: Fix iOS8 crash in background mode. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | webrtc/sdk/objc/Framework/Classes/UIDevice+RTCDevice.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.mm b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.mm
index 5c276fc254aa73f79f618d95899903ddd588ebbe..166a609824941775e629936bb6e4c03905d20242 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.mm
@@ -13,6 +13,7 @@
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
+#import "WebRTC/UIDevice+RTCDevice.h"
#endif
#import "RTCDispatcher+Private.h"
@@ -232,21 +233,23 @@ - (void)handleCaptureSessionInterruption:(NSNotification *)notification {
NSString *reasonString = nil;
#if defined(__IPHONE_9_0) && defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && \
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0
- NSNumber *reason = notification.userInfo[AVCaptureSessionInterruptionReasonKey];
- if (reason) {
- switch (reason.intValue) {
- case AVCaptureSessionInterruptionReasonVideoDeviceNotAvailableInBackground:
- reasonString = @"VideoDeviceNotAvailableInBackground";
- break;
- case AVCaptureSessionInterruptionReasonAudioDeviceInUseByAnotherClient:
- reasonString = @"AudioDeviceInUseByAnotherClient";
- break;
- case AVCaptureSessionInterruptionReasonVideoDeviceInUseByAnotherClient:
- reasonString = @"VideoDeviceInUseByAnotherClient";
- break;
- case AVCaptureSessionInterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps:
- reasonString = @"VideoDeviceNotAvailableWithMultipleForegroundApps";
- break;
+ if ([UIDevice isIOS9OrLater]) {
+ NSNumber *reason = notification.userInfo[AVCaptureSessionInterruptionReasonKey];
+ if (reason) {
+ switch (reason.intValue) {
+ case AVCaptureSessionInterruptionReasonVideoDeviceNotAvailableInBackground:
+ reasonString = @"VideoDeviceNotAvailableInBackground";
+ break;
+ case AVCaptureSessionInterruptionReasonAudioDeviceInUseByAnotherClient:
+ reasonString = @"AudioDeviceInUseByAnotherClient";
+ break;
+ case AVCaptureSessionInterruptionReasonVideoDeviceInUseByAnotherClient:
+ reasonString = @"VideoDeviceInUseByAnotherClient";
+ break;
+ case AVCaptureSessionInterruptionReasonVideoDeviceNotAvailableWithMultipleForegroundApps:
+ reasonString = @"VideoDeviceNotAvailableWithMultipleForegroundApps";
+ break;
+ }
}
}
#endif
« no previous file with comments | « AUTHORS ('k') | webrtc/sdk/objc/Framework/Classes/UIDevice+RTCDevice.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698