// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Creates an audio output stream based on the PulseAudio asynchronous API; // specifically using the pa_threaded_mainloop model. // // If the stream is successfully opened, Close() must be called before the // stream is deleted as Close() is responsible for ensuring resource cleanup // occurs. // // This object is designed so that all AudioOutputStream methods will be called // on the same thread that created the object. // // WARNING: This object blocks on internal PulseAudio calls in Open() while // waiting for PulseAudio's context structure to be ready. It also blocks in // inside PulseAudio in Start() and repeated during playback, waiting for // PulseAudio write callbacks to occur. #ifndef MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ #define MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ #include <stddef.h> #include <memory> #include <string> #include "base/memory/raw_ptr.h" #include "base/threading/thread_checker.h" #include "media/audio/audio_io.h" #include "media/audio/audio_manager.h" #include "media/base/amplitude_peak_detector.h" #include "media/base/audio_parameters.h" struct pa_context; struct pa_stream; struct pa_threaded_mainloop; namespace media { class AudioManagerBase; class PulseAudioOutputStream : public AudioOutputStream { … }; } // namespace media #endif // MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_