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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 2589743002: Make OverheadObserver::OnOverheadChanged count RTP headers only (Closed)
Patch Set: Add explicit cast. Created 3 years, 11 months 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
« no previous file with comments | « 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..84d7a204b19b49e1b4d85728e21b4f02a779ff08 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,25 @@ 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(size_t transport_overhead_per_packet) {
+ transport_overhead_per_packet_ = transport_overhead_per_packet;
+ UpdateOverheadForEncoder();
+}
+
+void Channel::OnOverheadChanged(size_t overhead_bytes_per_packet) {
+ rtp_overhead_per_packet_ = overhead_bytes_per_packet;
+ UpdateOverheadForEncoder();
+}
+
int Channel::RegisterExternalMediaProcessing(ProcessingTypes type,
VoEMediaProcess& processObject) {
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698