OLD | NEW |
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 "content/renderer/media/webrtc_audio_capturer_sink_owner.h" | 5 #include "content/renderer/media/webrtc_audio_capturer_sink_owner.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 WebRtcAudioCapturerSinkOwner::WebRtcAudioCapturerSinkOwner( | 9 WebRtcAudioCapturerSinkOwner::WebRtcAudioCapturerSinkOwner( |
10 WebRtcAudioCapturerSink* sink) | 10 WebRtcAudioCapturerSink* sink) |
11 : delegate_(sink) { | 11 : delegate_(sink) { |
12 } | 12 } |
13 | 13 |
14 void WebRtcAudioCapturerSinkOwner::CaptureData( | 14 void WebRtcAudioCapturerSinkOwner::CaptureData(const int16* audio_data, |
15 const int16* audio_data, int number_of_channels, int number_of_frames, | 15 int number_of_channels, |
16 int audio_delay_milliseconds, double volume) { | 16 int number_of_frames, |
| 17 int audio_delay_milliseconds, |
| 18 double volume, |
| 19 bool key_pressed) { |
17 base::AutoLock lock(lock_); | 20 base::AutoLock lock(lock_); |
18 if (delegate_) { | 21 if (delegate_) { |
19 delegate_->CaptureData(audio_data, number_of_channels, number_of_frames, | 22 delegate_->CaptureData(audio_data, |
20 audio_delay_milliseconds, volume); | 23 number_of_channels, |
| 24 number_of_frames, |
| 25 audio_delay_milliseconds, |
| 26 volume, |
| 27 key_pressed); |
21 } | 28 } |
22 } | 29 } |
23 | 30 |
24 void WebRtcAudioCapturerSinkOwner::SetCaptureFormat( | 31 void WebRtcAudioCapturerSinkOwner::SetCaptureFormat( |
25 const media::AudioParameters& params) { | 32 const media::AudioParameters& params) { |
26 base::AutoLock lock(lock_); | 33 base::AutoLock lock(lock_); |
27 if (delegate_) | 34 if (delegate_) |
28 delegate_->SetCaptureFormat(params); | 35 delegate_->SetCaptureFormat(params); |
29 } | 36 } |
30 | 37 |
31 bool WebRtcAudioCapturerSinkOwner::IsEqual( | 38 bool WebRtcAudioCapturerSinkOwner::IsEqual( |
32 const WebRtcAudioCapturerSink* other) const { | 39 const WebRtcAudioCapturerSink* other) const { |
33 base::AutoLock lock(lock_); | 40 base::AutoLock lock(lock_); |
34 return (other == delegate_); | 41 return (other == delegate_); |
35 } | 42 } |
36 | 43 |
37 void WebRtcAudioCapturerSinkOwner::Reset() { | 44 void WebRtcAudioCapturerSinkOwner::Reset() { |
38 base::AutoLock lock(lock_); | 45 base::AutoLock lock(lock_); |
39 delegate_ = NULL; | 46 delegate_ = NULL; |
40 } | 47 } |
41 | 48 |
42 } // namespace content | 49 } // namespace content |
OLD | NEW |