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

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

Issue 3192017: Revert 57254 - Share one thread between all AudioOutputControllers instead of... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/linux/alsa_output.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_manager_base.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 AudioManagerBase { 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 bool HasAudioInputDevices();
29 virtual AudioOutputStream* MakeAudioOutputStream(Format format, int channels, 29 virtual AudioOutputStream* MakeAudioOutputStream(Format format, int channels,
30 int sample_rate, 30 int sample_rate,
31 char bits_per_sample); 31 char bits_per_sample);
32 virtual AudioInputStream* MakeAudioInputStream(Format format, int channels, 32 virtual AudioInputStream* MakeAudioInputStream(Format format, int channels,
33 int sample_rate, 33 int sample_rate,
34 char bits_per_sample, 34 char bits_per_sample,
35 uint32 samples_per_packet); 35 uint32 samples_per_packet);
36 virtual void MuteAll(); 36 virtual void MuteAll();
37 virtual void UnMuteAll(); 37 virtual void UnMuteAll();
38 38
39 virtual void ReleaseOutputStream(AlsaPcmOutputStream* stream); 39 virtual void ReleaseOutputStream(AlsaPcmOutputStream* stream);
40 40
41 protected: 41 protected:
42 // Friend function for invoking the destructor at exit. 42 // Friend function for invoking the destructor at exit.
43 friend void DestroyAudioManagerLinux(void*); 43 friend void DestroyAudioManagerLinux(void*);
44 virtual ~AudioManagerLinux(); 44 virtual ~AudioManagerLinux();
45 45
46 private: 46 private:
47 // Thread used to interact with AudioOutputStreams created by this
48 // audio manger.
49 base::Thread audio_thread_;
47 scoped_ptr<AlsaWrapper> wrapper_; 50 scoped_ptr<AlsaWrapper> wrapper_;
48 51
49 Lock lock_; 52 Lock lock_;
50 std::map<AlsaPcmOutputStream*, scoped_refptr<AlsaPcmOutputStream> > 53 std::map<AlsaPcmOutputStream*, scoped_refptr<AlsaPcmOutputStream> >
51 active_streams_; 54 active_streams_;
52 55
56 bool initialized_;
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.cc ('k') | media/audio/linux/audio_manager_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698