Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Side by Side Diff: media/audio/alsa/audio_manager_alsa.cc

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: destroy AudioManagerPulse Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "media/audio/alsa/audio_manager_alsa.h" 5 #include "media/audio/alsa/audio_manager_alsa.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // Implementation of AudioManager. 79 // Implementation of AudioManager.
80 bool AudioManagerAlsa::HasAudioOutputDevices() { 80 bool AudioManagerAlsa::HasAudioOutputDevices() {
81 return HasAnyAlsaAudioDevice(kStreamPlayback); 81 return HasAnyAlsaAudioDevice(kStreamPlayback);
82 } 82 }
83 83
84 bool AudioManagerAlsa::HasAudioInputDevices() { 84 bool AudioManagerAlsa::HasAudioInputDevices() {
85 return HasAnyAlsaAudioDevice(kStreamCapture); 85 return HasAnyAlsaAudioDevice(kStreamCapture);
86 } 86 }
87 87
88 AudioManagerAlsa::AudioManagerAlsa(AudioLogFactory* audio_log_factory) 88 AudioManagerAlsa::AudioManagerAlsa(
89 : AudioManagerBase(audio_log_factory), 89 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
90 const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner,
91 AudioLogFactory* audio_log_factory)
92 : AudioManagerBase(task_runner, worker_task_runner, audio_log_factory),
90 wrapper_(new AlsaWrapper()) { 93 wrapper_(new AlsaWrapper()) {
91 SetMaxOutputStreamsAllowed(kMaxOutputStreams); 94 SetMaxOutputStreamsAllowed(kMaxOutputStreams);
92 } 95 }
93 96
94 AudioManagerAlsa::~AudioManagerAlsa() { 97 AudioManagerAlsa::~AudioManagerAlsa() {
95 Shutdown(); 98 Shutdown();
96 } 99 }
97 100
98 void AudioManagerAlsa::ShowAudioInputSettings() { 101 void AudioManagerAlsa::ShowAudioInputSettings() {
99 ShowLinuxAudioInputSettings(); 102 ShowLinuxAudioInputSettings();
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 356 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
354 switches::kAlsaInputDevice)) { 357 switches::kAlsaInputDevice)) {
355 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 358 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
356 switches::kAlsaInputDevice); 359 switches::kAlsaInputDevice);
357 } 360 }
358 361
359 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); 362 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get());
360 } 363 }
361 364
362 } // namespace media 365 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698