Bug 1515461 - Make AVCaptureSession stopRunning synchronous; r=jib, a=RyanVM
authorDan Minor <dminor@mozilla.com>
Fri, 21 Dec 2018 17:07:06 +0000
changeset 509247 d85d79f64753dd634667e7398303abacf5ea13bc
parent 509246 b41ed6f2639aa4de0250294ed2643212ca411245
child 509248 02afa4e2b67d77f7701684a89256f6971b68b398
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, RyanVM
bugs1515461
milestone65.0
Bug 1515461 - Make AVCaptureSession stopRunning synchronous; r=jib, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D15144
media/webrtc/trunk/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm
--- a/media/webrtc/trunk/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm
@@ -241,25 +241,20 @@ using namespace webrtc::videocapturemodu
   [self waitForCaptureChangeToFinish];
   [self directOutputToNil];
 
   if (!_captureSession) {
     return NO;
   }
 
   _captureChanging = YES;
-  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
-    [self stopCaptureInBackground];
-  });
-  return YES;
-}
-
-- (void)stopCaptureInBackground {
   [_captureSession stopRunning];
   [self signalCaptureChangeEnd];
+
+  return YES;
 }
 
 - (BOOL)changeCaptureInputByUniqueId:(NSString*)uniqueId {
   [self waitForCaptureChangeToFinish];
   NSArray* currentInputs = [_captureSession inputs];
   // remove current input
   if ([currentInputs count] > 0) {
     AVCaptureInput* currentInput = (AVCaptureInput*)[currentInputs objectAtIndex:0];