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

Unified Diff: content/renderer/pepper/pepper_platform_audio_output_impl.cc

Issue 11880009: Introduce AudioHardwareConfig for renderer side audio device info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nits. Created 7 years, 11 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: content/renderer/pepper/pepper_platform_audio_output_impl.cc
diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.cc b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
index 6681d0aab61387dc4f1b472bb38d7e6280ef43ab..2a6dbf6b9753ecba004bac49c71bec462c7893e4 100644
--- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc
@@ -11,9 +11,9 @@
#include "build/build_config.h"
#include "content/common/child_process.h"
#include "content/common/media/audio_messages.h"
-#include "content/renderer/media/audio_hardware.h"
#include "content/renderer/media/audio_message_filter.h"
#include "content/renderer/render_thread_impl.h"
+#include "media/base/audio_hardware_config.h"
#include "media/base/media_switches.h"
namespace content {
@@ -125,14 +125,17 @@ bool PepperPlatformAudioOutputImpl::Initialize(
media::AudioParameters::Format format;
const int kMaxFramesForLowLatency = 2047;
+ media::AudioHardwareConfig* hardware_config =
+ RenderThreadImpl::current()->GetAudioHardwareConfig();
+
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
if (!cmd_line->HasSwitch(switches::kDisableAudioOutputResampler)) {
// Rely on AudioOutputResampler to handle any inconsistencies between the
// hardware params required for low latency and the requested params.
format = media::AudioParameters::AUDIO_PCM_LOW_LATENCY;
- } else if (sample_rate == GetAudioOutputSampleRate() &&
+ } else if (sample_rate == hardware_config->GetOutputSampleRate() &&
frames_per_buffer <= kMaxFramesForLowLatency &&
- frames_per_buffer % content::GetAudioOutputBufferSize() == 0) {
+ frames_per_buffer % hardware_config->GetOutputBufferSize() == 0) {
// Use the low latency back end if the client request is compatible, and
// the sample count is low enough to justify using AUDIO_PCM_LOW_LATENCY.
format = media::AudioParameters::AUDIO_PCM_LOW_LATENCY;
« no previous file with comments | « content/renderer/media/webrtc_audio_renderer.cc ('k') | content/renderer/pepper/pepper_plugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698