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

Unified Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 10824304: Upgrade AudioBus to support wrapping, interleaving. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 4 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 | media/audio/audio_input_device.cc » ('j') | media/base/audio_bus.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_device_impl.cc
diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc
index dc6d2ba91b4e369c7e06250275c79757c43c21d9..b6b29ecb68decad91c39214f3e8d42ed139930b2 100644
--- a/content/renderer/media/webrtc_audio_device_impl.cc
+++ b/content/renderer/media/webrtc_audio_device_impl.cc
@@ -11,8 +11,8 @@
#include "content/renderer/media/audio_device_factory.h"
#include "content/renderer/media/audio_hardware.h"
#include "content/renderer/render_thread_impl.h"
-#include "media/audio/audio_util.h"
#include "media/audio/audio_parameters.h"
+#include "media/audio/audio_util.h"
#include "media/audio/sample_rates.h"
using content::AudioDeviceFactory;
@@ -218,15 +218,8 @@ int WebRtcAudioDeviceImpl::Render(
// Deinterleave each channel and convert to 32-bit floating-point
// with nominal range -1.0 -> +1.0 to match the callback format.
- for (int channel_index = 0; channel_index < channels; ++channel_index) {
- media::DeinterleaveAudioChannel(
- output_buffer_.get(),
- audio_bus->channel(channel_index),
- channels,
- channel_index,
- bytes_per_sample_,
- audio_bus->frames());
- }
+ audio_bus->FromInterleaved(output_buffer_.get(), audio_bus->frames(),
+ bytes_per_sample_);
return audio_bus->frames();
}
@@ -265,10 +258,9 @@ void WebRtcAudioDeviceImpl::Capture(media::AudioBus* audio_bus,
// Interleave, scale, and clip input to int and store result in
// a local byte buffer.
- media::InterleaveFloatToInt(audio_bus,
- input_buffer_.get(),
- audio_bus->frames(),
- input_audio_parameters_.bits_per_sample() / 8);
+ audio_bus->ToInterleaved(audio_bus->frames(),
+ input_audio_parameters_.bits_per_sample() / 8,
+ input_buffer_.get());
int samples_per_sec = input_sample_rate();
if (samples_per_sec == 44100) {
« no previous file with comments | « no previous file | media/audio/audio_input_device.cc » ('j') | media/base/audio_bus.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698