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

Side by Side Diff: media/audio/linux/audio_manager_linux.cc

Issue 9655018: Make AudioParameters a class instead of a struct (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright years Created 8 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/linux/alsa_output_unittest.cc ('k') | media/audio/mac/audio_input_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "media/audio/linux/audio_manager_linux.h" 5 #include "media/audio/linux/audio_manager_linux.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/nix/xdg_util.h" 10 #include "base/nix/xdg_util.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: " 231 DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: "
232 << wrapper_->StrError(error); 232 << wrapper_->StrError(error);
233 } 233 }
234 } 234 }
235 235
236 return has_device; 236 return has_device;
237 } 237 }
238 238
239 AudioOutputStream* AudioManagerLinux::MakeLinearOutputStream( 239 AudioOutputStream* AudioManagerLinux::MakeLinearOutputStream(
240 const AudioParameters& params) { 240 const AudioParameters& params) {
241 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format); 241 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
242 return MakeOutputStream(params); 242 return MakeOutputStream(params);
243 } 243 }
244 244
245 AudioOutputStream* AudioManagerLinux::MakeLowLatencyOutputStream( 245 AudioOutputStream* AudioManagerLinux::MakeLowLatencyOutputStream(
246 const AudioParameters& params) { 246 const AudioParameters& params) {
247 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format); 247 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
248 return MakeOutputStream(params); 248 return MakeOutputStream(params);
249 } 249 }
250 250
251 AudioInputStream* AudioManagerLinux::MakeLinearInputStream( 251 AudioInputStream* AudioManagerLinux::MakeLinearInputStream(
252 const AudioParameters& params, const std::string& device_id) { 252 const AudioParameters& params, const std::string& device_id) {
253 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format); 253 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format());
254 return MakeInputStream(params, device_id); 254 return MakeInputStream(params, device_id);
255 } 255 }
256 256
257 AudioInputStream* AudioManagerLinux::MakeLowLatencyInputStream( 257 AudioInputStream* AudioManagerLinux::MakeLowLatencyInputStream(
258 const AudioParameters& params, const std::string& device_id) { 258 const AudioParameters& params, const std::string& device_id) {
259 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format); 259 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format());
260 return MakeInputStream(params, device_id); 260 return MakeInputStream(params, device_id);
261 } 261 }
262 262
263 AudioOutputStream* AudioManagerLinux::MakeOutputStream( 263 AudioOutputStream* AudioManagerLinux::MakeOutputStream(
264 const AudioParameters& params) { 264 const AudioParameters& params) {
265 AudioOutputStream* stream = NULL; 265 AudioOutputStream* stream = NULL;
266 #if defined(USE_PULSEAUDIO) 266 #if defined(USE_PULSEAUDIO)
267 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) { 267 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUsePulseAudio)) {
268 stream = new PulseAudioOutputStream(params, this); 268 stream = new PulseAudioOutputStream(params, this);
269 } else { 269 } else {
(...skipping 21 matching lines...) Expand all
291 device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 291 device_name = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
292 switches::kAlsaInputDevice); 292 switches::kAlsaInputDevice);
293 } 293 }
294 294
295 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); 295 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get());
296 } 296 }
297 297
298 AudioManager* CreateAudioManager() { 298 AudioManager* CreateAudioManager() {
299 return new AudioManagerLinux(); 299 return new AudioManagerLinux();
300 } 300 }
OLDNEW
« no previous file with comments | « media/audio/linux/alsa_output_unittest.cc ('k') | media/audio/mac/audio_input_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698