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

Unified Diff: media/audio/audio_output_device.cc

Issue 12379071: Use multiple shared memory buffers cyclically for audio capture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: aggregate buffers Created 7 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
Index: media/audio/audio_output_device.cc
===================================================================
--- media/audio/audio_output_device.cc (revision 186364)
+++ media/audio/audio_output_device.cc (working copy)
@@ -30,7 +30,7 @@
virtual void MapSharedMemory() OVERRIDE;
// Called whenever we receive notifications about pending data.
- virtual void Process(int pending_data) OVERRIDE;
+ virtual void Process(int pending_data, int index) OVERRIDE;
private:
AudioRendererSink::RenderCallback* render_callback_;
@@ -48,6 +48,7 @@
stream_id_(0),
state_(IDLE),
play_on_start_(true),
+ audio_thread_(false),
stopping_hack_(false) {
CHECK(ipc_);
}
@@ -257,7 +258,8 @@
AudioRendererSink::RenderCallback* render_callback)
: AudioDeviceThread::Callback(audio_parameters,
memory,
- memory_length),
+ memory_length,
+ 1),
render_callback_(render_callback) {
}
@@ -265,6 +267,7 @@
}
void AudioOutputDevice::AudioThreadCallback::MapSharedMemory() {
+ CHECK_EQ(total_segments_, 1);
CHECK(shared_memory_.Map(TotalSharedMemorySizeInBytes(memory_length_)));
// Calculate output and input memory size.
@@ -291,7 +294,8 @@
}
// Called whenever we receive notifications about pending data.
-void AudioOutputDevice::AudioThreadCallback::Process(int pending_data) {
+void AudioOutputDevice::AudioThreadCallback::Process(
+ int pending_data, int index) {
if (pending_data == kPauseMark) {
memset(shared_memory_.memory(), 0, memory_length_);
SetActualDataSizeInBytes(&shared_memory_, memory_length_, 0);

Powered by Google App Engine
This is Rietveld 408576698