OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/platform_file.h" | |
13 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
14 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "content/common/media/media_stream_options.h" | 17 #include "content/common/media/media_stream_options.h" |
17 #include "content/renderer/media/tagged_list.h" | 18 #include "content/renderer/media/tagged_list.h" |
18 #include "media/audio/audio_input_device.h" | 19 #include "media/audio/audio_input_device.h" |
19 #include "media/base/audio_capturer_source.h" | 20 #include "media/base/audio_capturer_source.h" |
20 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 21 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
21 | 22 |
22 namespace media { | 23 namespace media { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 // This method is exposed to the public because the media stream track can | 102 // This method is exposed to the public because the media stream track can |
102 // call Stop() on its source. | 103 // call Stop() on its source. |
103 void Stop(); | 104 void Stop(); |
104 | 105 |
105 // Called by the WebAudioCapturerSource to get the audio processing params. | 106 // Called by the WebAudioCapturerSource to get the audio processing params. |
106 // This function is triggered by provideInput() on the WebAudio audio thread, | 107 // This function is triggered by provideInput() on the WebAudio audio thread, |
107 // TODO(xians): Remove after moving APM from WebRtc to Chrome. | 108 // TODO(xians): Remove after moving APM from WebRtc to Chrome. |
108 void GetAudioProcessingParams(base::TimeDelta* delay, int* volume, | 109 void GetAudioProcessingParams(base::TimeDelta* delay, int* volume, |
109 bool* key_pressed); | 110 bool* key_pressed); |
110 | 111 |
111 // Use by the unittests to inject their own source to the capturer. | 112 // Uses by the unittests to inject their own source to the capturer. |
Henrik Grunell
2014/03/06 10:12:20
"Used".
no longer working on chromium
2014/03/06 18:57:21
Done.
| |
112 void SetCapturerSourceForTesting( | 113 void SetCapturerSourceForTesting( |
113 const scoped_refptr<media::AudioCapturerSource>& source, | 114 const scoped_refptr<media::AudioCapturerSource>& source, |
114 media::AudioParameters params); | 115 media::AudioParameters params); |
115 | 116 |
117 void StartAecDump(const base::PlatformFile& aec_dump_file); | |
118 void StopAecDump(); | |
119 | |
116 protected: | 120 protected: |
117 friend class base::RefCountedThreadSafe<WebRtcAudioCapturer>; | 121 friend class base::RefCountedThreadSafe<WebRtcAudioCapturer>; |
118 virtual ~WebRtcAudioCapturer(); | 122 virtual ~WebRtcAudioCapturer(); |
119 | 123 |
120 private: | 124 private: |
121 class TrackOwner; | 125 class TrackOwner; |
122 typedef TaggedList<TrackOwner> TrackList; | 126 typedef TaggedList<TrackOwner> TrackList; |
123 | 127 |
124 WebRtcAudioCapturer(int render_view_id, | 128 WebRtcAudioCapturer(int render_view_id, |
125 const StreamDeviceInfo& device_info, | 129 const StreamDeviceInfo& device_info, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 base::TimeDelta audio_delay_; | 202 base::TimeDelta audio_delay_; |
199 bool key_pressed_; | 203 bool key_pressed_; |
200 | 204 |
201 // Flag to help deciding if the data needs audio processing. | 205 // Flag to help deciding if the data needs audio processing. |
202 bool need_audio_processing_; | 206 bool need_audio_processing_; |
203 | 207 |
204 // Raw pointer to the WebRtcAudioDeviceImpl, which is valid for the lifetime | 208 // Raw pointer to the WebRtcAudioDeviceImpl, which is valid for the lifetime |
205 // of RenderThread. | 209 // of RenderThread. |
206 WebRtcAudioDeviceImpl* audio_device_; | 210 WebRtcAudioDeviceImpl* audio_device_; |
207 | 211 |
212 // Used for start the Aec dump on the |audio_processor_|. | |
Henrik Grunell
2014/03/06 10:12:20
"starting"
no longer working on chromium
2014/03/06 18:57:21
Done.
| |
213 // Accessed only on the main render thread. | |
214 base::PlatformFile aec_dump_file_; | |
215 | |
208 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer); | 216 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturer); |
209 }; | 217 }; |
210 | 218 |
211 } // namespace content | 219 } // namespace content |
212 | 220 |
213 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ | 221 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_H_ |
OLD | NEW |