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

Side by Side Diff: chrome/renderer/media/cast_receiver_audio_valve.cc

Issue 1304173002: Log error instead of CHECKing input audio sequence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review. Created 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer/media/cast_receiver_audio_valve.h" 5 #include "chrome/renderer/media/cast_receiver_audio_valve.h"
6 6
7 CastReceiverAudioValve::CastReceiverAudioValve( 7 CastReceiverAudioValve::CastReceiverAudioValve(
8 media::AudioCapturerSource::CaptureCallback* cb) 8 media::AudioCapturerSource::CaptureCallback* cb)
9 : cb_(cb) { 9 : cb_(cb) {
10 } 10 }
11 CastReceiverAudioValve::~CastReceiverAudioValve() {} 11 CastReceiverAudioValve::~CastReceiverAudioValve() {}
12 12
13 void CastReceiverAudioValve::Capture(const media::AudioBus* audio_source, 13 void CastReceiverAudioValve::Capture(const media::AudioBus* audio_source,
14 int audio_delay_milliseconds, 14 int audio_delay_milliseconds,
15 double volume, 15 double volume,
16 bool key_pressed) { 16 bool key_pressed) {
17 base::AutoLock lock(lock_); 17 base::AutoLock lock(lock_);
18 if (cb_) { 18 if (cb_) {
19 cb_->Capture(audio_source, audio_delay_milliseconds, volume, key_pressed); 19 cb_->Capture(audio_source, audio_delay_milliseconds, volume, key_pressed);
20 } 20 }
21 } 21 }
22 22
23 void CastReceiverAudioValve::OnCaptureError() { 23 void CastReceiverAudioValve::OnCaptureError(const std::string& message) {
24 base::AutoLock lock(lock_); 24 base::AutoLock lock(lock_);
25 if (cb_) { 25 if (cb_) {
26 cb_->OnCaptureError(); 26 cb_->OnCaptureError(message);
27 } 27 }
28 } 28 }
29 29
30 void CastReceiverAudioValve::Stop() { 30 void CastReceiverAudioValve::Stop() {
31 base::AutoLock lock(lock_); 31 base::AutoLock lock(lock_);
32 cb_ = nullptr; 32 cb_ = nullptr;
33 } 33 }
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_receiver_audio_valve.h ('k') | chrome/renderer/media/cast_receiver_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698