commit | a6368d17c5ec52355f332d869996a1946535826f | [log] [tgz] |
---|---|---|
author | JT Teh <jtteh@webrtc.org> | Thu Sep 28 11:00:39 2017 -0700 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Sep 28 19:41:06 2017 +0000 |
tree | 6c0c00fa0f243c7b70aa3ecddeac4228eb41e194 | |
parent | 83d3ec177ce1c4860e2b48088aa02d1ab508770b [diff] |
Fix occassional hang in iOS 11 when calling VTDecompressionSessionInvalidate. BUG=webrtc:8302 Change-Id: I426116c621c53a0300f87a2a5dc147578b559ed6 Reviewed-on: https://webrtc-review.googlesource.com/4520 Reviewed-by: Zeke Chin <tkchin@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Commit-Queue: JT Teh <jtteh@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20026}
diff --git a/sdk/objc/Framework/Classes/Common/UIDevice+RTCDevice.mm b/sdk/objc/Framework/Classes/Common/UIDevice+RTCDevice.mm index 94faf53..01905d9 100644 --- a/sdk/objc/Framework/Classes/Common/UIDevice+RTCDevice.mm +++ b/sdk/objc/Framework/Classes/Common/UIDevice+RTCDevice.mm
@@ -173,4 +173,8 @@ return [self currentDeviceSystemVersion] >= 9.0; } ++ (BOOL)isIOS11OrLater { + return [self currentDeviceSystemVersion] >= 11.0; +} + @end
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm index 6e000ab..4cf48bd 100644 --- a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm +++ b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm
@@ -25,6 +25,7 @@ #if defined(WEBRTC_IOS) #import "Common/RTCUIApplicationStatusObserver.h" +#import "WebRTC/UIDevice+RTCDevice.h" #endif // Struct that we pass to the decoder per frame to decode. We receive it again @@ -236,6 +237,11 @@ - (void)destroyDecompressionSession { if (_decompressionSession) { +#if defined(WEBRTC_IOS) + if ([UIDevice isIOS11OrLater]) { + VTDecompressionSessionWaitForAsynchronousFrames(_decompressionSession); + } +#endif VTDecompressionSessionInvalidate(_decompressionSession); CFRelease(_decompressionSession); _decompressionSession = nullptr;
diff --git a/sdk/objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h b/sdk/objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h index 29e4801..7e01c47 100644 --- a/sdk/objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h +++ b/sdk/objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h
@@ -60,5 +60,6 @@ + (RTCDeviceType)deviceType; + (NSString *)stringForDeviceType:(RTCDeviceType)deviceType; + (BOOL)isIOS9OrLater; ++ (BOOL)isIOS11OrLater; @end