| 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_;
|
|
|
|
|