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

Unified Diff: media/audio/audio_manager_base.h

Issue 9570014: Move some generic functions to AudioManagerBase to be inherited by platform-specific AudioManager*** (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/audio_manager_base.h
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index 7f42ea70d81a7c4c9fd1d43bfff192eb6ba36191..9fbc5821ef5b4eef8128de44a1cdafe3f28ad78f 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -38,8 +38,14 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
virtual bool CanShowAudioInputSettings() OVERRIDE;
virtual void ShowAudioInputSettings() OVERRIDE;
- virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names)
- OVERRIDE;
+ virtual void GetAudioInputDeviceNames(
+ media::AudioDeviceNames* device_names) OVERRIDE;
+
+ virtual AudioOutputStream* MakeAudioOutputStream(
+ const AudioParameters& params) OVERRIDE;
+
+ virtual AudioInputStream* MakeAudioInputStream(
+ const AudioParameters& params, const std::string& device_id) OVERRIDE;
virtual AudioOutputStream* MakeAudioOutputStreamProxy(
const AudioParameters& params) OVERRIDE;
@@ -49,11 +55,31 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
void IncreaseActiveInputStreamCount();
void DecreaseActiveInputStreamCount();
+ // Called internally by the audio stream when it has been closed.
+ virtual void ReleaseOutputStream(AudioOutputStream* stream);
+ virtual void ReleaseInputStream(AudioInputStream* stream);
+
// Shuts down the audio thread and releases all the audio output dispatchers
// on the audio thread. All AudioOutputProxy instances should be freed before
// Shutdown is called.
void Shutdown();
+ // Returns the platform specific number of audio streams allowed. This is a
+ // practical limit to prevent failure caused by too many audio streams opened.
+ virtual int GetMaxAudioOutputStreamsAllowed() = 0;
+
+ virtual AudioOutputStream* MakeAudioLinearOutputStream(
+ const AudioParameters& params) = 0;
+
+ virtual AudioOutputStream* MakeAudioLowLatencyOutputStream(
+ const AudioParameters& params) = 0;
+
+ virtual AudioInputStream* MakeAudioLinearInputStream(
+ const AudioParameters& params, const std::string& device_id) = 0;
+
+ virtual AudioInputStream* MakeAudioLowLatencyInputStream(
+ const AudioParameters& params, const std::string& device_id) = 0;
+
protected:
AudioManagerBase();
@@ -76,6 +102,9 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
// is currently recording in Chrome.
base::AtomicRefCount num_active_input_streams_;
+ // Number of currently open output streams.
+ int num_output_streams_;
+
DISALLOW_COPY_AND_ASSIGN(AudioManagerBase);
};

Powered by Google App Engine
This is Rietveld 408576698