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

Unified Diff: media/audio/android/opensles_input.h

Issue 23296008: Adding audio unit tests for Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: First round Created 7 years, 4 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/android/opensles_input.h
diff --git a/media/audio/android/opensles_input.h b/media/audio/android/opensles_input.h
index 9743992fc653e16cacbbce8644acec4e4d361f63..9a199ac0521016cf06673a3ee4cf82edf66bba81 100644
--- a/media/audio/android/opensles_input.h
+++ b/media/audio/android/opensles_input.h
@@ -9,6 +9,8 @@
#include <SLES/OpenSLES_Android.h>
#include "base/compiler_specific.h"
+#include "base/synchronization/lock.h"
+#include "base/threading/thread_checker.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_parameters.h"
#include "media/audio/android/opensles_util.h"
@@ -41,9 +43,11 @@ class OpenSLESInputStream : public AudioInputStream {
private:
bool CreateRecorder();
+ // Called from OpenSLES specific audio worker thread.
static void SimpleBufferQueueCallback(
SLAndroidSimpleBufferQueueItf buffer_queue, void* instance);
+ // Called from OpenSLES specific audio worker thread.
void ReadBufferQueue();
// Called in Open();
@@ -56,6 +60,10 @@ class OpenSLESInputStream : public AudioInputStream {
// the attached AudioInputCallback::OnError().
void HandleError(SLresult error);
+ base::ThreadChecker thread_checker_;
+
+ base::Lock lock_;
+
AudioManagerAndroid* audio_manager_;
AudioInputCallback* callback_;

Powered by Google App Engine
This is Rietveld 408576698