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

Side by Side Diff: media/audio/fake_audio_manager.cc

Issue 509893002: Revert of Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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/cras/cras_unified.cc ('k') | media/audio/mac/audio_manager_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 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/fake_audio_manager.h" 5 #include "media/audio/fake_audio_manager.h"
6 6
7 namespace media { 7 namespace media {
8 8
9 namespace { 9 namespace {
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 AudioParameters FakeAudioManager::GetPreferredOutputStreamParameters( 52 AudioParameters FakeAudioManager::GetPreferredOutputStreamParameters(
53 const std::string& output_device_id, 53 const std::string& output_device_id,
54 const AudioParameters& input_params) { 54 const AudioParameters& input_params) {
55 static const int kDefaultOutputBufferSize = 2048; 55 static const int kDefaultOutputBufferSize = 2048;
56 static const int kDefaultSampleRate = 48000; 56 static const int kDefaultSampleRate = 48000;
57 ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; 57 ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO;
58 int sample_rate = kDefaultSampleRate; 58 int sample_rate = kDefaultSampleRate;
59 int buffer_size = kDefaultOutputBufferSize; 59 int buffer_size = kDefaultOutputBufferSize;
60 int bits_per_sample = 16; 60 int bits_per_sample = 16;
61 int input_channels = 0;
61 if (input_params.IsValid()) { 62 if (input_params.IsValid()) {
62 sample_rate = input_params.sample_rate(); 63 sample_rate = input_params.sample_rate();
63 bits_per_sample = input_params.bits_per_sample(); 64 bits_per_sample = input_params.bits_per_sample();
64 channel_layout = input_params.channel_layout(); 65 channel_layout = input_params.channel_layout();
66 input_channels = input_params.input_channels();
65 buffer_size = std::min(input_params.frames_per_buffer(), buffer_size); 67 buffer_size = std::min(input_params.frames_per_buffer(), buffer_size);
66 } 68 }
67 69
68 return AudioParameters( 70 return AudioParameters(
69 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, 71 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, input_channels,
70 sample_rate, bits_per_sample, buffer_size, AudioParameters::NO_EFFECTS); 72 sample_rate, bits_per_sample, buffer_size, AudioParameters::NO_EFFECTS);
71 } 73 }
72 74
73 AudioParameters FakeAudioManager::GetInputStreamParameters( 75 AudioParameters FakeAudioManager::GetInputStreamParameters(
74 const std::string& device_id) { 76 const std::string& device_id) {
75 return AudioParameters( 77 return AudioParameters(
76 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, 78 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO,
77 kDefaultSampleRate, 16, kDefaultInputBufferSize); 79 kDefaultSampleRate, 16, kDefaultInputBufferSize);
78 } 80 }
79 81
80 } // namespace media 82 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/cras/cras_unified.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698