Added RTCMediaStreamTrackStats.concealmentEvents

The number of concealment events. This counter increases every time a concealed sample is
synthesized after a non-concealed sample. That is, multiple consecutive concealed samples
will increase the concealedSamples count multiple times but is a single concealment event.

Bug: webrtc:8246
Change-Id: I7ef404edab765218b1f11e3128072c5391e83049
Reviewed-on: https://webrtc-review.googlesource.com/1221
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19881}
This commit is contained in:
Gustaf Ullberg
2017-09-18 09:28:20 +02:00
committed by Commit Bot
parent 35dee81321
commit 9a2e906b0c
20 changed files with 90 additions and 36 deletions

View File

@ -847,7 +847,7 @@ int NetEqImpl::GetAudioInternal(AudioFrame* audio_frame, bool* muted) {
: timestamp_scaler_->ToExternal(playout_timestamp_) -
static_cast<uint32_t>(audio_frame->samples_per_channel_);
audio_frame->num_channels_ = sync_buffer_->Channels();
stats_.ExpandedNoiseSamples(output_size_samples_);
stats_.ExpandedNoiseSamples(output_size_samples_, false);
*muted = true;
return 0;
}
@ -1573,14 +1573,15 @@ int NetEqImpl::DoExpand(bool play_dtmf) {
algorithm_buffer_->Clear();
int return_value = expand_->Process(algorithm_buffer_.get());
size_t length = algorithm_buffer_->Size();
bool is_new_concealment_event = (last_mode_ != kModeExpand);
// Update in-call and post-call statistics.
if (expand_->MuteFactor(0) == 0) {
// Expand operation generates only noise.
stats_.ExpandedNoiseSamples(length);
stats_.ExpandedNoiseSamples(length, is_new_concealment_event);
} else {
// Expand operation generates more than only noise.
stats_.ExpandedVoiceSamples(length);
stats_.ExpandedVoiceSamples(length, is_new_concealment_event);
}
last_mode_ = kModeExpand;