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

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

Issue 314713002: Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain byte vector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: xians@ Created 6 years, 6 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_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc
index baa8a744399a4e899154a6763cbbe45758e7d95e..0848cc5e623aebcb5637740d1bb3a3fea13e6f64 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
@@ -17,6 +17,9 @@
#include "content/browser/renderer_host/media/audio_input_sync_writer.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "media/audio/audio_manager_base.h"
+#include "media/base/audio_bus.h"
+
+using media::AudioBus;
namespace content {
@@ -293,7 +296,7 @@ void AudioInputRendererHost::OnCreateStream(
scoped_ptr<AudioEntry> entry(new AudioEntry());
const uint32 segment_size = (sizeof(media::AudioInputBufferParameters) +
- audio_params.GetBytesPerBuffer());
+ AudioBus::CalculateMemorySize(audio_params));
entry->shared_memory_segment_count = config.shared_memory_count;
// Create the shared memory and share it with the renderer process
@@ -307,9 +310,8 @@ void AudioInputRendererHost::OnCreateStream(
return;
}
- scoped_ptr<AudioInputSyncWriter> writer(
- new AudioInputSyncWriter(&entry->shared_memory,
- entry->shared_memory_segment_count));
+ scoped_ptr<AudioInputSyncWriter> writer(new AudioInputSyncWriter(
+ &entry->shared_memory, entry->shared_memory_segment_count, audio_params));
if (!writer->Init()) {
SendErrorMessage(stream_id, SYNC_WRITER_INIT_FAILED);

Powered by Google App Engine
This is Rietveld 408576698