diff options
author | leandrogracia@chromium.org <leandrogracia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-13 18:38:58 +0000 |
---|---|---|
committer | leandrogracia@chromium.org <leandrogracia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-13 18:38:58 +0000 |
commit | beb0f37738b9c0a18a17621124d61cf508941fc9 (patch) | |
tree | 8aa576aab16620d3bbba1cbf80eb760cf3efcb8e /media/audio/mac | |
parent | e6d876e110a8e90d6918a44fafb99914288102ab (diff) | |
download | chromium_src-beb0f37738b9c0a18a17621124d61cf508941fc9.zip chromium_src-beb0f37738b9c0a18a17621124d61cf508941fc9.tar.gz chromium_src-beb0f37738b9c0a18a17621124d61cf508941fc9.tar.bz2 |
Add a method to the audio manager to find out if recording is currently active in Chrome.
Adding also missing OVERRIDEs in the affected files.
BUG=97388
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=105333
Review URL: http://codereview.chromium.org/8208013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105337 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/mac')
-rw-r--r-- | media/audio/mac/audio_input_mac.cc | 6 | ||||
-rw-r--r-- | media/audio/mac/audio_input_mac.h | 11 | ||||
-rw-r--r-- | media/audio/mac/audio_manager_mac.h | 18 |
3 files changed, 22 insertions, 13 deletions
diff --git a/media/audio/mac/audio_input_mac.cc b/media/audio/mac/audio_input_mac.cc index e96277f..c59eb61 100644 --- a/media/audio/mac/audio_input_mac.cc +++ b/media/audio/mac/audio_input_mac.cc @@ -70,11 +70,17 @@ void PCMQueueInAudioInputStream::Start(AudioInputCallback* callback) { OSStatus err = AudioQueueStart(audio_queue_, NULL); if (err != noErr) HandleError(err); + else + manager_->IncreaseActiveInputStreamCount(); } void PCMQueueInAudioInputStream::Stop() { if (!audio_queue_) return; + // Stop is always called before Close. In case of error, this will be + // also called when closing the input controller. + manager_->DecreaseActiveInputStreamCount(); + // We request a synchronous stop, so the next call can take some time. In // the windows implementation we block here as well. OSStatus err = AudioQueueStop(audio_queue_, true); diff --git a/media/audio/mac/audio_input_mac.h b/media/audio/mac/audio_input_mac.h index 1796d82..7569c36 100644 --- a/media/audio/mac/audio_input_mac.h +++ b/media/audio/mac/audio_input_mac.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,7 @@ #include <AudioToolbox/AudioQueue.h> #include <AudioToolbox/AudioFormat.h> +#include "base/compiler_specific.h" #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" @@ -23,10 +24,10 @@ class PCMQueueInAudioInputStream : public AudioInputStream { virtual ~PCMQueueInAudioInputStream(); // Implementation of AudioInputStream. - virtual bool Open(); - virtual void Start(AudioInputCallback* callback); - virtual void Stop(); - virtual void Close(); + virtual bool Open() OVERRIDE; + virtual void Start(AudioInputCallback* callback) OVERRIDE; + virtual void Stop() OVERRIDE; + virtual void Close() OVERRIDE; private: // Issue the OnError to |callback_|; diff --git a/media/audio/mac/audio_manager_mac.h b/media/audio/mac/audio_manager_mac.h index a8ffced..b7c29bc 100644 --- a/media/audio/mac/audio_manager_mac.h +++ b/media/audio/mac/audio_manager_mac.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,7 @@ #define MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ #include "base/basictypes.h" +#include "base/compiler_specific.h" #include "media/audio/audio_manager_base.h" class PCMQueueInAudioInputStream; @@ -19,15 +20,16 @@ class AudioManagerMac : public AudioManagerBase { AudioManagerMac(); // Implementation of AudioManager. - virtual bool HasAudioOutputDevices(); - virtual bool HasAudioInputDevices(); - virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names); + virtual bool HasAudioOutputDevices() OVERRIDE; + virtual bool HasAudioInputDevices() OVERRIDE; + virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) + OVERRIDE; virtual AudioOutputStream* MakeAudioOutputStream( - const AudioParameters& params); + const AudioParameters& params) OVERRIDE; virtual AudioInputStream* MakeAudioInputStream( - const AudioParameters& params); - virtual void MuteAll(); - virtual void UnMuteAll(); + const AudioParameters& params) OVERRIDE; + virtual void MuteAll() OVERRIDE; + virtual void UnMuteAll() OVERRIDE; // Mac-only method to free the streams created by above facoty methods. // They are called internally by the respective audio stream when it has |