Change ReceiveStatistics to implement RtpPacketSinkInterface, part 1
Add new method OnRtpPacket, but leave ReceiveStatisticsImpl::IncomingPacket and most of the implementation unchanged. Deleting the old method and converting implementation from RTPHeader to RtpPacketreceived is planned for a followup, after downstream code is updated. Bug: webrtc:7135, webrtc:8016 Change-Id: I697ec12804618859f8d69415622d1b957e1d0847 Reviewed-on: https://webrtc-review.googlesource.com/100104 Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24889}
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "modules/remote_bitrate_estimator/test/bwe_test_logging.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
||||
#include "modules/rtp_rtcp/source/time_util.h"
|
||||
#include "rtc_base/logging.h"
|
||||
@ -372,6 +373,12 @@ ReceiveStatisticsImpl::~ReceiveStatisticsImpl() {
|
||||
}
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::OnRtpPacket(const RtpPacketReceived& packet) {
|
||||
RTPHeader header;
|
||||
packet.GetHeader(&header);
|
||||
IncomingPacket(header, packet.size());
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::IncomingPacket(const RTPHeader& header,
|
||||
size_t packet_length) {
|
||||
StreamStatisticianImpl* impl;
|
||||
@ -394,18 +401,19 @@ void ReceiveStatisticsImpl::IncomingPacket(const RTPHeader& header,
|
||||
impl->IncomingPacket(header, packet_length);
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::FecPacketReceived(const RTPHeader& header,
|
||||
size_t packet_length) {
|
||||
void ReceiveStatisticsImpl::FecPacketReceived(const RtpPacketReceived& packet) {
|
||||
StreamStatisticianImpl* impl;
|
||||
{
|
||||
rtc::CritScope cs(&receive_statistics_lock_);
|
||||
auto it = statisticians_.find(header.ssrc);
|
||||
auto it = statisticians_.find(packet.Ssrc());
|
||||
// Ignore FEC if it is the first packet.
|
||||
if (it == statisticians_.end())
|
||||
return;
|
||||
impl = it->second;
|
||||
}
|
||||
impl->FecPacketReceived(header, packet_length);
|
||||
RTPHeader header;
|
||||
packet.GetHeader(&header);
|
||||
impl->FecPacketReceived(header, packet.size());
|
||||
}
|
||||
|
||||
StreamStatistician* ReceiveStatisticsImpl::GetStatistician(
|
||||
|
||||
Reference in New Issue
Block a user