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

Unified Diff: content/browser/device_monitor_mac.mm

Issue 189443010: Mac AVFoundation/QTKit: delay DeviceMonitorMac startup to first GetUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rsesek@ comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/device_monitor_mac.mm
diff --git a/content/browser/device_monitor_mac.mm b/content/browser/device_monitor_mac.mm
index 0e536746deda496fe666e8dd90e87a28f1bf2f8d..15f6da203338f1a277b60ffde7960781ae75aa78 100644
--- a/content/browser/device_monitor_mac.mm
+++ b/content/browser/device_monitor_mac.mm
@@ -337,22 +337,24 @@ void AVFoundationMonitorImpl::OnDeviceChanged() {
namespace content {
DeviceMonitorMac::DeviceMonitorMac() {
+ // Both QTKit and AVFoundation do not need to be fired up until the user
+ // exercises a GetUserMedia. Bringing up either library and enumerating the
+ // devices in the system is an operation taking in the range of hundred of ms,
+ // so it is triggered explicitly from MediaStreamManager::StartMonitoring().
+}
+
+DeviceMonitorMac::~DeviceMonitorMac() {}
+
+void DeviceMonitorMac::StartMonitoring() {
tommi (sloooow) - chröme 2014/03/10 18:38:26 Can you add a DCHECK that when we get here we're o
mcasas 2014/03/11 07:57:32 Done.
if (AVFoundationGlue::IsAVFoundationSupported()) {
DVLOG(1) << "Monitoring via AVFoundation";
device_monitor_impl_.reset(new AVFoundationMonitorImpl(this));
- // For the AVFoundation to start sending connect/disconnect notifications,
- // the AVFoundation NSBundle has to be loaded and the devices enumerated.
- // This operation seems to take in the range of hundred of ms. so should be
- // moved to the point when is needed, and that is during
- // DeviceVideoCaptureMac +getDeviceNames.
} else {
DVLOG(1) << "Monitoring via QTKit";
device_monitor_impl_.reset(new QTKitMonitorImpl(this));
}
}
-DeviceMonitorMac::~DeviceMonitorMac() {}
-
void DeviceMonitorMac::NotifyDeviceChanged(
base::SystemMonitor::DeviceType type) {
// TODO(xians): Remove the global variable for SystemMonitor.

Powered by Google App Engine
This is Rietveld 408576698