-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS 14.0.1 crashes with bundled WebRTC.framework when calling (begin|end)GeneratingDeviceOrientationNotifications M69 and M75 but not M84 #578
Comments
hello @pasmat you modifed RTCCameraVideoCapturer.m in your WebRTC build ? |
can you try M72 and M84 |
diff webrtc-M69/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m webrtc-M69\ 2/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m 156,158d155
< [RTCDispatcher
< dispatchAsyncOnType:RTCDispatcherTypeMain
< block:^{
160d156
< }];
201,203d196
< [RTCDispatcher
< dispatchAsyncOnType:RTCDispatcherTypeMain
< block:^{
205d197
< }]; Here's the diff for M69 WebRTC that fixes it for 14.0.1. If this is fixed on M84 as suggested by @agelito - that's must be the better fix, if it has no other compatibility issues. Thanks. |
First, it does not crash for me at all on iOS 14.0.1 so fare on iPad Pro and iPhone 6 and 11 on 14.0.1. |
Can you provide a modified Notice I cannot reproduce this issue, can you also try cordova 9 for me. |
Here is minor update on BuildWebRTCLib to support Xcode 12: @pasmat did you have warning that where treated as errors, if not, what version of Xcode are you using? |
Updated difff from @pasmat index 8f93937c75..e21cc76280 100644
--- i/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m
+++ w/sdk/objc/Framework/Classes/PeerConnection/RTCCameraVideoCapturer.m
@@ -148,7 +148,7 @@ const int64_t kNanosecondsPerSecond = 1000000000;
completionHandler:(nullable void (^)(NSError *))completionHandler {
_willBeRunning = YES;
[RTCDispatcher
- dispatchAsyncOnType:RTCDispatcherTypeCaptureSession
+ dispatchAsyncOnType:RTCDispatcherTypeMain
block:^{
RTCLogInfo("startCaptureWithDevice %@ @ %ld fps", format, (long)fps);
@@ -184,7 +184,7 @@ const int64_t kNanosecondsPerSecond = 1000000000;
- (void)stopCaptureWithCompletionHandler:(nullable void (^)(void))completionHandler {
_willBeRunning = NO;
[RTCDispatcher
- dispatchAsyncOnType:RTCDispatcherTypeCaptureSession
+ dispatchAsyncOnType:RTCDispatcherTypeMain
block:^{
RTCLogInfo("Stop");
_currentDevice = nil; testing fix now. |
I'm closing for now, please comment if fix not working but it does for me. |
Please read first!
Please use Public Google Group (mailing list) for general technical discussions and questions.
extra/renderer-and-libwebrtc-tests.js
file).Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed, removing this checkbox will result in automatic closed issue.
Versions affected
Description
The bundled WebRTC Framework causes crash, due to RTCCameraVideoCapturer.startCapture calling UIDevices beginGeneratingDeviceOrientationNotifications on non main thread
I used the linked guide to build WebRTC framework and modified RTCCameraVideoCapturer.m so that instead of calling the beginGeneratingDeviceOrientationNotifications and endGeneratingDeviceOrientationNotifications via RTCDispatchers RTCDispatcherTypeCaptureSession, I call them on RTCDispatcherTypeMain, and it works as expected.
I can't find any documentation regarding the changes to this functions behavior on iOS 14, but this works as expected on my iPad running iOS 13, and used to work on my iPhone running iOS 14.
Steps to reproduce
Run anything on iOS 14.0.1 that accesses the camera using cordova-plugin-iosrtc
Expected results
No crash
Actual results
Crash
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'threading violation: expected the main thread'
The text was updated successfully, but these errors were encountered: