| 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 // Creates an audio output stream based on the PulseAudio asynchronous API; | 5 // Creates an audio output stream based on the PulseAudio asynchronous API; |
| 6 // specifically using the pa_threaded_mainloop model. | 6 // specifically using the pa_threaded_mainloop model. |
| 7 // | 7 // |
| 8 // If the stream is successfully opened, Close() must be called before the | 8 // If the stream is successfully opened, Close() must be called before the |
| 9 // stream is deleted as Close() is responsible for ensuring resource cleanup | 9 // stream is deleted as Close() is responsible for ensuring resource cleanup |
| 10 // occurs. | 10 // occurs. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 ~PulseAudioOutputStream() override; | 46 ~PulseAudioOutputStream() override; |
| 47 | 47 |
| 48 // Implementation of AudioOutputStream. | 48 // Implementation of AudioOutputStream. |
| 49 bool Open() override; | 49 bool Open() override; |
| 50 void Close() override; | 50 void Close() override; |
| 51 void Start(AudioSourceCallback* callback) override; | 51 void Start(AudioSourceCallback* callback) override; |
| 52 void Stop() override; | 52 void Stop() override; |
| 53 void SetVolume(double volume) override; | 53 void SetVolume(double volume) override; |
| 54 void GetVolume(double* volume) override; | 54 void GetVolume(double* volume) override; |
| 55 void EnableDebugRecording(const base::FilePath& file_name) override; |
| 56 void DisableDebugRecording() override; |
| 55 | 57 |
| 56 private: | 58 private: |
| 57 // Called by PulseAudio when |pa_stream_| change state. If an unexpected | 59 // Called by PulseAudio when |pa_stream_| change state. If an unexpected |
| 58 // failure state change happens and |source_callback_| is set | 60 // failure state change happens and |source_callback_| is set |
| 59 // this method will forward the error via OnError(). | 61 // this method will forward the error via OnError(). |
| 60 static void StreamNotifyCallback(pa_stream* s, void* p_this); | 62 static void StreamNotifyCallback(pa_stream* s, void* p_this); |
| 61 | 63 |
| 62 // Called by PulseAudio when it needs more audio data. | 64 // Called by PulseAudio when it needs more audio data. |
| 63 static void StreamRequestCallback(pa_stream* s, size_t len, void* p_this); | 65 static void StreamRequestCallback(pa_stream* s, size_t len, void* p_this); |
| 64 | 66 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 94 std::unique_ptr<AudioBus> audio_bus_; | 96 std::unique_ptr<AudioBus> audio_bus_; |
| 95 | 97 |
| 96 base::ThreadChecker thread_checker_; | 98 base::ThreadChecker thread_checker_; |
| 97 | 99 |
| 98 DISALLOW_COPY_AND_ASSIGN(PulseAudioOutputStream); | 100 DISALLOW_COPY_AND_ASSIGN(PulseAudioOutputStream); |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 } // namespace media | 103 } // namespace media |
| 102 | 104 |
| 103 #endif // MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ | 105 #endif // MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ |
| OLD | NEW |