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

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

Issue 2623443002: Fix getUserMedia so that failure is reported for invalid audio sources. (Closed)
Patch Set: Address comments Created 3 years, 11 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 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "media/base/audio_parameters.h" 9 #include "media/base/audio_parameters.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // TimeTicks::Now() is being called after the |lock_| was acquired in order 49 // TimeTicks::Now() is being called after the |lock_| was acquired in order
50 // to provide the most accurate delay value. 50 // to provide the most accurate delay value.
51 const int audio_delay_milliseconds = 51 const int audio_delay_milliseconds =
52 (base::TimeTicks::Now() - playout_time).InMilliseconds(); 52 (base::TimeTicks::Now() - playout_time).InMilliseconds();
53 53
54 cb_->Capture(&audio_bus, audio_delay_milliseconds, 1.0 /* volume */, 54 cb_->Capture(&audio_bus, audio_delay_milliseconds, 1.0 /* volume */,
55 false /* key_pressed */); 55 false /* key_pressed */);
56 } 56 }
57 } 57 }
58 58
59 void CastReceiverAudioValve::OnStarted() {
60 base::AutoLock lock(lock_);
61 if (cb_)
62 cb_->OnCaptureStarted();
63 }
64
59 void CastReceiverAudioValve::Stop() { 65 void CastReceiverAudioValve::Stop() {
60 base::AutoLock lock(lock_); 66 base::AutoLock lock(lock_);
61 cb_ = nullptr; 67 cb_ = nullptr;
62 } 68 }
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_receiver_audio_valve.h ('k') | chrome/renderer/media/cast_receiver_session_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698