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

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: nits 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..50e4119ddf878aa20f9047bdca19c16f53050d9e 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;
DaleCurtis 2014/06/10 17:03:14 I'd drop this, you don't see much content code doi
henrika (OOO until Aug 14) 2014/06/12 12:00:33 Done.
namespace content {
@@ -113,8 +116,7 @@ void AudioInputRendererHost::OnError(media::AudioInputController* controller,
}
void AudioInputRendererHost::OnData(media::AudioInputController* controller,
- const uint8* data,
- uint32 size) {
+ const media::AudioBus* data) {
NOTREACHED() << "Only low-latency mode is supported.";
}
@@ -293,7 +295,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 +309,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