| 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 ac67d08603f2035b0fd7047b0bee53f543ba9a5b..7834534302092faca282ac4f5bb28ad1f37c8cff 100644
|
| --- a/media/audio/android/audio_manager_android.h
|
| +++ b/media/audio/android/audio_manager_android.h
|
| @@ -9,7 +9,9 @@
|
|
|
| #include "base/android/jni_android.h"
|
| #include "base/gtest_prod_util.h"
|
| +#include "base/message_loop/message_loop.h"
|
| #include "base/synchronization/lock.h"
|
| +#include "base/synchronization/waitable_event.h"
|
| #include "media/audio/audio_manager_base.h"
|
|
|
| namespace media {
|
| @@ -17,7 +19,9 @@ namespace media {
|
| class OpenSLESOutputStream;
|
|
|
| // Android implemention of AudioManager.
|
| -class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase {
|
| +class MEDIA_EXPORT AudioManagerAndroid
|
| + : public AudioManagerBase,
|
| + public base::MessageLoop::DestructionObserver {
|
| public:
|
| AudioManagerAndroid(AudioLogFactory* audio_log_factory);
|
|
|
| @@ -65,7 +69,13 @@ class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase {
|
| const AudioParameters& input_params) OVERRIDE;
|
|
|
| private:
|
| - bool HadNoAudioStreams();
|
| + // Implementation of MessageLoop::DestructionObserver.
|
| + virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
|
| +
|
| + void CreateAndInitOnAudioThread();
|
| + void CloseOnAudioThread();
|
| +
|
| + bool HasNoAudioStreams();
|
| void Init();
|
| void Close();
|
| void SetCommunicationAudioModeOn(bool on);
|
| @@ -77,18 +87,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_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid);
|
| };
|
|
|