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

Unified Diff: content/browser/renderer_host/media/audio_sync_reader.cc

Issue 163343002: Reland 153623004: Remove the unified IO code on the browser (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed the cras bot Created 6 years, 10 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 | « content/browser/renderer_host/media/audio_sync_reader.h ('k') | media/audio/alsa/alsa_output_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_sync_reader.cc
diff --git a/content/browser/renderer_host/media/audio_sync_reader.cc b/content/browser/renderer_host/media/audio_sync_reader.cc
index a51d3d1e35702432f55ca927de219593fcf4239b..d491fe2ec90df9a67089bfa82d84712fcd7d3e94 100644
--- a/content/browser/renderer_host/media/audio_sync_reader.cc
+++ b/content/browser/renderer_host/media/audio_sync_reader.cc
@@ -18,10 +18,8 @@ using media::AudioBus;
namespace content {
AudioSyncReader::AudioSyncReader(base::SharedMemory* shared_memory,
- const media::AudioParameters& params,
- int input_channels)
+ const media::AudioParameters& params)
: shared_memory_(shared_memory),
- input_channels_(input_channels),
mute_audio_(CommandLine::ForCurrentProcess()->HasSwitch(
switches::kMuteAudio)),
packet_size_(shared_memory_->requested_size()),
@@ -34,18 +32,7 @@ AudioSyncReader::AudioSyncReader(base::SharedMemory* shared_memory,
maximum_wait_time_(base::TimeDelta::FromMilliseconds(20)),
#endif
buffer_index_(0) {
- int input_memory_size = 0;
- int output_memory_size = AudioBus::CalculateMemorySize(params);
- if (input_channels_ > 0) {
- // The input storage is after the output storage.
- int frames = params.frames_per_buffer();
- input_memory_size = AudioBus::CalculateMemorySize(input_channels_, frames);
- char* input_data =
- static_cast<char*>(shared_memory_->memory()) + output_memory_size;
- input_bus_ = AudioBus::WrapMemory(input_channels_, frames, input_data);
- input_bus_->Zero();
- }
- DCHECK_EQ(packet_size_, output_memory_size + input_memory_size);
+ DCHECK_EQ(packet_size_, AudioBus::CalculateMemorySize(params));
output_bus_ = AudioBus::WrapMemory(params, shared_memory->memory());
output_bus_->Zero();
}
@@ -79,15 +66,6 @@ void AudioSyncReader::Read(const AudioBus* source, AudioBus* dest) {
return;
}
- // Copy optional synchronized live audio input for consumption by renderer
- // process.
- if (input_bus_) {
- if (source)
- source->CopyTo(input_bus_.get());
- else
- input_bus_->Zero();
- }
-
if (mute_audio_)
dest->Zero();
else
« no previous file with comments | « content/browser/renderer_host/media/audio_sync_reader.h ('k') | media/audio/alsa/alsa_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698