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

Issue 252893003: Mac AVFoundation: Enumerate devices in device/audio thread. Take 2. (Closed)

Created:
6 years, 7 months ago by mcasas
Modified:
6 years, 7 months ago
CC:
chromium-reviews, fischman+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, miu+watch_chromium.org
Visibility:
Public.

Description

Mac AVFoundation: Enumerate devices in device/audio thread, take 2. This is the second go at the CL originally http://crrev.com/234563004, that landed and got reverted due to a series of crashes caused by inappropriate handling of the iterator in -CrAVFoundationDeviceObserver::dealloc ** This CL lands the original code plus some new code centered and limited to the mentioned -dealloc (device_monitor_mac.mm:351). ** Original description follows: ------------------------------------------ Mac AVFoundation: Enumerate devices in device/audio thread. Bug http://crbug.com/359589 describes a Chrome hang where two threads are calling [AVCaptureDeviceGlue devices] at the same time to enumerate the devices. The first call comes from DeviceMonitorMac::StartMonitoring() on UI thread while the second call comes from the Audio Thread, a.k.a. Device Thread on +VideoCaptureDeviceAVFoundation::getDeviceNames:. DMM == DeviceMonitorMac The solution proposed here is to do as much as possible on Device thread : - when there is a device change via DMM::OnDeviceChanged(), enumerate on Device Thread, then consolidate the device list on UI thread. - First |suspend_observer_| registration happens on Device Thread. This suspend observer lives in device thread. - Observer removal happens dutifully on Device Thread destructor in -CrAVFoundationDeviceObserver::dealloc BUG=288562, 359589 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267103

Patch Set 1 #

Total comments: 1

Patch Set 2 : rsesek@ nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -21 lines) Patch
M content/browser/device_monitor_mac.h View 2 chunks +5 lines, -3 lines 0 comments Download
M content/browser/device_monitor_mac.mm View 1 8 chunks +67 lines, -15 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
mcasas
rsesek@ PTAL (changed iterator handling).
6 years, 7 months ago (2014-04-29 06:49:10 UTC) #1
Robert Sesek
LGTM https://codereview.chromium.org/252893003/diff/1/content/browser/device_monitor_mac.mm File content/browser/device_monitor_mac.mm (left): https://codereview.chromium.org/252893003/diff/1/content/browser/device_monitor_mac.mm#oldcode302 content/browser/device_monitor_mac.mm:302: if ((self = [super init])) { nit: keep ...
6 years, 7 months ago (2014-04-29 15:19:53 UTC) #2
mcasas
tommi@ OWNERS stamp/PTAL if you want.
6 years, 7 months ago (2014-04-29 15:48:33 UTC) #3
mcasas
avi@: OWNERS stamp please.
6 years, 7 months ago (2014-04-29 16:08:22 UTC) #4
Avi (use Gerrit)
lgtm stamp
6 years, 7 months ago (2014-04-29 16:13:55 UTC) #5
mcasas
The CQ bit was checked by mcasas@chromium.org
6 years, 7 months ago (2014-04-29 16:16:49 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/252893003/20001
6 years, 7 months ago (2014-04-29 16:17:40 UTC) #7
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-29 22:19:01 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel on tryserver.chromium
6 years, 7 months ago (2014-04-29 22:19:01 UTC) #9
mcasas
The CQ bit was checked by mcasas@chromium.org
6 years, 7 months ago (2014-04-30 05:03:54 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/252893003/20001
6 years, 7 months ago (2014-04-30 05:04:23 UTC) #11
commit-bot: I haz the power
6 years, 7 months ago (2014-04-30 06:51:42 UTC) #12
Message was sent while issue was closed.
Change committed as 267103

Powered by Google App Engine
This is Rietveld 408576698