Index: media/audio/audio_output_proxy.h |
=================================================================== |
--- media/audio/audio_output_proxy.h (revision 129817) |
+++ media/audio/audio_output_proxy.h (working copy) |
@@ -8,6 +8,7 @@ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
#include "base/memory/ref_counted.h" |
+#include "base/synchronization/lock.h" |
#include "base/threading/non_thread_safe.h" |
#include "media/audio/audio_io.h" |
#include "media/audio/audio_parameters.h" |
@@ -29,6 +30,19 @@ |
// Caller keeps ownership of |dispatcher|. |
explicit AudioOutputProxy(AudioOutputDispatcher* dispatcher); |
+ // Accessors. |
+ AudioSourceCallback* audio_source_callback() const { |
+ return audio_source_callback_; |
+ } |
+ |
+ int pending_bytes() const { |
+ return pending_bytes_; |
+ } |
+ |
+ void set_pending_bytes(int pending_bytes) { |
+ pending_bytes_ = pending_bytes; |
+ } |
+ |
// AudioOutputStream interface. |
virtual bool Open() OVERRIDE; |
virtual void Start(AudioSourceCallback* callback) OVERRIDE; |
@@ -59,6 +73,16 @@ |
// is stopped, and then started again. |
double volume_; |
+ // Callback. |
+ AudioSourceCallback* audio_source_callback_; |
+ |
+ // Lock protecting |volume_| -- we can read it in the hardware audio thread. |
+ base::Lock lock_; |
+ |
+ // Number of pending bytes in the buffer. |
+ // Initialized in Start() and after that accessed only in the hardware thread. |
+ int pending_bytes_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AudioOutputProxy); |
}; |