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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc

Issue 3000713002: Add audio_level member to RtpSource and set it from RtpReceiverImpl::IncomingRtpPacket. (Closed)
Patch Set: Style feedback from deadbeef Created 3 years, 4 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
Index: webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc
index 20f57460a68ffc1cb30d84b43e46dd2361400c7f..ed0383f0d66a89808923a736065668ec9f60dd06 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.cc
@@ -163,7 +163,11 @@ bool RtpReceiverImpl::IncomingRtpPacket(
webrtc_rtp_header.header = rtp_header;
CheckCSRC(webrtc_rtp_header);
- UpdateSources();
+ auto audio_level =
+ rtp_header.extension.hasAudioLevel
+ ? rtc::Optional<uint8_t>(rtp_header.extension.audioLevel)
+ : rtc::Optional<uint8_t>();
+ UpdateSources(audio_level);
size_t payload_data_length = payload_length - rtp_header.paddingLength;
@@ -500,7 +504,8 @@ void RtpReceiverImpl::CheckCSRC(const WebRtcRTPHeader& rtp_header) {
}
}
-void RtpReceiverImpl::UpdateSources() {
+void RtpReceiverImpl::UpdateSources(
+ const rtc::Optional<uint8_t>& ssrc_audio_level) {
rtc::CritScope lock(&critical_section_rtp_receiver_);
int64_t now_ms = clock_->TimeInMilliseconds();
@@ -527,6 +532,8 @@ void RtpReceiverImpl::UpdateSources() {
ssrc_sources_.rbegin()->update_timestamp_ms(now_ms);
}
+ ssrc_sources_.back().set_audio_level(ssrc_audio_level);
+
RemoveOutdatedSources(now_ms);
}
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698