Add new UMA metric for NetEq target buffer delay

The UMA metric will log the same information that goes into the
googPreferredJitterBufferMs stat.

Bug: webrtc:8488
Change-Id: I4e4e1e362dd42377105d52d2c4cd49c1ecb1a90d
Reviewed-on: https://webrtc-review.googlesource.com/26740
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20923}
This commit is contained in:
Henrik Lundin 2017-11-29 09:14:04 +01:00 committed by Commit Bot
parent 4e70a72571
commit abbff89b29
8 changed files with 25 additions and 3 deletions

View File

@ -300,6 +300,10 @@ int AcmReceiver::FilteredCurrentDelayMs() const {
return neteq_->FilteredCurrentDelayMs();
}
int AcmReceiver::TargetDelayMs() const {
return neteq_->TargetDelayMs();
}
int AcmReceiver::LastAudioCodec(CodecInst* codec) const {
rtc::CritScope lock(&crit_sect_);
if (!last_audio_decoder_) {

View File

@ -204,6 +204,10 @@ class AcmReceiver {
//
int FilteredCurrentDelayMs() const;
// Returns the current target delay for NetEq in ms.
//
int TargetDelayMs() const;
//
// Get the audio codec associated with the last non-CNG/non-DTMF received
// payload. If no non-CNG/non-DTMF packet is received -1 is returned,

View File

@ -164,6 +164,8 @@ class AudioCodingModuleImpl final : public AudioCodingModule {
int FilteredCurrentDelayMs() const override;
int TargetDelayMs() const override;
// Get 10 milliseconds of raw audio data to play out, and
// automatic resample to the requested frequency if > 0.
int PlayoutData10Ms(int desired_freq_hz,
@ -1193,6 +1195,10 @@ int AudioCodingModuleImpl::FilteredCurrentDelayMs() const {
return receiver_.FilteredCurrentDelayMs();
}
int AudioCodingModuleImpl::TargetDelayMs() const {
return receiver_.TargetDelayMs();
}
bool AudioCodingModuleImpl::HaveValidEncoder(const char* caller_name) const {
if (!encoder_stack_) {
RTC_LOG(LS_ERROR) << caller_name << " failed: No send codec is registered.";

View File

@ -655,6 +655,12 @@ class AudioCodingModule {
//
virtual int FilteredCurrentDelayMs() const = 0;
///////////////////////////////////////////////////////////////////////////
// int FilteredCurrentDelayMs()
// Returns the current target delay for NetEq in ms.
//
virtual int TargetDelayMs() const = 0;
///////////////////////////////////////////////////////////////////////////
// int32_t PlayoutData10Ms(
// Get 10 milliseconds of raw audio data for playout, at the given sampling

View File

@ -208,7 +208,7 @@ class NetEq {
// Returns the current target delay in ms. This includes any extra delay
// requested through SetMinimumDelay.
virtual int TargetDelayMs() = 0;
virtual int TargetDelayMs() const = 0;
// Returns the current total delay (packet buffer and sync buffer) in ms.
virtual int CurrentDelayMs() const = 0;

View File

@ -311,7 +311,7 @@ int NetEqImpl::SetTargetDelay() {
return kNotImplemented;
}
int NetEqImpl::TargetDelayMs() {
int NetEqImpl::TargetDelayMs() const {
rtc::CritScope lock(&crit_sect_);
RTC_DCHECK(delay_manager_.get());
// The value from TargetLevel() is in number of packets, represented in Q8.

View File

@ -161,7 +161,7 @@ class NetEqImpl : public webrtc::NetEq {
int SetTargetDelay() override;
int TargetDelayMs() override;
int TargetDelayMs() const override;
int CurrentDelayMs() const override;

View File

@ -556,6 +556,8 @@ AudioMixer::Source::AudioFrameInfo Channel::GetAudioFrameWithInfo(
}
{
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Audio.TargetJitterBufferDelayMs",
audio_coding_->TargetDelayMs());
const int jitter_buffer_delay = audio_coding_->FilteredCurrentDelayMs();
rtc::CritScope lock(&video_sync_lock_);
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Audio.ReceiverDelayEstimateMs",