| 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_OPTIONS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| 11 #include "base/time/time.h" | |
| 12 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 13 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 12 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" |
| 14 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 13 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
| 15 | 14 |
| 16 namespace webrtc { | 15 namespace webrtc { |
| 17 | 16 |
| 18 class AudioFrame; | 17 class AudioFrame; |
| 19 class AudioProcessing; | 18 class AudioProcessing; |
| 19 class EchoCancellation; |
| 20 class MediaConstraintsInterface; | 20 class MediaConstraintsInterface; |
| 21 class TypingDetection; | 21 class TypingDetection; |
| 22 | 22 |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 | 26 |
| 27 class RTCMediaConstraints; | 27 class RTCMediaConstraints; |
| 28 | 28 |
| 29 using webrtc::AudioProcessing; | 29 using webrtc::AudioProcessing; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 bool default_audio_processing_constraint_value_; | 86 bool default_audio_processing_constraint_value_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 // A helper class to log echo information in general and Echo Cancellation | 89 // A helper class to log echo information in general and Echo Cancellation |
| 90 // quality in particular. | 90 // quality in particular. |
| 91 class CONTENT_EXPORT EchoInformation { | 91 class CONTENT_EXPORT EchoInformation { |
| 92 public: | 92 public: |
| 93 EchoInformation(); | 93 EchoInformation(); |
| 94 virtual ~EchoInformation(); | 94 virtual ~EchoInformation(); |
| 95 | 95 |
| 96 // Updates delay statistics with a new |delay|. | 96 void UpdateAecDelayStats(webrtc::EchoCancellation* echo_cancellation); |
| 97 void UpdateAecDelayStats(int delay); | |
| 98 | 97 |
| 99 private: | 98 private: |
| 100 // Updates UMA histograms with an interval of |kTimeBetweenLogsInSeconds|. | 99 // Updates UMA histograms with an interval of 5 seconds. |
| 101 void LogAecDelayStats(); | 100 void LogAecDelayStats(); |
| 102 | 101 |
| 103 // Counters for determining how often the estimated delay in the AEC is out of | 102 // Counters to be able to aquire a 5 second aggregated metric out of 1 second |
| 104 // bounds. | 103 // aggregated webrtc::EchoCancellation::GetEchoDelayMetrics() queries. |
| 105 int echo_poor_delay_counts_; | 104 int num_chunks_; |
| 106 int echo_total_delay_counts_; | 105 int num_queries_; |
| 107 base::TimeTicks last_log_time_; | 106 float echo_fraction_poor_delays_; |
| 108 | 107 |
| 109 DISALLOW_COPY_AND_ASSIGN(EchoInformation); | 108 DISALLOW_COPY_AND_ASSIGN(EchoInformation); |
| 110 }; | 109 }; |
| 111 | 110 |
| 112 // Enables the echo cancellation in |audio_processing|. | 111 // Enables the echo cancellation in |audio_processing|. |
| 113 void EnableEchoCancellation(AudioProcessing* audio_processing); | 112 void EnableEchoCancellation(AudioProcessing* audio_processing); |
| 114 | 113 |
| 115 // Enables the noise suppression in |audio_processing|. | 114 // Enables the noise suppression in |audio_processing|. |
| 116 void EnableNoiseSuppression(AudioProcessing* audio_processing); | 115 void EnableNoiseSuppression(AudioProcessing* audio_processing); |
| 117 | 116 |
| 118 // Enables the high pass filter in |audio_processing|. | 117 // Enables the high pass filter in |audio_processing|. |
| 119 void EnableHighPassFilter(AudioProcessing* audio_processing); | 118 void EnableHighPassFilter(AudioProcessing* audio_processing); |
| 120 | 119 |
| 121 // Enables the typing detection in |audio_processing|. | 120 // Enables the typing detection in |audio_processing|. |
| 122 void EnableTypingDetection(AudioProcessing* audio_processing, | 121 void EnableTypingDetection(AudioProcessing* audio_processing, |
| 123 webrtc::TypingDetection* typing_detector); | 122 webrtc::TypingDetection* typing_detector); |
| 124 | 123 |
| 125 // Starts the echo cancellation dump in |audio_processing|. | 124 // Starts the echo cancellation dump in |audio_processing|. |
| 126 void StartEchoCancellationDump(AudioProcessing* audio_processing, | 125 void StartEchoCancellationDump(AudioProcessing* audio_processing, |
| 127 base::File aec_dump_file); | 126 base::File aec_dump_file); |
| 128 | 127 |
| 129 // Stops the echo cancellation dump in |audio_processing|. | 128 // Stops the echo cancellation dump in |audio_processing|. |
| 130 // This method has no impact if echo cancellation dump has not been started on | 129 // This method has no impact if echo cancellation dump has not been started on |
| 131 // |audio_processing|. | 130 // |audio_processing|. |
| 132 void StopEchoCancellationDump(AudioProcessing* audio_processing); | 131 void StopEchoCancellationDump(AudioProcessing* audio_processing); |
| 133 | 132 |
| 134 void EnableAutomaticGainControl(AudioProcessing* audio_processing); | 133 void EnableAutomaticGainControl(AudioProcessing* audio_processing); |
| 135 | 134 |
| 136 void GetAecStats(AudioProcessing* audio_processing, | 135 void GetAecStats(webrtc::EchoCancellation* echo_cancellation, |
| 137 webrtc::AudioProcessorInterface::AudioProcessorStats* stats); | 136 webrtc::AudioProcessorInterface::AudioProcessorStats* stats); |
| 138 | 137 |
| 139 } // namespace content | 138 } // namespace content |
| 140 | 139 |
| 141 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ | 140 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ |
| OLD | NEW |