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

Side by Side Diff: components/copresence/mediums/audio/audio_recorder.cc

Issue 460373002: Remove the last piece of deprecated synchronous IO code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | content/browser/media/media_internals.cc » ('j') | media/audio/audio_parameters.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/copresence/mediums/audio/audio_recorder.h" 5 #include "components/copresence/mediums/audio/audio_recorder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 media::AudioParameters params = 95 media::AudioParameters params =
96 params_for_testing_ 96 params_for_testing_
97 ? *params_for_testing_ 97 ? *params_for_testing_
98 : media::AudioManager::Get()->GetInputStreamParameters( 98 : media::AudioManager::Get()->GetInputStreamParameters(
99 media::AudioManagerBase::kDefaultDeviceId); 99 media::AudioManagerBase::kDefaultDeviceId);
100 100
101 const media::AudioParameters dest_params(params.format(), 101 const media::AudioParameters dest_params(params.format(),
102 kDefaultChannelLayout, 102 kDefaultChannelLayout,
103 kDefaultChannels, 103 kDefaultChannels,
104 params.input_channels(),
105 kDefaultSampleRate, 104 kDefaultSampleRate,
106 kDefaultBitsPerSample, 105 kDefaultBitsPerSample,
107 params.frames_per_buffer(), 106 params.frames_per_buffer(),
108 media::AudioParameters::NO_EFFECTS); 107 media::AudioParameters::NO_EFFECTS);
109 108
110 converter_.reset(new media::AudioConverter( 109 converter_.reset(new media::AudioConverter(
111 params, dest_params, params.sample_rate() == dest_params.sample_rate())); 110 params, dest_params, params.sample_rate() == dest_params.sample_rate()));
112 converter_->AddInput(this); 111 converter_->AddInput(this);
113 112
114 total_buffer_frames_ = kProcessIntervalMs * dest_params.sample_rate() / 1000; 113 total_buffer_frames_ = kProcessIntervalMs * dest_params.sample_rate() / 1000;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 base::RunLoop rl; 240 base::RunLoop rl;
242 media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply( 241 media::AudioManager::Get()->GetTaskRunner()->PostTaskAndReply(
243 FROM_HERE, 242 FROM_HERE,
244 base::Bind(base::IgnoreResult(&AudioRecorder::FlushAudioLoopForTesting), 243 base::Bind(base::IgnoreResult(&AudioRecorder::FlushAudioLoopForTesting),
245 base::Unretained(this)), 244 base::Unretained(this)),
246 rl.QuitClosure()); 245 rl.QuitClosure());
247 rl.Run(); 246 rl.Run();
248 } 247 }
249 248
250 } // namespace copresence 249 } // namespace copresence
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/media_internals.cc » ('j') | media/audio/audio_parameters.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698