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

Side by Side Diff: media/audio/linux/audio_manager_linux.h

Issue 2966005: Add recording capability to AudioManager, and implemented on windows using the WaveIn APIs. (Closed)
Patch Set: Patch Created 10 years, 5 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 unified diff | Download patch
« no previous file with comments | « media/audio/linux/alsa_output_unittest.cc ('k') | media/audio/linux/audio_manager_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_ 5 #ifndef MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_
6 #define MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_ 6 #define MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/lock.h" 10 #include "base/lock.h"
11 #include "base/ref_counted.h" 11 #include "base/ref_counted.h"
12 #include "base/scoped_ptr.h" 12 #include "base/scoped_ptr.h"
13 #include "base/thread.h" 13 #include "base/thread.h"
14 #include "media/audio/audio_io.h" 14 #include "media/audio/audio_io.h"
15 15
16 class AlsaPcmOutputStream; 16 class AlsaPcmOutputStream;
17 class AlsaWrapper; 17 class AlsaWrapper;
18 18
19 class AudioManagerLinux : public AudioManager { 19 class AudioManagerLinux : public AudioManager {
20 public: 20 public:
21 AudioManagerLinux(); 21 AudioManagerLinux();
22 22
23 // Call before using a newly created AudioManagerLinux instance. 23 // Call before using a newly created AudioManagerLinux instance.
24 virtual void Init(); 24 virtual void Init();
25 25
26 // Implementation of AudioManager. 26 // Implementation of AudioManager.
27 virtual bool HasAudioOutputDevices(); 27 virtual bool HasAudioOutputDevices();
28 virtual bool HasAudioInputDevices();
28 virtual AudioOutputStream* MakeAudioOutputStream(Format format, int channels, 29 virtual AudioOutputStream* MakeAudioOutputStream(Format format, int channels,
29 int sample_rate, 30 int sample_rate,
30 char bits_per_sample); 31 char bits_per_sample);
32 virtual AudioInputStream* MakeAudioInputStream(Format format, int channels,
33 int sample_rate,
34 char bits_per_sample,
35 uint32 samples_per_packet);
31 virtual void MuteAll(); 36 virtual void MuteAll();
32 virtual void UnMuteAll(); 37 virtual void UnMuteAll();
33 38
34 virtual void ReleaseOutputStream(AlsaPcmOutputStream* stream); 39 virtual void ReleaseOutputStream(AlsaPcmOutputStream* stream);
35 40
36 protected: 41 protected:
37 // Friend function for invoking the destructor at exit. 42 // Friend function for invoking the destructor at exit.
38 friend void DestroyAudioManagerLinux(void*); 43 friend void DestroyAudioManagerLinux(void*);
39 virtual ~AudioManagerLinux(); 44 virtual ~AudioManagerLinux();
40 45
41 private: 46 private:
42 // Thread used to interact with AudioOutputStreams created by this 47 // Thread used to interact with AudioOutputStreams created by this
43 // audio manger. 48 // audio manger.
44 base::Thread audio_thread_; 49 base::Thread audio_thread_;
45 scoped_ptr<AlsaWrapper> wrapper_; 50 scoped_ptr<AlsaWrapper> wrapper_;
46 51
47 Lock lock_; 52 Lock lock_;
48 std::map<AlsaPcmOutputStream*, scoped_refptr<AlsaPcmOutputStream> > 53 std::map<AlsaPcmOutputStream*, scoped_refptr<AlsaPcmOutputStream> >
49 active_streams_; 54 active_streams_;
50 55
51 bool initialized_; 56 bool initialized_;
52 57
53 DISALLOW_COPY_AND_ASSIGN(AudioManagerLinux); 58 DISALLOW_COPY_AND_ASSIGN(AudioManagerLinux);
54 }; 59 };
55 60
56 #endif // MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_ 61 #endif // MEDIA_AUDIO_LINUX_AUDIO_MANAGER_LINUX_H_
OLDNEW
« no previous file with comments | « media/audio/linux/alsa_output_unittest.cc ('k') | media/audio/linux/audio_manager_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698