OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ALSA_ALSA_INPUT_H_ | 5 #ifndef MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ |
6 #define MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ | 6 #define MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ |
7 | 7 |
8 #include <alsa/asoundlib.h> | 8 #include <alsa/asoundlib.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 24 matching lines...) Expand all Loading... |
35 // |device_name|. If unsure of what to use for |device_name|, use | 35 // |device_name|. If unsure of what to use for |device_name|, use |
36 // |kAutoSelectDevice|. | 36 // |kAutoSelectDevice|. |
37 AlsaPcmInputStream(AudioManagerBase* audio_manager, | 37 AlsaPcmInputStream(AudioManagerBase* audio_manager, |
38 const std::string& device_name, | 38 const std::string& device_name, |
39 const AudioParameters& params, | 39 const AudioParameters& params, |
40 AlsaWrapper* wrapper); | 40 AlsaWrapper* wrapper); |
41 | 41 |
42 virtual ~AlsaPcmInputStream(); | 42 virtual ~AlsaPcmInputStream(); |
43 | 43 |
44 // Implementation of AudioInputStream. | 44 // Implementation of AudioInputStream. |
45 virtual bool Open() OVERRIDE; | 45 virtual bool Open() override; |
46 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 46 virtual void Start(AudioInputCallback* callback) override; |
47 virtual void Stop() OVERRIDE; | 47 virtual void Stop() override; |
48 virtual void Close() OVERRIDE; | 48 virtual void Close() override; |
49 virtual double GetMaxVolume() OVERRIDE; | 49 virtual double GetMaxVolume() override; |
50 virtual void SetVolume(double volume) OVERRIDE; | 50 virtual void SetVolume(double volume) override; |
51 virtual double GetVolume() OVERRIDE; | 51 virtual double GetVolume() override; |
52 | 52 |
53 private: | 53 private: |
54 // Logs the error and invokes any registered callbacks. | 54 // Logs the error and invokes any registered callbacks. |
55 void HandleError(const char* method, int error); | 55 void HandleError(const char* method, int error); |
56 | 56 |
57 // Reads one or more buffers of audio from the device, passes on to the | 57 // Reads one or more buffers of audio from the device, passes on to the |
58 // registered callback and schedules the next read. | 58 // registered callback and schedules the next read. |
59 void ReadAudio(); | 59 void ReadAudio(); |
60 | 60 |
61 // Recovers from any device errors if possible. | 61 // Recovers from any device errors if possible. |
(...skipping 24 matching lines...) Expand all Loading... |
86 | 86 |
87 // NOTE: Weak pointers must be invalidated before all other member variables. | 87 // NOTE: Weak pointers must be invalidated before all other member variables. |
88 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; | 88 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); | 90 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace media | 93 } // namespace media |
94 | 94 |
95 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ | 95 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ |
OLD | NEW |