| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 virtual bool IsMuted() override; |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 // Logs the error and invokes any registered callbacks. | 55 // Logs the error and invokes any registered callbacks. |
| 55 void HandleError(const char* method, int error); | 56 void HandleError(const char* method, int error); |
| 56 | 57 |
| 57 // Reads one or more buffers of audio from the device, passes on to the | 58 // Reads one or more buffers of audio from the device, passes on to the |
| 58 // registered callback and schedules the next read. | 59 // registered callback and schedules the next read. |
| 59 void ReadAudio(); | 60 void ReadAudio(); |
| 60 | 61 |
| 61 // Recovers from any device errors if possible. | 62 // Recovers from any device errors if possible. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 86 | 87 |
| 87 // NOTE: Weak pointers must be invalidated before all other member variables. | 88 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 88 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; | 89 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; |
| 89 | 90 |
| 90 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); | 91 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace media | 94 } // namespace media |
| 94 | 95 |
| 95 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ | 96 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ |
| OLD | NEW |