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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 9129007: Work on improving PpbAudioConfig:RecommendSampleFrameCount (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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
« no previous file with comments | « no previous file | ppapi/api/ppb_audio_config.idl » ('j') | ppapi/api/ppb_audio_config.idl » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper_plugin_delegate_impl.cc (revision 118765)
+++ content/renderer/pepper_plugin_delegate_impl.cc (working copy)
@@ -36,6 +36,7 @@
#include "content/renderer/gpu/gpu_channel_host.h"
#include "content/renderer/gpu/renderer_gl_context.h"
#include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h"
+#include "content/renderer/media/audio_hardware.h"
#include "content/renderer/media/audio_input_message_filter.h"
#include "content/renderer/media/audio_message_filter.h"
#include "content/renderer/media/video_capture_impl_manager.h"
@@ -241,7 +242,12 @@
client_ = client;
AudioParameters params;
- params.format = AudioParameters::AUDIO_PCM_LINEAR;
+ // Use the low latency back end if the client request is compatible.
+ if (sample_rate == audio_hardware::GetOutputSampleRate() &&
+ sample_count % audio_hardware::GetOutputBufferSize() == 0)
+ params.format = AudioParameters::AUDIO_PCM_LOW_LATENCY;
+ else
+ params.format = AudioParameters::AUDIO_PCM_LINEAR;
params.channels = 2;
params.sample_rate = sample_rate;
params.bits_per_sample = 16;
« no previous file with comments | « no previous file | ppapi/api/ppb_audio_config.idl » ('j') | ppapi/api/ppb_audio_config.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698