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

Unified Diff: media/audio/openbsd/audio_manager_openbsd.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/openbsd/audio_manager_openbsd.h ('k') | media/audio/pulse/audio_manager_pulse.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/openbsd/audio_manager_openbsd.cc
diff --git a/media/audio/openbsd/audio_manager_openbsd.cc b/media/audio/openbsd/audio_manager_openbsd.cc
index ec482d8b7cd771730469fa7b8d9731de061046b9..9b9f2edbaac47ffbd8b91803ca45f6bc57b2dd9e 100644
--- a/media/audio/openbsd/audio_manager_openbsd.cc
+++ b/media/audio/openbsd/audio_manager_openbsd.cc
@@ -55,17 +55,29 @@ bool AudioManagerOpenBSD::HasAudioInputDevices() {
return HasAudioHardware();
}
-AudioParameters AudioManagerOpenBSD::GetInputStreamParameters(
- const std::string& device_id) {
+AudioParameters AudioManagerOpenBSD::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 = std::min(buffer_size, input_params.frames_per_buffer());
+ }
+
int user_buffer_size = GetUserBufferSize();
- int buffer_size = user_buffer_size ?
- user_buffer_size : kDefaultInputBufferSize;
+ if (user_buffer_size)
+ buffer_size = user_buffer_size;
return AudioParameters(
- AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO,
- kDefaultSampleRate, 16, buffer_size);
+ AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout,
+ sample_rate, bits_per_sample, buffer_size);
}
AudioManagerOpenBSD::AudioManagerOpenBSD(AudioLogFactory* audio_log_factory)
« no previous file with comments | « media/audio/openbsd/audio_manager_openbsd.h ('k') | media/audio/pulse/audio_manager_pulse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698