| Index: media/audio/openbsd/audio_manager_openbsd.cc
|
| diff --git a/media/audio/openbsd/audio_manager_openbsd.cc b/media/audio/openbsd/audio_manager_openbsd.cc
|
| index 7222748b39bc45eac4c66754835ee53a5bce7f6c..cefb9bb166cc7e1a4ab1ce4de9d3e8a032a078f5 100644
|
| --- a/media/audio/openbsd/audio_manager_openbsd.cc
|
| +++ b/media/audio/openbsd/audio_manager_openbsd.cc
|
| @@ -7,8 +7,6 @@
|
| #include "base/command_line.h"
|
| #include "base/stl_util.h"
|
| #include "media/audio/audio_output_dispatcher.h"
|
| -#include "media/audio/fake_audio_input_stream.h"
|
| -#include "media/audio/fake_audio_output_stream.h"
|
| #if defined(USE_PULSEAUDIO)
|
| #include "media/audio/pulse/pulse_output.h"
|
| #endif
|
| @@ -18,7 +16,7 @@
|
| #include <fcntl.h>
|
|
|
| // Maximum number of output streams that can be open simultaneously.
|
| -static const size_t kMaxOutputStreams = 50;
|
| +static const int kMaxOutputStreams = 50;
|
|
|
| // Implementation of AudioManager.
|
| static bool HasAudioHardware() {
|
| @@ -43,42 +41,6 @@ bool AudioManagerOpenBSD::HasAudioInputDevices() {
|
| return HasAudioHardware();
|
| }
|
|
|
| -AudioOutputStream* AudioManagerOpenBSD::MakeAudioOutputStream(
|
| - const AudioParameters& params) {
|
| - // Early return for testing hook. Do this before checking for
|
| - // |initialized_|.
|
| - if (params.format == AudioParameters::AUDIO_MOCK) {
|
| - return FakeAudioOutputStream::MakeFakeStream(params);
|
| - }
|
| -
|
| - if (!initialized()) {
|
| - return NULL;
|
| - }
|
| -
|
| - // Don't allow opening more than |kMaxOutputStreams| streams.
|
| - if (active_streams_.size() >= kMaxOutputStreams) {
|
| - return NULL;
|
| - }
|
| -
|
| - AudioOutputStream* stream;
|
| -#if defined(USE_PULSEAUDIO)
|
| - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) {
|
| - stream = new PulseAudioOutputStream(params, this);
|
| - active_streams_.insert(stream);
|
| - return stream;
|
| - }
|
| -#endif
|
| -
|
| - NOTIMPLEMENTED();
|
| - return NULL;
|
| -}
|
| -
|
| -AudioInputStream* AudioManagerOpenBSD::MakeAudioInputStream(
|
| - const AudioParameters& params, const std::string& device_id) {
|
| - NOTIMPLEMENTED();
|
| - return NULL;
|
| -}
|
| -
|
| AudioManagerOpenBSD::AudioManagerOpenBSD() {
|
| }
|
|
|
| @@ -92,10 +54,6 @@ AudioManagerOpenBSD::~AudioManagerOpenBSD() {
|
|
|
| // Free output dispatchers, closing all remaining open streams.
|
| output_dispatchers_.clear();
|
| -
|
| - // Delete all the streams. Have to do it manually, we don't have ScopedSet<>,
|
| - // and we are not using ScopedVector<> because search there is slow.
|
| - STLDeleteElements(&active_streams_);
|
| }
|
|
|
| void AudioManagerOpenBSD::Init() {
|
| @@ -110,11 +68,50 @@ void AudioManagerOpenBSD::UnMuteAll() {
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| -void AudioManagerOpenBSD::ReleaseOutputStream(AudioOutputStream* stream) {
|
| - if (stream) {
|
| - active_streams_.erase(stream);
|
| - delete stream;
|
| +int AudioManagerOpenBSD::GetMaxAudioOutputStreamsAllowed() {
|
| + return kMaxOutputStreams;
|
| +}
|
| +
|
| +AudioOutputStream* AudioManagerOpenBSD::MakeAudioLinearOutputStream(
|
| + const AudioParameters& params) {
|
| + DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format);
|
| + return MakeOutputStream(params);
|
| +}
|
| +
|
| +AudioOutputStream* AudioManagerOpenBSD::MakeAudioLowLatencyOutputStream(
|
| + const AudioParameters& params) {
|
| + DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format);
|
| + return MakeOutputStream(params);
|
| +}
|
| +
|
| +AudioInputStream* AudioManagerOpenBSD::MakeAudioLinearInputStream(
|
| + const AudioParameters& params, const std::string& device_id) {
|
| + DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format);
|
| + NOTIMPLEMENTED();
|
| + return NULL;
|
| +}
|
| +
|
| +AudioInputStream* AudioManagerOpenBSD::MakeAudioLowLatencyInputStream(
|
| + const AudioParameters& params, const std::string& device_id) {
|
| + DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format);
|
| + NOTIMPLEMENTED();
|
| + return NULL;
|
| +}
|
| +
|
| +AudioOutputStream* AudioManagerOpenBSD::MakeOutputStream(
|
| + const AudioParameters& params) {
|
| + if (!initialized()) {
|
| + return NULL;
|
| }
|
| +
|
| +#if defined(USE_PULSEAUDIO)
|
| + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) {
|
| + return new PulseAudioOutputStream(params, this);
|
| + }
|
| +#endif
|
| +
|
| + NOTIMPLEMENTED();
|
| + return NULL;
|
| }
|
|
|
| // static
|
|
|