Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1358)

Side by Side Diff: content/renderer/media/media_stream_audio_processor_options.h

Issue 2103483002: Add UMA stats for AEC filter divergence metric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix (minyue@). Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 bool default_audio_processing_constraint_value_; 96 bool default_audio_processing_constraint_value_;
97 }; 97 };
98 98
99 // A helper class to log echo information in general and Echo Cancellation 99 // A helper class to log echo information in general and Echo Cancellation
100 // quality in particular. 100 // quality in particular.
101 class CONTENT_EXPORT EchoInformation { 101 class CONTENT_EXPORT EchoInformation {
102 public: 102 public:
103 EchoInformation(); 103 EchoInformation();
104 virtual ~EchoInformation(); 104 virtual ~EchoInformation();
105 105
106 // Updates stats. Must be called every time AudioProcessing::ProcessStream()
107 // is called.
106 void UpdateAecDelayStats(webrtc::EchoCancellation* echo_cancellation); 108 void UpdateAecDelayStats(webrtc::EchoCancellation* echo_cancellation);
109 void UpdateAecDivergentFilterStats(
tommi (sloooow) - chröme 2016/06/28 11:43:56 Do we need two methods?
Henrik Grunell 2016/06/29 08:47:58 No, done. Kept them internally.
110 webrtc::EchoCancellation* echo_cancellation);
111
112 // Reports AEC divergent filter stats and resets the associated data.
113 void ReportAndResetAecDivergentFilterStats();
107 114
108 private: 115 private:
109 // Counter to track 5 seconds of processed 10 ms chunks in order to query a 116 // Counter to track 5 seconds of data in order to query a new metric from
110 // new metric from webrtc::EchoCancellation::GetEchoDelayMetrics(). 117 // webrtc::EchoCancellation::GetEchoDelayMetrics().
111 int num_chunks_; 118 int delay_stats_time_ms_;
112 bool echo_frames_received_; 119 bool echo_frames_received_;
113 120
121 // Counter to track 1 second of data in order to query a new divergent filter
122 // fraction metric from webrtc::EchoCancellation::GetMetrics().
123 int divergent_filter_stats_time_ms_;
124
125 // Total number of times we queried for the divergent filter fraction metric.
126 int num_divergent_filter_fraction_;
127
128 // Number of non-zero divergent filter fraction metrics.
129 int num_non_zero_divergent_filter_fraction_;
130
114 DISALLOW_COPY_AND_ASSIGN(EchoInformation); 131 DISALLOW_COPY_AND_ASSIGN(EchoInformation);
115 }; 132 };
116 133
117 // Enables the echo cancellation in |audio_processing|. 134 // Enables the echo cancellation in |audio_processing|.
118 void EnableEchoCancellation(AudioProcessing* audio_processing); 135 void EnableEchoCancellation(AudioProcessing* audio_processing);
119 136
120 // Enables the noise suppression in |audio_processing|. 137 // Enables the noise suppression in |audio_processing|.
121 void EnableNoiseSuppression(AudioProcessing* audio_processing, 138 void EnableNoiseSuppression(AudioProcessing* audio_processing,
122 webrtc::NoiseSuppression::Level ns_level); 139 webrtc::NoiseSuppression::Level ns_level);
123 140
(...skipping 20 matching lines...) Expand all
144 161
145 // Returns the array geometry from the media constraints if existing and 162 // Returns the array geometry from the media constraints if existing and
146 // otherwise that provided by the input device. 163 // otherwise that provided by the input device.
147 CONTENT_EXPORT std::vector<webrtc::Point> GetArrayGeometryPreferringConstraints( 164 CONTENT_EXPORT std::vector<webrtc::Point> GetArrayGeometryPreferringConstraints(
148 const MediaAudioConstraints& audio_constraints, 165 const MediaAudioConstraints& audio_constraints,
149 const MediaStreamDevice::AudioDeviceParameters& input_params); 166 const MediaStreamDevice::AudioDeviceParameters& input_params);
150 167
151 } // namespace content 168 } // namespace content
152 169
153 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_ 170 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_PROCESSOR_OPTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698