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

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

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_sync_writer.h
diff --git a/content/browser/renderer_host/media/audio_input_sync_writer.h b/content/browser/renderer_host/media/audio_input_sync_writer.h
index 75b2bbf1e2efba4f77b26e0470756ed7b2ad94dd..424d7907f11326717965bb74b762e0276bcac6a9 100644
--- a/content/browser/renderer_host/media/audio_input_sync_writer.h
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.h
@@ -5,10 +5,13 @@
#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_
#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_SYNC_WRITER_H_
+#include "base/memory/scoped_vector.h"
#include "base/process/process.h"
#include "base/sync_socket.h"
#include "base/time/time.h"
#include "media/audio/audio_input_controller.h"
+#include "media/audio/audio_parameters.h"
+#include "media/base/audio_bus.h"
#if defined(OS_POSIX)
#include "base/file_descriptor_posix.h"
@@ -26,16 +29,16 @@ namespace content {
class AudioInputSyncWriter : public media::AudioInputController::SyncWriter {
public:
explicit AudioInputSyncWriter(base::SharedMemory* shared_memory,
- int shared_memory_segment_count);
+ int shared_memory_segment_count,
+ const media::AudioParameters& params);
virtual ~AudioInputSyncWriter();
- // media::AudioOutputController::SyncWriter implementation.
+ // media::AudioInputController::SyncWriter implementation.
virtual void UpdateRecordedBytes(uint32 bytes) OVERRIDE;
- virtual uint32 Write(const void* data,
- uint32 size,
- double volume,
- bool key_pressed) OVERRIDE;
+ virtual void Write(const media::AudioBus* data,
+ double volume,
+ bool key_pressed) OVERRIDE;
virtual void Close() OVERRIDE;
bool Init();
@@ -65,6 +68,13 @@ class AudioInputSyncWriter : public media::AudioInputController::SyncWriter {
// The time of the last Write call.
base::Time last_write_time_;
+ // Size in bytes of each audio bus.
+ const int audio_bus_memory_size_;
+
+ // Vector of audio buses allocated during construction and deleted in the
+ // destructor.
+ ScopedVector<media::AudioBus> audio_buses_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputSyncWriter);
};

Powered by Google App Engine
This is Rietveld 408576698