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

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: speculative hack to fix test timeouts Created 4 years, 8 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // Implementation of AudioManager. 80 // Implementation of AudioManager.
81 bool AudioManagerAlsa::HasAudioOutputDevices() { 81 bool AudioManagerAlsa::HasAudioOutputDevices() {
82 return HasAnyAlsaAudioDevice(kStreamPlayback); 82 return HasAnyAlsaAudioDevice(kStreamPlayback);
83 } 83 }
84 84
85 bool AudioManagerAlsa::HasAudioInputDevices() { 85 bool AudioManagerAlsa::HasAudioInputDevices() {
86 return HasAnyAlsaAudioDevice(kStreamCapture); 86 return HasAnyAlsaAudioDevice(kStreamCapture);
87 } 87 }
88 88
89 AudioManagerAlsa::AudioManagerAlsa(AudioLogFactory* audio_log_factory) 89 AudioManagerAlsa::AudioManagerAlsa(
90 : AudioManagerBase(audio_log_factory), 90 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
91 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
92 AudioLogFactory* audio_log_factory)
93 : AudioManagerBase(std::move(task_runner),
94 std::move(worker_task_runner),
95 audio_log_factory),
91 wrapper_(new AlsaWrapper()) { 96 wrapper_(new AlsaWrapper()) {
92 SetMaxOutputStreamsAllowed(kMaxOutputStreams); 97 SetMaxOutputStreamsAllowed(kMaxOutputStreams);
93 } 98 }
94 99
95 AudioManagerAlsa::~AudioManagerAlsa() { 100 AudioManagerAlsa::~AudioManagerAlsa() {}
96 Shutdown();
97 }
98 101
99 void AudioManagerAlsa::ShowAudioInputSettings() { 102 void AudioManagerAlsa::ShowAudioInputSettings() {
100 ShowLinuxAudioInputSettings(); 103 ShowLinuxAudioInputSettings();
101 } 104 }
102 105
103 void AudioManagerAlsa::GetAudioInputDeviceNames( 106 void AudioManagerAlsa::GetAudioInputDeviceNames(
104 AudioDeviceNames* device_names) { 107 AudioDeviceNames* device_names) {
105 DCHECK(device_names->empty()); 108 DCHECK(device_names->empty());
106 GetAlsaAudioDevices(kStreamCapture, device_names); 109 GetAlsaAudioDevices(kStreamCapture, device_names);
107 } 110 }
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 357 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
355 switches::kAlsaInputDevice)) { 358 switches::kAlsaInputDevice)) {
356 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 359 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
357 switches::kAlsaInputDevice); 360 switches::kAlsaInputDevice);
358 } 361 }
359 362
360 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); 363 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get());
361 } 364 }
362 365
363 } // namespace media 366 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698