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

Side by Side 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 tests 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 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 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h" 5 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 PepperPlatformAudioInputImpl::~PepperPlatformAudioInputImpl() { 23 PepperPlatformAudioInputImpl::~PepperPlatformAudioInputImpl() {
24 // Make sure we have been shut down. Warning: this will usually happen on 24 // Make sure we have been shut down. Warning: this will usually happen on
25 // the I/O thread! 25 // the I/O thread!
26 DCHECK_EQ(0, stream_id_); 26 DCHECK_EQ(0, stream_id_);
27 DCHECK(!client_); 27 DCHECK(!client_);
28 } 28 }
29 29
30 bool PepperPlatformAudioInputImpl::Initialize( 30 bool PepperPlatformAudioInputImpl::Initialize(
31 uint32_t sample_rate, 31 uint32_t samples_per_second,
32 uint32_t sample_count, 32 uint32_t samples_per_packet,
33 webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client) { 33 webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client) {
34 DCHECK(client); 34 DCHECK(client);
35 // Make sure we don't call init more than once. 35 // Make sure we don't call init more than once.
36 DCHECK_EQ(0, stream_id_); 36 DCHECK_EQ(0, stream_id_);
37 37
38 client_ = client; 38 client_ = client;
39 39
40 AudioParameters params; 40 AudioParameters params(
41 params.format = AudioParameters::AUDIO_PCM_LINEAR; 41 AudioParameters::AUDIO_PCM_LINEAR,
42 params.channels = 1; 42 CHANNEL_LAYOUT_MONO,
43 params.sample_rate = sample_rate; 43 samples_per_second,
44 params.bits_per_sample = 16; 44 16,
45 params.samples_per_packet = sample_count; 45 samples_per_packet);
46 46
47 ChildProcess::current()->io_message_loop()->PostTask( 47 ChildProcess::current()->io_message_loop()->PostTask(
48 FROM_HERE, 48 FROM_HERE,
49 base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread, 49 base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread,
50 this, params)); 50 this, params));
51 return true; 51 return true;
52 } 52 }
53 53
54 bool PepperPlatformAudioInputImpl::StartCapture() { 54 bool PepperPlatformAudioInputImpl::StartCapture() {
55 ChildProcess::current()->io_message_loop()->PostTask( 55 ChildProcess::current()->io_message_loop()->PostTask(
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 void PepperPlatformAudioInputImpl::OnVolume(double volume) { 133 void PepperPlatformAudioInputImpl::OnVolume(double volume) {
134 } 134 }
135 135
136 void PepperPlatformAudioInputImpl::OnStateChanged(AudioStreamState state) { 136 void PepperPlatformAudioInputImpl::OnStateChanged(AudioStreamState state) {
137 } 137 }
138 138
139 void PepperPlatformAudioInputImpl::OnDeviceReady(const std::string&) { 139 void PepperPlatformAudioInputImpl::OnDeviceReady(const std::string&) {
140 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698