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

Side by Side Diff: media/audio/sounds/audio_stream_handler.cc

Issue 163343002: Reland 153623004: Remove the unified IO code on the browser (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed the cras bot Created 6 years, 10 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
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/sounds/audio_stream_handler.h" 5 #include "media/audio/sounds/audio_stream_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/cancelable_callback.h" 9 #include "base/cancelable_callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 DCHECK(AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread()); 52 DCHECK(AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread());
53 53
54 if (!stream_) { 54 if (!stream_) {
55 const AudioParameters& p = wav_audio_.params(); 55 const AudioParameters& p = wav_audio_.params();
56 const AudioParameters params(AudioParameters::AUDIO_PCM_LOW_LATENCY, 56 const AudioParameters params(AudioParameters::AUDIO_PCM_LOW_LATENCY,
57 p.channel_layout(), 57 p.channel_layout(),
58 p.sample_rate(), 58 p.sample_rate(),
59 p.bits_per_sample(), 59 p.bits_per_sample(),
60 kDefaultFrameCount); 60 kDefaultFrameCount);
61 stream_ = AudioManager::Get()->MakeAudioOutputStreamProxy( 61 stream_ = AudioManager::Get()->MakeAudioOutputStreamProxy(
62 params, std::string(), std::string()); 62 params, std::string());
63 if (!stream_ || !stream_->Open()) { 63 if (!stream_ || !stream_->Open()) {
64 LOG(ERROR) << "Failed to open an output stream."; 64 LOG(ERROR) << "Failed to open an output stream.";
65 return; 65 return;
66 } 66 }
67 stream_->SetVolume(kOutputVolumePercent); 67 stream_->SetVolume(kOutputVolumePercent);
68 } 68 }
69 69
70 { 70 {
71 base::AutoLock al(state_lock_); 71 base::AutoLock al(state_lock_);
72 72
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 g_observer_for_testing = observer; 215 g_observer_for_testing = observer;
216 } 216 }
217 217
218 // static 218 // static
219 void AudioStreamHandler::SetAudioSourceForTesting( 219 void AudioStreamHandler::SetAudioSourceForTesting(
220 AudioOutputStream::AudioSourceCallback* source) { 220 AudioOutputStream::AudioSourceCallback* source) {
221 g_audio_source_for_testing = source; 221 g_audio_source_for_testing = source;
222 } 222 }
223 223
224 } // namespace media 224 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/pulse/pulse_unified.cc ('k') | media/audio/win/audio_low_latency_output_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698