Reland "RtpRtcp modules and below: Make media, RTX and FEC SSRCs const"
This is a reland of 17608dc4592fe25c1effdd75bf856f4af251942e Downstream fixed, relanding. Original change's description: > RtpRtcp modules and below: Make media, RTX and FEC SSRCs const > > Downstream usage of SetSsrc() / SetRtxSsrc() should now be gone. Let's > remove them, make the members const, and remove now unnecessary locking. > > Bug: webrtc:10774 > Change-Id: Ie4c1b3935508cf329c5553030f740c565d32e04b > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155660 > Commit-Queue: Erik Språng <sprang@webrtc.org> > Reviewed-by: Niels Moller <nisse@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#29475} TBR=nisse@webrtc.org Bug: webrtc:10774 Change-Id: I759bed3ff1909857696c6d1b13df595a5e552f03 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157049 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29486}
This commit is contained in:
@ -65,6 +65,18 @@ const size_t kMaxNumberOfStoredRrtrs = 200;
|
||||
|
||||
constexpr int32_t kDefaultVideoReportInterval = 1000;
|
||||
constexpr int32_t kDefaultAudioReportInterval = 5000;
|
||||
|
||||
std::set<uint32_t> GetRegisteredSsrcs(const RtpRtcp::Configuration& config) {
|
||||
std::set<uint32_t> ssrcs;
|
||||
ssrcs.insert(config.local_media_ssrc);
|
||||
if (config.rtx_send_ssrc) {
|
||||
ssrcs.insert(*config.rtx_send_ssrc);
|
||||
}
|
||||
if (config.flexfec_sender) {
|
||||
ssrcs.insert(config.flexfec_sender->ssrc());
|
||||
}
|
||||
return ssrcs;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
struct RTCPReceiver::PacketInformation {
|
||||
@ -126,6 +138,8 @@ RTCPReceiver::RTCPReceiver(const RtpRtcp::Configuration& config,
|
||||
: clock_(config.clock),
|
||||
receiver_only_(config.receiver_only),
|
||||
rtp_rtcp_(owner),
|
||||
main_ssrc_(config.local_media_ssrc),
|
||||
registered_ssrcs_(GetRegisteredSsrcs(config)),
|
||||
rtcp_bandwidth_observer_(config.bandwidth_callback),
|
||||
rtcp_intra_frame_observer_(config.intra_frame_callback),
|
||||
rtcp_loss_notification_observer_(config.rtcp_loss_notification_observer),
|
||||
@ -137,7 +151,6 @@ RTCPReceiver::RTCPReceiver(const RtpRtcp::Configuration& config,
|
||||
: (config.audio ? kDefaultAudioReportInterval
|
||||
: kDefaultVideoReportInterval)),
|
||||
// TODO(bugs.webrtc.org/10774): Remove fallback.
|
||||
main_ssrc_(config.local_media_ssrc.value_or(0)),
|
||||
remote_ssrc_(0),
|
||||
remote_sender_rtp_time_(0),
|
||||
xr_rrtr_status_(false),
|
||||
@ -152,15 +165,6 @@ RTCPReceiver::RTCPReceiver(const RtpRtcp::Configuration& config,
|
||||
num_skipped_packets_(0),
|
||||
last_skipped_packets_warning_ms_(clock_->TimeInMilliseconds()) {
|
||||
RTC_DCHECK(owner);
|
||||
if (config.local_media_ssrc) {
|
||||
registered_ssrcs_.insert(*config.local_media_ssrc);
|
||||
}
|
||||
if (config.rtx_send_ssrc) {
|
||||
registered_ssrcs_.insert(*config.rtx_send_ssrc);
|
||||
}
|
||||
if (config.flexfec_sender) {
|
||||
registered_ssrcs_.insert(config.flexfec_sender->ssrc());
|
||||
}
|
||||
}
|
||||
|
||||
RTCPReceiver::~RTCPReceiver() {}
|
||||
@ -194,13 +198,6 @@ uint32_t RTCPReceiver::RemoteSSRC() const {
|
||||
return remote_ssrc_;
|
||||
}
|
||||
|
||||
void RTCPReceiver::SetSsrcs(uint32_t main_ssrc,
|
||||
const std::set<uint32_t>& registered_ssrcs) {
|
||||
rtc::CritScope lock(&rtcp_receiver_lock_);
|
||||
main_ssrc_ = main_ssrc;
|
||||
registered_ssrcs_ = registered_ssrcs;
|
||||
}
|
||||
|
||||
int32_t RTCPReceiver::RTT(uint32_t remote_ssrc,
|
||||
int64_t* last_rtt_ms,
|
||||
int64_t* avg_rtt_ms,
|
||||
|
||||
Reference in New Issue
Block a user