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

Side by Side Diff: media/audio/audio_util.cc

Issue 12387006: Pass more detailed audio hardware configuration information to the renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
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 // Software adjust volume of samples, allows each audio stream its own 5 // Software adjust volume of samples, allows each audio stream its own
6 // volume without impacting master volume for chrome and other applications. 6 // volume without impacting master volume for chrome and other applications.
7 7
8 // Implemented as templates to allow 8, 16 and 32 bit implementations. 8 // Implemented as templates to allow 8, 16 and 32 bit implementations.
9 // 8 bit is unsigned and biased by 128. 9 // 8 bit is unsigned and biased by 128.
10 10
(...skipping 11 matching lines...) Expand all
22 #include "base/logging.h" 22 #include "base/logging.h"
23 #include "base/string_number_conversions.h" 23 #include "base/string_number_conversions.h"
24 #include "base/time.h" 24 #include "base/time.h"
25 #include "media/audio/audio_parameters.h" 25 #include "media/audio/audio_parameters.h"
26 #include "media/base/audio_bus.h" 26 #include "media/base/audio_bus.h"
27 #include "media/base/media_switches.h" 27 #include "media/base/media_switches.h"
28 28
29 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
30 #include "media/audio/mac/audio_low_latency_input_mac.h" 30 #include "media/audio/mac/audio_low_latency_input_mac.h"
31 #include "media/audio/mac/audio_low_latency_output_mac.h" 31 #include "media/audio/mac/audio_low_latency_output_mac.h"
32 #include "media/audio/mac/audio_unified_mac.h"
32 #elif defined(OS_WIN) 33 #elif defined(OS_WIN)
33 #include "base/win/windows_version.h" 34 #include "base/win/windows_version.h"
34 #include "media/audio/audio_manager_base.h" 35 #include "media/audio/audio_manager_base.h"
35 #include "media/audio/win/audio_low_latency_input_win.h" 36 #include "media/audio/win/audio_low_latency_input_win.h"
36 #include "media/audio/win/audio_low_latency_output_win.h" 37 #include "media/audio/win/audio_low_latency_output_win.h"
37 #include "media/audio/win/core_audio_util_win.h" 38 #include "media/audio/win/core_audio_util_win.h"
38 #include "media/base/limits.h" 39 #include "media/base/limits.h"
39 #endif 40 #endif
40 41
41 namespace media { 42 namespace media {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // - The entire Windows audio stack was rewritten for Windows Vista and wave 278 // - The entire Windows audio stack was rewritten for Windows Vista and wave
278 // out performance was degraded compared to XP. 279 // out performance was degraded compared to XP.
279 // - The regression was fixed in Windows 7 and most configurations will work 280 // - The regression was fixed in Windows 7 and most configurations will work
280 // with 2, but some (e.g., some Sound Blasters) still need 3. 281 // with 2, but some (e.g., some Sound Blasters) still need 3.
281 // - Some XP configurations (even multi-processor ones) also need 3. 282 // - Some XP configurations (even multi-processor ones) also need 3.
282 return (base::win::GetVersion() == base::win::VERSION_VISTA) ? 4 : 3; 283 return (base::win::GetVersion() == base::win::VERSION_VISTA) ? 4 : 3;
283 } 284 }
284 285
285 #endif 286 #endif
286 287
288 int GetAudioHardwareOutputChannels() {
289 #if defined(OS_MACOSX)
290 int channels, channels_per_frame;
291 if (AudioHardwareUnifiedStream::GetDefaultOutputChannels(
292 &channels, &channels_per_frame))
293 return channels;
294 else
295 return 2;
296 #else
297 // !!!!
298 return 2;
299 #endif
300 }
301
287 } // namespace media 302 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698