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

Side by Side Diff: media/audio/win/audio_device_listener_win.cc

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/audio/win/audio_device_listener_win.h" 5 #include "media/audio/win/audio_device_listener_win.h"
6 6
7 #include <Audioclient.h> 7 #include <Audioclient.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 STDMETHODIMP AudioDeviceListenerWin::OnDeviceRemoved(LPCWSTR device_id) { 94 STDMETHODIMP AudioDeviceListenerWin::OnDeviceRemoved(LPCWSTR device_id) {
95 // We don't care when devices are removed. 95 // We don't care when devices are removed.
96 return S_OK; 96 return S_OK;
97 } 97 }
98 98
99 STDMETHODIMP AudioDeviceListenerWin::OnDeviceStateChanged(LPCWSTR device_id, 99 STDMETHODIMP AudioDeviceListenerWin::OnDeviceStateChanged(LPCWSTR device_id,
100 DWORD new_state) { 100 DWORD new_state) {
101 base::SystemMonitor* monitor = base::SystemMonitor::Get(); 101 base::SystemMonitor* monitor = base::SystemMonitor::Get();
102 if (monitor) 102 if (monitor)
103 monitor->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO_CAPTURE); 103 monitor->ProcessDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO);
104 104
105 return S_OK; 105 return S_OK;
106 } 106 }
107 107
108 STDMETHODIMP AudioDeviceListenerWin::OnDefaultDeviceChanged( 108 STDMETHODIMP AudioDeviceListenerWin::OnDefaultDeviceChanged(
109 EDataFlow flow, ERole role, LPCWSTR new_default_device_id) { 109 EDataFlow flow, ERole role, LPCWSTR new_default_device_id) {
110 // Only listen for console and communication device changes. 110 // Only listen for console and communication device changes.
111 if ((role != eConsole && role != eCommunications) || 111 if ((role != eConsole && role != eCommunications) ||
112 (flow != eRender && flow != eCapture)) { 112 (flow != eRender && flow != eCapture)) {
113 return S_OK; 113 return S_OK;
(...skipping 27 matching lines...) Expand all
141 ? CoreAudioUtil::GetFriendlyName(new_device_id) 141 ? CoreAudioUtil::GetFriendlyName(new_device_id)
142 : "no device") 142 : "no device")
143 << ", flow: " << FlowToString(flow) 143 << ", flow: " << FlowToString(flow)
144 << ", role: " << RoleToString(role) 144 << ", role: " << RoleToString(role)
145 << ", notified manager: " << (did_run_listener_cb ? "Yes" : "No"); 145 << ", notified manager: " << (did_run_listener_cb ? "Yes" : "No");
146 146
147 return S_OK; 147 return S_OK;
148 } 148 }
149 149
150 } // namespace media 150 } // namespace media
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager_unittest.cc ('k') | media/device_monitors/device_monitor_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698