OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ALSA_INPUT_H_ | 5 #ifndef MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ |
6 #define MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ | 6 #define MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ |
7 | 7 |
8 #include <alsa/asoundlib.h> | 8 #include <alsa/asoundlib.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 16 matching lines...) Expand all Loading... |
27 // of the audio recording device. | 27 // of the audio recording device. |
28 static const char* kAutoSelectDevice; | 28 static const char* kAutoSelectDevice; |
29 | 29 |
30 // Create a PCM Output stream for the ALSA device identified by | 30 // Create a PCM Output stream for the ALSA device identified by |
31 // |device_name|. If unsure of what to use for |device_name|, use | 31 // |device_name|. If unsure of what to use for |device_name|, use |
32 // |kAutoSelectDevice|. | 32 // |kAutoSelectDevice|. |
33 AlsaPcmInputStream(AudioManagerLinux* audio_manager, | 33 AlsaPcmInputStream(AudioManagerLinux* audio_manager, |
34 const std::string& device_name, | 34 const std::string& device_name, |
35 const AudioParameters& params, | 35 const AudioParameters& params, |
36 AlsaWrapper* wrapper); | 36 AlsaWrapper* wrapper); |
| 37 |
37 virtual ~AlsaPcmInputStream(); | 38 virtual ~AlsaPcmInputStream(); |
38 | 39 |
39 // Implementation of AudioInputStream. | 40 // Implementation of AudioInputStream. |
40 virtual bool Open() OVERRIDE; | 41 virtual bool Open() OVERRIDE; |
41 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 42 virtual void Start(AudioInputCallback* callback) OVERRIDE; |
42 virtual void Stop() OVERRIDE; | 43 virtual void Stop() OVERRIDE; |
43 virtual void Close() OVERRIDE; | 44 virtual void Close() OVERRIDE; |
44 virtual double GetMaxVolume() OVERRIDE; | 45 virtual double GetMaxVolume() OVERRIDE; |
45 virtual void SetVolume(double volume) OVERRIDE; | 46 virtual void SetVolume(double volume) OVERRIDE; |
46 virtual double GetVolume() OVERRIDE; | 47 virtual double GetVolume() OVERRIDE; |
(...skipping 29 matching lines...) Expand all Loading... |
76 snd_mixer_t* mixer_handle_; // Handle to the ALSA microphone mixer. | 77 snd_mixer_t* mixer_handle_; // Handle to the ALSA microphone mixer. |
77 snd_mixer_elem_t* mixer_element_handle_; // Handle to the capture element. | 78 snd_mixer_elem_t* mixer_element_handle_; // Handle to the capture element. |
78 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; | 79 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; |
79 scoped_array<uint8> audio_packet_; // Buffer used for reading audio data. | 80 scoped_array<uint8> audio_packet_; // Buffer used for reading audio data. |
80 bool read_callback_behind_schedule_; | 81 bool read_callback_behind_schedule_; |
81 | 82 |
82 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); | 83 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); |
83 }; | 84 }; |
84 | 85 |
85 #endif // MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ | 86 #endif // MEDIA_AUDIO_LINUX_ALSA_INPUT_H_ |
OLD | NEW |