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

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

Issue 10575017: Adding experimental exclusive-mode streaming to WASAPIAudioOutputStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes based on review by Chris and Andrew Created 8 years, 6 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: 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 38c461536c5bb2b787f99078d3664b74adc51cf6..2f4ea80162204a270550737de449c9918a2c8465 100644
--- a/media/audio/win/audio_manager_win.cc
+++ b/media/audio/win/audio_manager_win.cc
@@ -26,6 +26,7 @@
#include "media/audio/win/wavein_input_win.h"
#include "media/audio/win/waveout_output_win.h"
#include "media/base/limits.h"
+#include "media/base/media_switches.h"
// Libraries required for the SetupAPI and Wbem APIs used here.
#pragma comment(lib, "setupapi.lib")
@@ -269,7 +270,16 @@ AudioOutputStream* AudioManagerWin::MakeLowLatencyOutputStream(
} else {
// TODO(henrika): improve possibility to specify audio endpoint.
// Use the default device (same as for Wave) for now to be compatible.
- stream = new WASAPIAudioOutputStream(this, params, eConsole);
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kEnableExclusiveMode)) {
+ // Experiemental mode; use with care.
+ stream = new WASAPIAudioOutputStream(
+ this, params, eConsole, AUDCLNT_SHAREMODE_EXCLUSIVE);
+ } else {
+ // Shared mode streaming is the default mode.
+ stream = new WASAPIAudioOutputStream(
+ this, params, eConsole, AUDCLNT_SHAREMODE_SHARED);
+ }
}
return stream;

Powered by Google App Engine
This is Rietveld 408576698