DescriptionMac 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 #
Messages
Total messages: 12 (0 generated)
|