OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |