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

Unified Diff: media/audio/audio_device_thread.h

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, 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: media/audio/audio_device_thread.h
===================================================================
--- media/audio/audio_device_thread.h (revision 186364)
+++ media/audio/audio_device_thread.h (working copy)
@@ -38,7 +38,8 @@
public:
Callback(const AudioParameters& audio_parameters,
base::SharedMemoryHandle memory,
- int memory_length);
+ int memory_length,
+ int total_segments);
virtual ~Callback();
// One time initialization for the callback object on the audio thread.
@@ -49,7 +50,8 @@
virtual void MapSharedMemory() = 0;
// Called whenever we receive notifications about pending data.
- virtual void Process(int pending_data) = 0;
+ // The |index| states which shared memory buffer segment is used.
+ virtual void Process(int pending_data, int index) = 0;
protected:
// Protected so that derived classes can access directly.
@@ -61,12 +63,14 @@
base::SharedMemory shared_memory_;
const int memory_length_;
+ const int total_segments_;
+ int segment_length_;
private:
DISALLOW_COPY_AND_ASSIGN(Callback);
};
- AudioDeviceThread();
+ AudioDeviceThread(bool need_read_index);
~AudioDeviceThread();
// Starts the audio thread. The thread must not already be running.
@@ -98,6 +102,9 @@
// reliable initialization.
class Thread;
+ // Flag indicating whether need to read index from sync socket.
+ bool need_read_index_;
+
base::Lock thread_lock_;
scoped_refptr<AudioDeviceThread::Thread> thread_;

Powered by Google App Engine
This is Rietveld 408576698