| Index: media/audio/mac/audio_low_latency_input_mac.cc
|
| diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
|
| index 2429dd1a442d3dc90e539924aaa6790bc6169913..a4ca226459281ac375fa33c7b03f5c0e5230ea30 100644
|
| --- a/media/audio/mac/audio_low_latency_input_mac.cc
|
| +++ b/media/audio/mac/audio_low_latency_input_mac.cc
|
| @@ -236,9 +236,11 @@ static void AddSystemInfoToUMA(bool is_on_battery, int num_resumes) {
|
| // http://developer.apple.com/library/mac/#technotes/tn2091/_index.html
|
| // for more details and background regarding this implementation.
|
|
|
| -AUAudioInputStream::AUAudioInputStream(AudioManagerMac* manager,
|
| - const AudioParameters& input_params,
|
| - AudioDeviceID audio_device_id)
|
| +AUAudioInputStream::AUAudioInputStream(
|
| + AudioManagerMac* manager,
|
| + const AudioParameters& input_params,
|
| + AudioDeviceID audio_device_id,
|
| + const AudioManager::StatisticsCallback& statistics_callback)
|
| : manager_(manager),
|
| number_of_frames_(input_params.frames_per_buffer()),
|
| number_of_frames_provided_(0),
|
| @@ -264,6 +266,7 @@ AUAudioInputStream::AUAudioInputStream(AudioManagerMac* manager,
|
| number_of_restart_indications_(0),
|
| number_of_restart_attempts_(0),
|
| total_number_of_restart_attempts_(0),
|
| + statistics_callback_(statistics_callback),
|
| weak_factory_(this) {
|
| DCHECK(manager_);
|
|
|
| @@ -1644,6 +1647,8 @@ void AUAudioInputStream::ReportAndResetStats() {
|
| // Even if there aren't any glitches, we want to record it to get a feel for
|
| // how often we get no glitches vs the alternative.
|
| UMA_HISTOGRAM_COUNTS("Media.Audio.Capture.Glitches", glitches_detected_);
|
| + statistics_callback_.Run(this, "Media.Audio.Capture.Glitches",
|
| + glitches_detected_);
|
|
|
| if (glitches_detected_ != 0) {
|
| auto lost_frames_ms = (total_lost_frames_ * 1000) / format_.mSampleRate;
|
|
|