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 int WebRtcAudioCapturerSinkOwner::CaptureData(const std::vector<int>& channels, | 14 void WebRtcAudioCapturerSinkOwner::CaptureData(const std::vector<int>& channels, |
15 const int16* audio_data, | 15 const int16* audio_data, |
16 int sample_rate, | 16 int sample_rate, |
17 int number_of_channels, | 17 int number_of_channels, |
18 int number_of_frames, | 18 int number_of_frames) { |
19 int audio_delay_milliseconds, | |
20 int current_volume, | |
21 bool need_audio_processing, | |
22 bool key_pressed) { | |
23 base::AutoLock lock(lock_); | 19 base::AutoLock lock(lock_); |
24 if (delegate_) { | 20 if (delegate_) { |
25 return delegate_->CaptureData(channels, | 21 delegate_->CaptureData(channels, |
26 audio_data, | 22 audio_data, |
27 sample_rate, | 23 sample_rate, |
28 number_of_channels, | 24 number_of_channels, |
29 number_of_frames, | 25 number_of_frames); |
30 audio_delay_milliseconds, | |
31 current_volume, | |
32 need_audio_processing, | |
33 key_pressed); | |
34 } | 26 } |
35 | |
36 return 0; | |
37 } | 27 } |
38 | 28 |
39 void WebRtcAudioCapturerSinkOwner::SetCaptureFormat( | 29 void WebRtcAudioCapturerSinkOwner::SetCaptureFormat( |
40 const media::AudioParameters& params) { | 30 const media::AudioParameters& params) { |
41 base::AutoLock lock(lock_); | 31 base::AutoLock lock(lock_); |
42 if (delegate_) | 32 if (delegate_) |
43 delegate_->SetCaptureFormat(params); | 33 delegate_->SetCaptureFormat(params); |
44 } | 34 } |
45 | 35 |
46 bool WebRtcAudioCapturerSinkOwner::IsEqual( | 36 bool WebRtcAudioCapturerSinkOwner::IsEqual( |
47 const WebRtcAudioCapturerSink* other) const { | 37 const WebRtcAudioCapturerSink* other) const { |
48 base::AutoLock lock(lock_); | 38 base::AutoLock lock(lock_); |
49 return (other == delegate_); | 39 return (other == delegate_); |
50 } | 40 } |
51 | 41 |
52 void WebRtcAudioCapturerSinkOwner::Reset() { | 42 void WebRtcAudioCapturerSinkOwner::Reset() { |
53 base::AutoLock lock(lock_); | 43 base::AutoLock lock(lock_); |
54 delegate_ = NULL; | 44 delegate_ = NULL; |
55 } | 45 } |
56 | 46 |
57 } // namespace content | 47 } // namespace content |
OLD | NEW |