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

Unified Diff: media/audio/win/audio_manager_win.cc

Issue 1314803003: Include default communication devices in audio device enumerations. This removes heuristic that pic… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment Created 5 years, 4 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
« no previous file with comments | « media/audio/win/audio_low_latency_output_win.cc ('k') | media/audio/win/core_audio_util_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/audio_manager_win.cc
diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc
index 7da916d3f0783bea84d1c89fdce67bce075c881c..4a3b0083e8f58aa1f82fc8f0d7062c98bd6da467 100644
--- a/media/audio/win/audio_manager_win.cc
+++ b/media/audio/win/audio_manager_win.cc
@@ -283,9 +283,14 @@ void AudioManagerWin::GetAudioDeviceNamesImpl(
GetOutputDeviceNamesWin(device_names);
}
- // Always add default device parameters as first element.
if (!device_names->empty()) {
AudioDeviceName name;
+ if (enumeration_type() == kMMDeviceEnumeration) {
+ name.device_name = AudioManagerBase::kCommunicationsDeviceName;
+ name.unique_id = AudioManagerBase::kCommunicationsDeviceId;
+ device_names->push_front(name);
+ }
+ // Always add default device parameters as first element.
name.device_name = AudioManagerBase::kDefaultDeviceName;
name.unique_id = AudioManagerBase::kDefaultDeviceId;
device_names->push_front(name);
@@ -377,11 +382,12 @@ AudioOutputStream* AudioManagerWin::MakeLowLatencyOutputStream(
// Pass an empty string to indicate that we want the default device
// since we consistently only check for an empty string in
// WASAPIAudioOutputStream.
+ bool communications = device_id == AudioManagerBase::kCommunicationsDeviceId;
return new WASAPIAudioOutputStream(this,
- device_id == AudioManagerBase::kDefaultDeviceId ?
+ communications || device_id == AudioManagerBase::kDefaultDeviceId ?
std::string() : device_id,
params,
- params.effects() & AudioParameters::DUCKING ? eCommunications : eConsole);
+ communications ? eCommunications : eConsole);
}
// Factory for the implementations of AudioInputStream for AUDIO_PCM_LINEAR
« no previous file with comments | « media/audio/win/audio_low_latency_output_win.cc ('k') | media/audio/win/core_audio_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698