Delete unneeded Rtx methods from RTPPayloadRegistry.

Let RtpVideoStreamReceiver check its config instead.

Bug: webrtc:8995
Change-Id: I0d834d27ceb9de08009a8a67b518c5357dc3f9f0
Reviewed-on: https://webrtc-review.googlesource.com/61300
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22403}
This commit is contained in:
Niels Möller
2018-03-12 14:23:41 +01:00
committed by Commit Bot
parent be7b88c145
commit e63afff364
3 changed files with 2 additions and 38 deletions

View File

@ -46,12 +46,6 @@ class RTPPayloadRegistry {
int32_t ReceivePayloadType(const VideoCodec& video_codec, int32_t ReceivePayloadType(const VideoCodec& video_codec,
int8_t* payload_type) const; int8_t* payload_type) const;
bool RtxEnabled() const;
void SetRtxSsrc(uint32_t ssrc);
bool GetRtxSsrc(uint32_t* ssrc) const;
bool IsRed(const RTPHeader& header) const; bool IsRed(const RTPHeader& header) const;
int GetPayloadTypeFrequency(uint8_t payload_type) const; int GetPayloadTypeFrequency(uint8_t payload_type) const;
@ -100,12 +94,6 @@ class RTPPayloadRegistry {
std::map<int, RtpUtility::Payload> payload_type_map_; std::map<int, RtpUtility::Payload> payload_type_map_;
int8_t last_received_payload_type_; int8_t last_received_payload_type_;
int8_t last_received_media_payload_type_; int8_t last_received_media_payload_type_;
bool rtx_;
uint32_t ssrc_rtx_;
// Only warn once per payload type, if an RTX packet is received but
// no associated payload type found in |rtx_payload_type_map_|.
std::set<int> payload_types_with_suppressed_warnings_
RTC_GUARDED_BY(crit_sect_);
// As a first step in splitting this class up in separate cases for audio and // As a first step in splitting this class up in separate cases for audio and
// video, DCHECK that no instance is used for both audio and video. // video, DCHECK that no instance is used for both audio and video.

View File

@ -104,9 +104,7 @@ bool IsPayloadTypeValid(int8_t payload_type) {
RTPPayloadRegistry::RTPPayloadRegistry() RTPPayloadRegistry::RTPPayloadRegistry()
: last_received_payload_type_(-1), : last_received_payload_type_(-1),
last_received_media_payload_type_(-1), last_received_media_payload_type_(-1) {}
rtx_(false),
ssrc_rtx_(0) {}
RTPPayloadRegistry::~RTPPayloadRegistry() = default; RTPPayloadRegistry::~RTPPayloadRegistry() = default;
@ -261,23 +259,6 @@ int32_t RTPPayloadRegistry::ReceivePayloadType(const VideoCodec& video_codec,
return -1; return -1;
} }
bool RTPPayloadRegistry::RtxEnabled() const {
rtc::CritScope cs(&crit_sect_);
return rtx_;
}
void RTPPayloadRegistry::SetRtxSsrc(uint32_t ssrc) {
rtc::CritScope cs(&crit_sect_);
ssrc_rtx_ = ssrc;
rtx_ = true;
}
bool RTPPayloadRegistry::GetRtxSsrc(uint32_t* ssrc) const {
rtc::CritScope cs(&crit_sect_);
*ssrc = ssrc_rtx_;
return rtx_;
}
bool RTPPayloadRegistry::IsRed(const RTPHeader& header) const { bool RTPPayloadRegistry::IsRed(const RTPHeader& header) const {
rtc::CritScope cs(&crit_sect_); rtc::CritScope cs(&crit_sect_);
auto it = payload_type_map_.find(header.payloadType); auto it = payload_type_map_.find(header.payloadType);

View File

@ -138,11 +138,6 @@ RtpVideoStreamReceiver::RtpVideoStreamReceiver(
: kDefaultMaxReorderingThreshold; : kDefaultMaxReorderingThreshold;
rtp_receive_statistics_->SetMaxReorderingThreshold(max_reordering_threshold); rtp_receive_statistics_->SetMaxReorderingThreshold(max_reordering_threshold);
if (config_.rtp.rtx_ssrc) {
// Needed for rtp_payload_registry_.RtxEnabled().
rtp_payload_registry_.SetRtxSsrc(config_.rtp.rtx_ssrc);
}
if (IsUlpfecEnabled()) { if (IsUlpfecEnabled()) {
VideoCodec ulpfec_codec = {}; VideoCodec ulpfec_codec = {};
ulpfec_codec.codecType = kVideoCodecULPFEC; ulpfec_codec.codecType = kVideoCodecULPFEC;
@ -605,7 +600,7 @@ bool RtpVideoStreamReceiver::IsPacketInOrder(const RTPHeader& header) const {
bool RtpVideoStreamReceiver::IsPacketRetransmitted(const RTPHeader& header, bool RtpVideoStreamReceiver::IsPacketRetransmitted(const RTPHeader& header,
bool in_order) const { bool in_order) const {
// Retransmissions are handled separately if RTX is enabled. // Retransmissions are handled separately if RTX is enabled.
if (rtp_payload_registry_.RtxEnabled()) if (config_.rtp.rtx_ssrc != 0)
return false; return false;
StreamStatistician* statistician = StreamStatistician* statistician =
rtp_receive_statistics_->GetStatistician(header.ssrc); rtp_receive_statistics_->GetStatistician(header.ssrc);