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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 11827040: Update RendererWebKitPlatformSupportImpl::createAudioDevice() to handle |input_channels| (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/renderer_webkitplatformsupport_impl.cc
===================================================================
--- content/renderer/renderer_webkitplatformsupport_impl.cc (revision 175940)
+++ content/renderer/renderer_webkitplatformsupport_impl.cc (working copy)
@@ -562,20 +562,31 @@
return GetAudioOutputBufferSize();
}
+// TODO(crogers): remove deprecated API as soon as WebKit calls new API.
WebAudioDevice*
RendererWebKitPlatformSupportImpl::createAudioDevice(
- size_t bufferSize,
- unsigned numberOfChannels,
- double sampleRate,
+ size_t buffer_size,
+ unsigned channels,
+ double sample_rate,
WebAudioDevice::RenderCallback* callback) {
+ return createAudioDevice(buffer_size, 0, channels, sample_rate, callback);
+}
+
+WebAudioDevice*
+RendererWebKitPlatformSupportImpl::createAudioDevice(
+ size_t buffer_size,
+ unsigned input_channels,
+ unsigned channels,
+ double sample_rate,
+ WebAudioDevice::RenderCallback* callback) {
media::ChannelLayout layout = media::CHANNEL_LAYOUT_UNSUPPORTED;
- // The |numberOfChannels| does not exactly identify the channel layout of the
+ // The |channels| does not exactly identify the channel layout of the
// device. The switch statement below assigns a best guess to the channel
// layout based on number of channels.
// TODO(crogers): WebKit should give the channel layout instead of the hard
// channel count.
- switch (numberOfChannels) {
+ switch (channels) {
case 1:
layout = media::CHANNEL_LAYOUT_MONO;
break;
@@ -606,9 +617,9 @@
media::AudioParameters params(
media::AudioParameters::AUDIO_PCM_LOW_LATENCY, layout,
- static_cast<int>(sampleRate), 16, bufferSize);
+ static_cast<int>(sample_rate), 16, buffer_size);
- return new RendererWebAudioDeviceImpl(params, callback);
+ return new RendererWebAudioDeviceImpl(params, input_channels, callback);
}
//------------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698