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

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

Issue 9702019: Adds Analog Gain Control (AGC) to the WebRTC client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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/browser/renderer_host/media/audio_input_sync_writer.cc
diff --git a/content/browser/renderer_host/media/audio_input_sync_writer.cc b/content/browser/renderer_host/media/audio_input_sync_writer.cc
index 9524ad056e620dfa52fb3a70147ea3a108f4116b..d720017a09571fbf783068e6770f775aede90fc9 100644
--- a/content/browser/renderer_host/media/audio_input_sync_writer.cc
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc
@@ -15,15 +15,20 @@ AudioInputSyncWriter::AudioInputSyncWriter(base::SharedMemory* shared_memory)
AudioInputSyncWriter::~AudioInputSyncWriter() {}
+// TODO(henrika): Combine into one method (including Write).
void AudioInputSyncWriter::UpdateRecordedBytes(uint32 bytes) {
socket_->Send(&bytes, sizeof(bytes));
}
-uint32 AudioInputSyncWriter::Write(const void* data, uint32 size) {
- uint32 write_size = std::min(size, shared_memory_->created_size());
- // Copy audio input samples from recorded data to shared memory.
- memcpy(shared_memory_->memory(), data, write_size);
- return write_size;
+uint32 AudioInputSyncWriter::Write(const void* data, uint32 size,
+ double volume) {
+ AudioInputBuffer* buffer =
+ reinterpret_cast<AudioInputBuffer*>(shared_memory_->memory());
+ buffer->params.volume = volume;
+ buffer->params.size = size;
+ memcpy(buffer->audio, data, size);
+
+ return size;
}
void AudioInputSyncWriter::Close() {
« no previous file with comments | « content/browser/renderer_host/media/audio_input_sync_writer.h ('k') | content/common/media/audio_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698