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

Side by Side Diff: chrome/browser/notifications/notification_audio_controller.cc

Issue 15979015: Reland 15721002: Hook up the device selection to the WebAudio live audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the comments. Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 "chrome/browser/notifications/notification_audio_controller.h" 5 #include "chrome/browser/notifications/notification_audio_controller.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 format, 244 format,
245 media::GuessChannelLayout(wav_audio_.num_channels()), 245 media::GuessChannelLayout(wav_audio_.num_channels()),
246 wav_audio_.num_channels(), 246 wav_audio_.num_channels(),
247 wav_audio_.sample_rate(), 247 wav_audio_.sample_rate(),
248 wav_audio_.bits_per_sample(), 248 wav_audio_.bits_per_sample(),
249 kFramesPerBuffer); 249 kFramesPerBuffer);
250 250
251 if (!params.IsValid()) 251 if (!params.IsValid())
252 return false; 252 return false;
253 253
254 stream_ = audio_manager_->MakeAudioOutputStreamProxy(params); 254 stream_ = audio_manager_->MakeAudioOutputStreamProxy(params, std::string());
255 if (!stream_->Open()) { 255 if (!stream_->Open()) {
256 DLOG(ERROR) << "Failed to open the output stream"; 256 DLOG(ERROR) << "Failed to open the output stream";
257 stream_->Close(); 257 stream_->Close();
258 return false; 258 return false;
259 } 259 }
260 260
261 stop_playing_sound_.Reset(base::Bind( 261 stop_playing_sound_.Reset(base::Bind(
262 &AudioHandler::StopPlayingSound, base::Unretained(this))); 262 &AudioHandler::StopPlayingSound, base::Unretained(this)));
263 stream_->Start(this); 263 stream_->Start(this);
264 return true; 264 return true;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 while (!audio_handlers_.empty()) 384 while (!audio_handlers_.empty())
385 audio_handlers_[0]->StopPlayingSound(); 385 audio_handlers_[0]->StopPlayingSound();
386 386
387 delete this; 387 delete this;
388 } 388 }
389 389
390 size_t NotificationAudioController::GetAudioHandlersSizeCallback() { 390 size_t NotificationAudioController::GetAudioHandlersSizeCallback() {
391 DCHECK(message_loop_->BelongsToCurrentThread()); 391 DCHECK(message_loop_->BelongsToCurrentThread());
392 return audio_handlers_.size(); 392 return audio_handlers_.size();
393 } 393 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_device_manager.cc » ('j') | media/audio/audio_manager_base.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698