From cd188f6031da8977e821f4624b58f5a08f982fd1 Mon Sep 17 00:00:00 2001 From: brandtr Date: Tue, 15 Nov 2016 08:21:52 -0800 Subject: [PATCH] Make SendStatisticsProxy let through FlexFEC packets. This is initial work to get the stats working for FlexFEC. BUG=webrtc:5654 Review-Url: https://codereview.webrtc.org/2498393002 Cr-Commit-Position: refs/heads/master@{#15089} --- webrtc/video/send_statistics_proxy.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc index a996976e5d..1f0ee2cb7a 100644 --- a/webrtc/video/send_statistics_proxy.cc +++ b/webrtc/video/send_statistics_proxy.cc @@ -344,7 +344,8 @@ void SendStatisticsProxy::UmaSamplesContainer::UpdateHistograms( static_cast(rtx.transmitted.TotalBytes() * 8 / elapsed_sec / 1000)); } - if (rtp_config.ulpfec.red_payload_type != -1) { + if (rtp_config.flexfec.flexfec_payload_type != -1 || + rtp_config.ulpfec.red_payload_type != -1) { RTC_HISTOGRAMS_COUNTS_10000(kIndex, uma_prefix_ + "FecBitrateSentInKbps", static_cast(rtp_rtx.fec.TotalBytes() * @@ -418,15 +419,15 @@ VideoSendStream::StreamStats* SendStatisticsProxy::GetStatsEntry( if (it != stats_.substreams.end()) return &it->second; - bool is_rtx = false; - if (std::find(rtp_config_.ssrcs.begin(), rtp_config_.ssrcs.end(), ssrc) == - rtp_config_.ssrcs.end()) { - if (std::find(rtp_config_.rtx.ssrcs.begin(), rtp_config_.rtx.ssrcs.end(), - ssrc) == rtp_config_.rtx.ssrcs.end()) { - return nullptr; - } - is_rtx = true; - } + bool is_media = std::find(rtp_config_.ssrcs.begin(), rtp_config_.ssrcs.end(), + ssrc) != rtp_config_.ssrcs.end(); + bool is_flexfec = rtp_config_.flexfec.flexfec_payload_type != -1 && + ssrc == rtp_config_.flexfec.flexfec_ssrc; + bool is_rtx = + std::find(rtp_config_.rtx.ssrcs.begin(), rtp_config_.rtx.ssrcs.end(), + ssrc) != rtp_config_.rtx.ssrcs.end(); + if (!is_media && !is_flexfec && !is_rtx) + return nullptr; // Insert new entry and return ptr. VideoSendStream::StreamStats* entry = &stats_.substreams[ssrc];