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

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

Issue 93233003: Mute audio when volume is zero on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: henrika@'s comment Created 7 years 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
« no previous file with comments | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | media/audio/android/audio_manager_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cb904166f980f9bfb9eab0a966d8f71cada7e397..5650607ca93fc58db1244f81267a5e85f8dc9fde 100644
--- a/media/audio/android/audio_manager_android.h
+++ b/media/audio/android/audio_manager_android.h
@@ -5,12 +5,17 @@
#ifndef MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_
#define MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_
+#include <set>
+
#include "base/android/jni_android.h"
#include "base/gtest_prod_util.h"
+#include "base/synchronization/lock.h"
#include "media/audio/audio_manager_base.h"
namespace media {
+class OpenSLESOutputStream;
+
// Android implemention of AudioManager.
class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase {
public:
@@ -52,6 +57,8 @@ class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase {
static bool RegisterAudioManager(JNIEnv* env);
+ void SetMute(JNIEnv* env, jobject obj, jboolean muted);
+
protected:
virtual ~AudioManagerAndroid();
@@ -69,12 +76,21 @@ class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase {
int GetAudioLowLatencyOutputFrameSize();
int GetOptimalOutputFrameSize(int sample_rate, int channels);
+ void DoSetMuteOnAudioThread(bool muted);
+
// Allow the AudioAndroidTest to access private methods.
FRIEND_TEST_ALL_PREFIXES(AudioAndroidTest, 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);
};
« no previous file with comments | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | media/audio/android/audio_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698