OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1373 "WebRTC.Audio.PlatformReportedStreamDelayJump", diff_stream_delay_ms, | 1373 "WebRTC.Audio.PlatformReportedStreamDelayJump", diff_stream_delay_ms, |
1374 kMinDiffDelayMs, 1000, 100); | 1374 kMinDiffDelayMs, 1000, 100); |
1375 if (capture_.stream_delay_jumps == -1) { | 1375 if (capture_.stream_delay_jumps == -1) { |
1376 capture_.stream_delay_jumps = 0; // Activate counter if needed. | 1376 capture_.stream_delay_jumps = 0; // Activate counter if needed. |
1377 } | 1377 } |
1378 capture_.stream_delay_jumps++; | 1378 capture_.stream_delay_jumps++; |
1379 } | 1379 } |
1380 capture_.last_stream_delay_ms = capture_nonlocked_.stream_delay_ms; | 1380 capture_.last_stream_delay_ms = capture_nonlocked_.stream_delay_ms; |
1381 | 1381 |
1382 // Detect a jump in AEC system delay and log the difference. | 1382 // Detect a jump in AEC system delay and log the difference. |
1383 const int frames_per_ms = | 1383 const int samples_per_ms = |
1384 rtc::CheckedDivExact(capture_nonlocked_.split_rate, 1000); | 1384 rtc::CheckedDivExact(capture_nonlocked_.split_rate, 1000); |
1385 const int aec_system_delay_ms = | 1385 const int aec_system_delay_ms = |
1386 WebRtcAec_system_delay(echo_cancellation()->aec_core()) / frames_per_ms; | 1386 public_submodules_->echo_cancellation->GetSystemDelayInSamples() / |
the sun
2016/02/17 11:39:03
any risk of a div by zero here?
peah-webrtc
2016/03/04 09:46:25
Should be no risk, but adding a DCHECK just in cas
| |
1387 samples_per_ms; | |
1387 const int diff_aec_system_delay_ms = | 1388 const int diff_aec_system_delay_ms = |
1388 aec_system_delay_ms - capture_.last_aec_system_delay_ms; | 1389 aec_system_delay_ms - capture_.last_aec_system_delay_ms; |
1389 if (diff_aec_system_delay_ms > kMinDiffDelayMs && | 1390 if (diff_aec_system_delay_ms > kMinDiffDelayMs && |
1390 capture_.last_aec_system_delay_ms != 0) { | 1391 capture_.last_aec_system_delay_ms != 0) { |
1391 RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.Audio.AecSystemDelayJump", | 1392 RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.Audio.AecSystemDelayJump", |
1392 diff_aec_system_delay_ms, kMinDiffDelayMs, | 1393 diff_aec_system_delay_ms, kMinDiffDelayMs, |
1393 1000, 100); | 1394 1000, 100); |
1394 if (capture_.aec_system_delay_jumps == -1) { | 1395 if (capture_.aec_system_delay_jumps == -1) { |
1395 capture_.aec_system_delay_jumps = 0; // Activate counter if needed. | 1396 capture_.aec_system_delay_jumps = 0; // Activate counter if needed. |
1396 } | 1397 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1542 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); | 1543 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); |
1543 | 1544 |
1544 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), | 1545 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), |
1545 &debug_dump_.num_bytes_left_for_log_, | 1546 &debug_dump_.num_bytes_left_for_log_, |
1546 &crit_debug_, &debug_dump_.capture)); | 1547 &crit_debug_, &debug_dump_.capture)); |
1547 return kNoError; | 1548 return kNoError; |
1548 } | 1549 } |
1549 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1550 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1550 | 1551 |
1551 } // namespace webrtc | 1552 } // namespace webrtc |
OLD | NEW |