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

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

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright years Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_platform_audio_input_impl.cc
diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.cc b/content/renderer/pepper/pepper_platform_audio_input_impl.cc
index 596cd0694e0b8f8772ee46e2e948354f8d5c7567..099e7d032265a6dbfb0f4705aac7b189c473e62e 100644
--- a/content/renderer/pepper/pepper_platform_audio_input_impl.cc
+++ b/content/renderer/pepper/pepper_platform_audio_input_impl.cc
@@ -29,12 +29,12 @@ PepperPlatformAudioInputImpl::~PepperPlatformAudioInputImpl() {
// static
PepperPlatformAudioInputImpl* PepperPlatformAudioInputImpl::Create(
- uint32_t sample_rate,
- uint32_t sample_count,
+ int sample_rate,
+ int frames_per_buffer,
webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client) {
scoped_refptr<PepperPlatformAudioInputImpl> audio_input(
new PepperPlatformAudioInputImpl);
- if (audio_input->Initialize(sample_rate, sample_count, client)) {
+ if (audio_input->Initialize(sample_rate, frames_per_buffer, client)) {
// Balanced by Release invoked in
// PepperPlatformAudioInputImpl::ShutDownOnIOThread().
return audio_input.release();
@@ -66,8 +66,8 @@ void PepperPlatformAudioInputImpl::ShutDown() {
}
bool PepperPlatformAudioInputImpl::Initialize(
- uint32_t sample_rate,
- uint32_t sample_count,
+ int sample_rate,
+ int frames_per_buffer,
webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client) {
DCHECK(client);
// Make sure we don't call init more than once.
@@ -75,12 +75,9 @@ bool PepperPlatformAudioInputImpl::Initialize(
client_ = client;
- AudioParameters params;
- params.format = AudioParameters::AUDIO_PCM_LINEAR;
- params.channels = 1;
- params.sample_rate = sample_rate;
- params.bits_per_sample = 16;
- params.samples_per_packet = sample_count;
+ AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR,
+ CHANNEL_LAYOUT_MONO,
+ sample_rate, 16, frames_per_buffer);
ChildProcess::current()->io_message_loop()->PostTask(
FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698