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

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

Issue 367923004: Turn audio ducking on by default on Windows again. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, update tests, logging and documentation Created 6 years, 5 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/core_audio_util_win.cc
diff --git a/media/audio/win/core_audio_util_win.cc b/media/audio/win/core_audio_util_win.cc
index 71e8d717f62f4ea2fb164167487a5efd35676644..8743f902082ec0abd47a42456dd4748d24cf436c 100644
--- a/media/audio/win/core_audio_util_win.cc
+++ b/media/audio/win/core_audio_util_win.cc
@@ -23,6 +23,12 @@ using base::win::ScopedHandle;
namespace media {
+// See header file for documentation.
+// {BE39AF4F-087C-423F-9303-234EC1E5B8EE}
+const GUID kCommunicationsSessionId = {
+ 0xbe39af4f, 0x87c, 0x423f, { 0x93, 0x3, 0x23, 0x4e, 0xc1, 0xe5, 0xb8, 0xee }
+};
+
enum { KSAUDIO_SPEAKER_UNSUPPORTED = 0 };
// Converts Microsoft's channel configuration to ChannelLayout.
@@ -735,6 +741,13 @@ HRESULT CoreAudioUtil::SharedModeInitialize(IAudioClient* client,
const WAVEFORMATPCMEX* format,
HANDLE event_handle,
uint32* endpoint_buffer_size) {
+ return SharedModeInitializeWithSession(
+ client, format, event_handle, endpoint_buffer_size, NULL);
+}
+
+HRESULT CoreAudioUtil::SharedModeInitializeWithSession(
+ IAudioClient* client, const WAVEFORMATPCMEX* format, HANDLE event_handle,
+ uint32* endpoint_buffer_size, const GUID* session_guid) {
DCHECK(IsSupported());
// Use default flags (i.e, dont set AUDCLNT_STREAMFLAGS_NOPERSIST) to
@@ -760,7 +773,7 @@ HRESULT CoreAudioUtil::SharedModeInitialize(IAudioClient* client,
0,
0,
reinterpret_cast<const WAVEFORMATEX*>(format),
- NULL);
+ session_guid);
if (FAILED(hr)) {
DVLOG(1) << "IAudioClient::Initialize: " << std::hex << hr;
return hr;
« media/audio/win/core_audio_util_win.h ('K') | « media/audio/win/core_audio_util_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698