mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 22:00:47 +01:00

This new parallel GetStatistics function uses Optionals to indicate if stats are valid or not, and no longer relies on default values. It also takes an argument to indicate if receive streams are present, and if not several stats will not be set. Bug: b/67926135 Change-Id: I175de1c65c414bea6ec9ca8b0b16f07cb2308d9f Reviewed-on: https://webrtc-review.googlesource.com/17942 Commit-Queue: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20789}
40 lines
1.6 KiB
C++
40 lines
1.6 KiB
C++
/*
|
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "api/mediastreaminterface.h"
|
|
|
|
namespace webrtc {
|
|
|
|
const char MediaStreamTrackInterface::kVideoKind[] = "video";
|
|
const char MediaStreamTrackInterface::kAudioKind[] = "audio";
|
|
|
|
// TODO(ivoc): Remove this when the function becomes pure virtual.
|
|
AudioProcessorInterface::AudioProcessorStatistics
|
|
AudioProcessorInterface::GetStats(bool /*has_remote_tracks*/) {
|
|
AudioProcessorStats stats;
|
|
GetStats(&stats);
|
|
AudioProcessorStatistics new_stats;
|
|
new_stats.aec_divergent_filter_fraction =
|
|
rtc::Optional<double>(stats.aec_divergent_filter_fraction);
|
|
new_stats.aec_quality_min = rtc::Optional<double>(stats.aec_quality_min);
|
|
new_stats.echo_delay_median_ms =
|
|
rtc::Optional<int32_t>(stats.echo_delay_median_ms);
|
|
new_stats.echo_delay_std_ms = rtc::Optional<int32_t>(stats.echo_delay_std_ms);
|
|
new_stats.echo_return_loss = rtc::Optional<double>(stats.echo_return_loss);
|
|
new_stats.echo_return_loss_enhancement =
|
|
rtc::Optional<double>(stats.echo_return_loss_enhancement);
|
|
new_stats.residual_echo_likelihood =
|
|
rtc::Optional<double>(stats.residual_echo_likelihood);
|
|
new_stats.residual_echo_likelihood_recent_max =
|
|
rtc::Optional<double>(stats.residual_echo_likelihood_recent_max);
|
|
return new_stats;
|
|
}
|
|
|
|
} // namespace webrtc
|