summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/audio/audio_mixer_cras.h
diff options
context:
space:
mode:
authorpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-03 13:54:17 +0000
committerpastarmovj@chromium.org <pastarmovj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-03 13:54:17 +0000
commitc078f24c5713c1d6156006b187d5bd8ab0b84d88 (patch)
treee997aa9932f5281c62f8d58a72ae54ba9745a555 /chrome/browser/chromeos/audio/audio_mixer_cras.h
parent31dff176c7ee17c4e5e4e39455f2b58f7d659f24 (diff)
downloadchromium_src-c078f24c5713c1d6156006b187d5bd8ab0b84d88.zip
chromium_src-c078f24c5713c1d6156006b187d5bd8ab0b84d88.tar.gz
chromium_src-c078f24c5713c1d6156006b187d5bd8ab0b84d88.tar.bz2
Implement two new policies to control muting the audio I/O.
BUG=chromium-os:11263 TEST=Manually set the policies in CPanel and observe that no sound is produced/recored on the device. TBR=nirnimesh@chromium.org Review URL: https://chromiumcodereview.appspot.com/10873085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/audio/audio_mixer_cras.h')
-rw-r--r--chrome/browser/chromeos/audio/audio_mixer_cras.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/audio/audio_mixer_cras.h b/chrome/browser/chromeos/audio/audio_mixer_cras.h
index ef002ab..5650fb0c 100644
--- a/chrome/browser/chromeos/audio/audio_mixer_cras.h
+++ b/chrome/browser/chromeos/audio/audio_mixer_cras.h
@@ -29,7 +29,13 @@ class AudioMixerCras : public AudioMixer {
virtual double GetVolumePercent() OVERRIDE;
virtual void SetVolumePercent(double percent) OVERRIDE;
virtual bool IsMuted() OVERRIDE;
- virtual void SetMuted(bool muted) OVERRIDE;
+ virtual void SetMuted(bool mute) OVERRIDE;
+ virtual bool IsMuteLocked() OVERRIDE;
+ virtual void SetMuteLocked(bool locked) OVERRIDE;
+ virtual bool IsCaptureMuted() OVERRIDE;
+ virtual void SetCaptureMuted(bool mute) OVERRIDE;
+ virtual bool IsCaptureMuteLocked() OVERRIDE;
+ virtual void SetCaptureMuteLocked(bool locked) OVERRIDE;
private:
// Tries to connect to CRAS. On failure, posts a delayed Connect() task to
@@ -40,6 +46,10 @@ class AudioMixerCras : public AudioMixer {
// |is_muted_|. No-op if not connected.
void ApplyState();
+ // Calls ApplyState on the proper thread only if no other call is currently
+ // pending.
+ void ApplyStateIfNeeded();
+
// Interfaces to the audio server.
struct cras_client *client_;
@@ -53,6 +63,9 @@ class AudioMixerCras : public AudioMixer {
// Most recently-requested muting state.
bool is_muted_;
+ bool is_mute_locked_;
+ bool is_capture_muted_;
+ bool is_capture_mute_locked_;
// Is there already a pending call to ApplyState() scheduled on |thread_|?
bool apply_is_pending_;
@@ -60,7 +73,8 @@ class AudioMixerCras : public AudioMixer {
// Background thread used for interacting with CRAS.
scoped_ptr<base::Thread> thread_;
- // Guards |volume_percent_|, |is_muted_|, and |apply_is_pending_|.
+ // Guards |volume_percent_|, |is_muted_|, |is_mute_locked_|,
+ // |is_capture_muted_|, |is_capture_mute_locked_|, and |apply_is_pending_|.
base::Lock lock_;
DISALLOW_COPY_AND_ASSIGN(AudioMixerCras);