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

Side by Side Diff: media/device_monitors/device_monitor_mac.mm

Issue 2326623003: Make SystemMonitor report all audio device changes instead of just audio capture. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/device_monitors/device_monitor_mac.h" 5 #include "media/device_monitors/device_monitor_mac.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 (it->type() == DeviceInfo::kMuxed) || 114 (it->type() == DeviceInfo::kMuxed) ||
115 (it->type() == DeviceInfo::kInvalid)); 115 (it->type() == DeviceInfo::kInvalid));
116 DVLOG(1) << "Device has been removed, id: " << it->unique_id(); 116 DVLOG(1) << "Device has been removed, id: " << it->unique_id();
117 } 117 }
118 // Update the cached devices with the current system snapshot. 118 // Update the cached devices with the current system snapshot.
119 cached_devices_ = snapshot_devices; 119 cached_devices_ = snapshot_devices;
120 120
121 if (video_device_added || video_device_removed) 121 if (video_device_added || video_device_removed)
122 monitor_->NotifyDeviceChanged(base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); 122 monitor_->NotifyDeviceChanged(base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE);
123 if (audio_device_added || audio_device_removed) 123 if (audio_device_added || audio_device_removed)
124 monitor_->NotifyDeviceChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE); 124 monitor_->NotifyDeviceChanged(base::SystemMonitor::DEVTYPE_AUDIO);
125 } 125 }
126 126
127 // Forward declaration for use by CrAVFoundationDeviceObserver. 127 // Forward declaration for use by CrAVFoundationDeviceObserver.
128 class SuspendObserverDelegate; 128 class SuspendObserverDelegate;
129 129
130 } // namespace 130 } // namespace
131 131
132 // This class is a Key-Value Observer (KVO) shim. It is needed because C++ 132 // This class is a Key-Value Observer (KVO) shim. It is needed because C++
133 // classes cannot observe Key-Values directly. Created, manipulated, and 133 // classes cannot observe Key-Values directly. Created, manipulated, and
134 // destroyed on the UI Thread by SuspendObserverDelegate. 134 // destroyed on the UI Thread by SuspendObserverDelegate.
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 } 466 }
467 467
468 void DeviceMonitorMac::NotifyDeviceChanged( 468 void DeviceMonitorMac::NotifyDeviceChanged(
469 base::SystemMonitor::DeviceType type) { 469 base::SystemMonitor::DeviceType type) {
470 DCHECK(thread_checker_.CalledOnValidThread()); 470 DCHECK(thread_checker_.CalledOnValidThread());
471 // TODO(xians): Remove the global variable for SystemMonitor. 471 // TODO(xians): Remove the global variable for SystemMonitor.
472 base::SystemMonitor::Get()->ProcessDevicesChanged(type); 472 base::SystemMonitor::Get()->ProcessDevicesChanged(type);
473 } 473 }
474 474
475 } // namespace media 475 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_device_listener_win.cc ('k') | media/device_monitors/device_monitor_udev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698