Chromium Code Reviews| 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..2a831d2614b36def605ec6394f670ac6500b3633 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,7 @@ void RtpReceiverImpl::CheckCSRC(const WebRtcRTPHeader& rtp_header) { |
| } |
| } |
| -void RtpReceiverImpl::UpdateSources() { |
| +void RtpReceiverImpl::UpdateSources(const rtc::Optional<uint8_t>& audio_level) { |
|
Taylor Brandstetter
2017/08/24 20:40:57
nit: Since it's also possible to have CSRC-specifi
Zach Stein
2017/08/24 21:14:53
Done.
|
| rtc::CritScope lock(&critical_section_rtp_receiver_); |
| int64_t now_ms = clock_->TimeInMilliseconds(); |
| @@ -527,6 +531,8 @@ void RtpReceiverImpl::UpdateSources() { |
| ssrc_sources_.rbegin()->update_timestamp_ms(now_ms); |
| } |
| + ssrc_sources_.back().set_audio_level(audio_level); |
| + |
| RemoveOutdatedSources(now_ms); |
| } |