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

Unified Diff: media/audio/alsa/audio_manager_alsa.cc

Issue 285233005: add audio-buffer-size command line flag support to the input audio for all the platforms (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/alsa/audio_manager_alsa.h ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/alsa/audio_manager_alsa.cc
diff --git a/media/audio/alsa/audio_manager_alsa.cc b/media/audio/alsa/audio_manager_alsa.cc
index beb60bad88b02af515dd1075fb54a43edd226cb6..4bfd2452982115913a4f24fc67eb0c03b6986bfa 100644
--- a/media/audio/alsa/audio_manager_alsa.cc
+++ b/media/audio/alsa/audio_manager_alsa.cc
@@ -107,13 +107,24 @@ void AudioManagerAlsa::GetAudioOutputDeviceNames(
GetAlsaAudioDevices(kStreamPlayback, device_names);
}
-AudioParameters AudioManagerAlsa::GetInputStreamParameters(
- const std::string& device_id) {
+AudioParameters AudioManagerAlsa::GetPreferredInputStreamParameters(
+ const std::string& input_device_id,
+ const AudioParameters& input_params) {
static const int kDefaultInputBufferSize = 1024;
+ ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO;
+ int sample_rate = kDefaultSampleRate;
+ int buffer_size = kDefaultInputBufferSize;
+ int bits_per_sample = 16;
+ if (input_params.IsValid()) {
+ sample_rate = input_params.sample_rate();
+ bits_per_sample = input_params.bits_per_sample();
+ channel_layout = input_params.channel_layout();
+ buffer_size = input_params.frames_per_buffer();
+ }
return AudioParameters(
- AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO,
- kDefaultSampleRate, 16, kDefaultInputBufferSize);
+ AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout,
+ sample_rate, bits_per_sample, buffer_size);
}
void AudioManagerAlsa::GetAlsaAudioDevices(
« no previous file with comments | « media/audio/alsa/audio_manager_alsa.h ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698