summaryrefslogtreecommitdiffstats
path: root/media/audio/linux/audio_manager_linux.h
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 05:42:08 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 05:42:08 +0000
commitfe24ccff145ec31f31b3504419440f1639581862 (patch)
treeaa0e8cc602324d4760949f00f3ac684b6680d551 /media/audio/linux/audio_manager_linux.h
parent03269cf96713c7b44cf7fe1f8241d0b2e33a7ab6 (diff)
downloadchromium_src-fe24ccff145ec31f31b3504419440f1639581862.zip
chromium_src-fe24ccff145ec31f31b3504419440f1639581862.tar.gz
chromium_src-fe24ccff145ec31f31b3504419440f1639581862.tar.bz2
This iteration creates one message loop per audio output stream that is responsible for buffering data from the data source, and writing the buffers to the output device. This design blocks while waiting for data to be retrieved from the data source, which can lead to unnecessary buffer underruns in the audio device. This will be solved later after the non-blocking AudioSource interface is written.
Review URL: http://codereview.chromium.org/115276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/linux/audio_manager_linux.h')
-rw-r--r--media/audio/linux/audio_manager_linux.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/media/audio/linux/audio_manager_linux.h b/media/audio/linux/audio_manager_linux.h
new file mode 100644
index 0000000..5b369a1
--- /dev/null
+++ b/media/audio/linux/audio_manager_linux.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2009 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.
+
+#ifndef MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_
+#define MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_
+
+#include "base/thread.h"
+#include "media/audio/audio_output.h"
+
+class AudioManagerLinux : public AudioManager {
+ public:
+ AudioManagerLinux();
+
+ // Implementation of AudioManager.
+ virtual bool HasAudioDevices();
+ virtual AudioOutputStream* MakeAudioStream(Format format, int channels,
+ int sample_rate,
+ char bits_per_sample);
+ virtual void MuteAll();
+ virtual void UnMuteAll();
+ virtual const void* GetLastMockBuffer();
+
+ private:
+ // Friend function for invoking the private destructor at exit.
+ friend void DestroyAudioManagerLinux(void*);
+ virtual ~AudioManagerLinux();
+
+ DISALLOW_COPY_AND_ASSIGN(AudioManagerLinux);
+};
+
+#endif // MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_