| 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 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ |
| 7 | 7 |
| 8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // Called by ProcessAndConsumeData(). | 146 // Called by ProcessAndConsumeData(). |
| 147 // Returns the new microphone volume in the range of |0, 255]. | 147 // Returns the new microphone volume in the range of |0, 255]. |
| 148 // When the volume does not need to be updated, it returns 0. | 148 // When the volume does not need to be updated, it returns 0. |
| 149 int ProcessData(const float* const* process_ptrs, | 149 int ProcessData(const float* const* process_ptrs, |
| 150 int process_frames, | 150 int process_frames, |
| 151 base::TimeDelta capture_delay, | 151 base::TimeDelta capture_delay, |
| 152 int volume, | 152 int volume, |
| 153 bool key_pressed, | 153 bool key_pressed, |
| 154 float* const* output_ptrs); | 154 float* const* output_ptrs); |
| 155 | 155 |
| 156 // Update AEC stats. Called on the main render thread. |
| 157 void UpdateAecStats(); |
| 158 |
| 156 // Cached value for the render delay latency. This member is accessed by | 159 // Cached value for the render delay latency. This member is accessed by |
| 157 // both the capture audio thread and the render audio thread. | 160 // both the capture audio thread and the render audio thread. |
| 158 base::subtle::Atomic32 render_delay_ms_; | 161 base::subtle::Atomic32 render_delay_ms_; |
| 159 | 162 |
| 160 // Module to detect and report (to UMA) bit exact audio repetition. | 163 // Module to detect and report (to UMA) bit exact audio repetition. |
| 161 std::unique_ptr<AudioRepetitionDetector> audio_repetition_detector_; | 164 std::unique_ptr<AudioRepetitionDetector> audio_repetition_detector_; |
| 162 | 165 |
| 163 // Module to handle processing and format conversion. | 166 // Module to handle processing and format conversion. |
| 164 std::unique_ptr<webrtc::AudioProcessing> audio_processing_; | 167 std::unique_ptr<webrtc::AudioProcessing> audio_processing_; |
| 165 | 168 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 183 // lifetime of RenderThread. | 186 // lifetime of RenderThread. |
| 184 WebRtcPlayoutDataSource* playout_data_source_; | 187 WebRtcPlayoutDataSource* playout_data_source_; |
| 185 | 188 |
| 186 // Used to DCHECK that some methods are called on the main render thread. | 189 // Used to DCHECK that some methods are called on the main render thread. |
| 187 base::ThreadChecker main_thread_checker_; | 190 base::ThreadChecker main_thread_checker_; |
| 188 // Used to DCHECK that some methods are called on the capture audio thread. | 191 // Used to DCHECK that some methods are called on the capture audio thread. |
| 189 base::ThreadChecker capture_thread_checker_; | 192 base::ThreadChecker capture_thread_checker_; |
| 190 // Used to DCHECK that some methods are called on the render audio thread. | 193 // Used to DCHECK that some methods are called on the render audio thread. |
| 191 base::ThreadChecker render_thread_checker_; | 194 base::ThreadChecker render_thread_checker_; |
| 192 | 195 |
| 196 // Message loop for the main render thread. We're assuming that we're created |
| 197 // on the main render thread. |
| 198 base::MessageLoop* main_thread_message_loop_; |
| 199 |
| 193 // Flag to enable stereo channel mirroring. | 200 // Flag to enable stereo channel mirroring. |
| 194 bool audio_mirroring_; | 201 bool audio_mirroring_; |
| 195 | 202 |
| 203 // Typing detector. |typing_detected_| is used to show the result of typing |
| 204 // detection. It can be accessed by the capture audio thread and by the |
| 205 // libjingle thread which calls GetStats(). |
| 196 std::unique_ptr<webrtc::TypingDetection> typing_detector_; | 206 std::unique_ptr<webrtc::TypingDetection> typing_detector_; |
| 197 // This flag is used to show the result of typing detection. | |
| 198 // It can be accessed by the capture audio thread and by the libjingle thread | |
| 199 // which calls GetStats(). | |
| 200 base::subtle::Atomic32 typing_detected_; | 207 base::subtle::Atomic32 typing_detected_; |
| 201 | 208 |
| 202 // Communication with browser for AEC dump. | 209 // Communication with browser for AEC dump. |
| 203 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; | 210 scoped_refptr<AecDumpMessageFilter> aec_dump_message_filter_; |
| 204 | 211 |
| 205 // Flag to avoid executing Stop() more than once. | 212 // Flag to avoid executing Stop() more than once. |
| 206 bool stopped_; | 213 bool stopped_; |
| 207 | 214 |
| 208 // Object for logging echo information when the AEC is enabled. Accessible by | 215 // Object for logging UMA stats for echo information when the AEC is enabled. |
| 209 // the libjingle thread through GetStats(). | 216 // Accessed on the main render thread. |
| 210 std::unique_ptr<EchoInformation> echo_information_; | 217 std::unique_ptr<EchoInformation> echo_information_; |
| 211 | 218 |
| 212 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); | 219 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioProcessor); |
| 213 }; | 220 }; |
| 214 | 221 |
| 215 } // namespace content | 222 } // namespace content |
| 216 | 223 |
| 217 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ | 224 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_H_ |
| OLD | NEW |