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

Unified Diff: media/audio/audio_output_proxy.h

Issue 9691001: Audio software mixer. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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_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);
};

Powered by Google App Engine
This is Rietveld 408576698