From bf65be543502873987e7f8f31b63a914ac4126de Mon Sep 17 00:00:00 2001 From: michaelt Date: Thu, 15 Dec 2016 06:24:49 -0800 Subject: [PATCH] Wire-up audio BWE with overhead. BUG=webrtc:6638 Review-Url: https://codereview.webrtc.org/2565353002 Cr-Commit-Position: refs/heads/master@{#15632} --- webrtc/voice_engine/channel.cc | 9 +++++++++ webrtc/voice_engine/channel.h | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc index dc93dc7e06..100832de3a 100644 --- a/webrtc/voice_engine/channel.cc +++ b/webrtc/voice_engine/channel.cc @@ -940,6 +940,7 @@ Channel::Channel(int32_t channelId, RtpRtcp::Configuration configuration; configuration.audio = true; configuration.outgoing_transport = this; + configuration.overhead_observer = this; configuration.receive_statistics = rtp_receive_statistics_.get(); configuration.bandwidth_callback = rtcp_observer_.get(); if (pacing_enabled_) { @@ -2881,6 +2882,14 @@ void Channel::SetTransportOverhead(int transport_overhead_per_packet) { _rtpRtcpModule->SetTransportOverhead(transport_overhead_per_packet); } +void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) { + audio_coding_->ModifyEncoder([&](std::unique_ptr* encoder) { + if (*encoder) { + (*encoder)->OnReceivedOverhead(overhead_bytes_per_packet); + } + }); +} + int Channel::RegisterExternalMediaProcessing(ProcessingTypes type, VoEMediaProcess& processObject) { WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h index 4056c7fb56..01907d269b 100644 --- a/webrtc/voice_engine/channel.h +++ b/webrtc/voice_engine/channel.h @@ -144,8 +144,8 @@ class Channel public AudioPacketizationCallback, // receive encoded packets from the // ACM public ACMVADCallback, // receive voice activity from the ACM - public MixerParticipant // supplies output mixer with audio frames -{ + public MixerParticipant, // supplies output mixer with audio frames + public OverheadObserver { public: friend class VoERtcpObserver; @@ -417,6 +417,9 @@ class Channel void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats); void SetTransportOverhead(int transport_overhead_per_packet); + // From OverheadObserver in the RTP/RTCP module + void OnOverheadChanged(size_t overhead_bytes_per_packet) override; + protected: void OnIncomingFractionLoss(int fraction_lost);