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

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

Issue 131503006: Initialization of audio manager for Android is now done on the audio thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restored DCHECKs and disabled unit test in content_unittessts instead Created 6 years, 10 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/audio_manager_android.h
diff --git a/media/audio/android/audio_manager_android.h b/media/audio/android/audio_manager_android.h
index b65e5934cf59cce1b18869c70eddb96e3fe7e92e..ee5ad28e36e46e33e069554301f671fe178d8847 100644
--- a/media/audio/android/audio_manager_android.h
+++ b/media/audio/android/audio_manager_android.h
@@ -10,6 +10,7 @@
#include "base/android/jni_android.h"
#include "base/gtest_prod_util.h"
#include "base/synchronization/lock.h"
+#include "base/synchronization/waitable_event.h"
#include "media/audio/audio_manager_base.h"
namespace media {
@@ -65,9 +66,10 @@ class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase {
const AudioParameters& input_params) OVERRIDE;
private:
+ void InitializeOnAudioThread();
+ void ShutdownOnAudioThread();
+
bool HasNoAudioInputStreams();
- void Init();
- void Close();
void SetCommunicationAudioModeOn(bool on);
bool SetAudioDevice(const std::string& device_id);
int GetNativeOutputSampleRate();
@@ -77,18 +79,11 @@ class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase {
void DoSetMuteOnAudioThread(bool muted);
- // Allow the AudioAndroidTest to access private methods.
- FRIEND_TEST_ALL_PREFIXES(AudioAndroidOutputTest, IsAudioLowLatencySupported);
-
// Java AudioManager instance.
base::android::ScopedJavaGlobalRef<jobject> j_audio_manager_;
typedef std::set<OpenSLESOutputStream*> OutputStreams;
OutputStreams streams_;
- // TODO(wjia): remove this lock once unit test modules are fixed to call
- // AudioManager::MakeAudioOutputStream on the audio thread. For now, this
- // lock is used to guard access to |streams_|.
- base::Lock streams_lock_;
// Enabled when first input stream is created and set to false when last
// input stream is destroyed. Also affects the stream type of output streams.

Powered by Google App Engine
This is Rietveld 408576698