Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2589743002: Make OverheadObserver::OnOverheadChanged count RTP headers only (Closed)
Patch Set: Address easy nits. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webrtc/voice_engine/channel.h ('K') | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 100832de3adeb2dc986cd255dc271a109ea6bbb7..14c63538279670d5502de2244552bb00d1d63a25 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -914,6 +914,8 @@ Channel::Channel(int32_t channelId,
_lastLocalTimeStamp(0),
_lastPayloadType(0),
_includeAudioLevelIndication(false),
+ _transport_overhead_per_packet(0),
+ _rtp_overhead_per_packet(0),
_outputSpeechType(AudioFrame::kNormalSpeech),
restored_packet_in_use_(false),
rtcp_observer_(new VoERtcpObserver(this)),
@@ -2878,18 +2880,26 @@ void Channel::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) {
rtcp_rtt_stats_proxy_->SetRtcpRttStats(rtcp_rtt_stats);
}
-void Channel::SetTransportOverhead(int transport_overhead_per_packet) {
- _rtpRtcpModule->SetTransportOverhead(transport_overhead_per_packet);
-}
-
-void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) {
+void Channel::UpdateOverheadForEncoder() {
audio_coding_->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
if (*encoder) {
- (*encoder)->OnReceivedOverhead(overhead_bytes_per_packet);
+ (*encoder)->OnReceivedOverhead(
+ _transport_overhead_per_packet + _rtp_overhead_per_packet);
}
});
}
+void Channel::SetTransportOverhead(int transport_overhead_per_packet) {
+ _transport_overhead_per_packet = transport_overhead_per_packet;
+ UpdateOverheadForEncoder();
+}
+
+
+void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) {
the sun 2016/12/21 10:33:02 Not strictly part of this CL, but... "transport_ov
stefan-webrtc 2016/12/21 11:31:43 It's important for really low bitrates where the o
+ _rtp_overhead_per_packet = overhead_bytes_per_packet;
+ UpdateOverheadForEncoder();
+}
+
int Channel::RegisterExternalMediaProcessing(ProcessingTypes type,
VoEMediaProcess& processObject) {
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
« webrtc/voice_engine/channel.h ('K') | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698