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

Side by Side Diff: media/audio/cras/audio_manager_cras.cc

Issue 11959018: Add a unified audio I/O backend for ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Save params, other cleanups suggested by Dale Created 7 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
« no previous file with comments | « no previous file | media/audio/cras/cras_input.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 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/cras/audio_manager_cras.h" 5 #include "media/audio/cras/audio_manager_cras.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"
11 #include "base/process_util.h" 11 #include "base/process_util.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "media/audio/audio_util.h" 13 #include "media/audio/audio_util.h"
14 #include "media/audio/cras/cras_input.h" 14 #include "media/audio/cras/cras_input.h"
15 #include "media/audio/cras/cras_output.h" 15 #include "media/audio/cras/cras_unified.h"
16 #include "media/base/channel_layout.h" 16 #include "media/base/channel_layout.h"
17 17
18 namespace media { 18 namespace media {
19 19
20 // Maximum number of output streams that can be open simultaneously. 20 // Maximum number of output streams that can be open simultaneously.
21 static const int kMaxOutputStreams = 50; 21 static const int kMaxOutputStreams = 50;
22 22
23 // Default sample rate for input and output streams. 23 // Default sample rate for input and output streams.
24 static const int kDefaultSampleRate = 48000; 24 static const int kDefaultSampleRate = 48000;
25 25
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (user_buffer_size) 114 if (user_buffer_size)
115 buffer_size = user_buffer_size; 115 buffer_size = user_buffer_size;
116 116
117 return AudioParameters( 117 return AudioParameters(
118 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, input_channels, 118 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, input_channels,
119 sample_rate, bits_per_sample, buffer_size); 119 sample_rate, bits_per_sample, buffer_size);
120 } 120 }
121 121
122 AudioOutputStream* AudioManagerCras::MakeOutputStream( 122 AudioOutputStream* AudioManagerCras::MakeOutputStream(
123 const AudioParameters& params) { 123 const AudioParameters& params) {
124 return new CrasOutputStream(params, this); 124 return new CrasUnifiedStream(params, this);
125 } 125 }
126 126
127 AudioInputStream* AudioManagerCras::MakeInputStream( 127 AudioInputStream* AudioManagerCras::MakeInputStream(
128 const AudioParameters& params, const std::string& device_id) { 128 const AudioParameters& params, const std::string& device_id) {
129 return new CrasInputStream(params, this); 129 return new CrasInputStream(params, this);
130 } 130 }
131 131
132 } // namespace media 132 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/audio/cras/cras_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698