Reland "RtpRtcp modules and below: Make media, RTX and FEC SSRCs const"
This is a reland of 17608dc4592fe25c1effdd75bf856f4af251942e Downstream test now fixed. As a precaution, also avoid DCHECKS for non-zero SSRC. First patch set is reland, second makes checks more lenient. 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} Bug: webrtc:10774 Change-Id: I540b49a31a31e98d87f02ae04083d5206e71c1b2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157100 Reviewed-by: Niels Moller <nisse@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29491}
This commit is contained in:
@ -150,6 +150,7 @@ class RTCPSender::RtcpContext {
|
||||
|
||||
RTCPSender::RTCPSender(const RtpRtcp::Configuration& config)
|
||||
: audio_(config.audio),
|
||||
ssrc_(config.local_media_ssrc),
|
||||
clock_(config.clock),
|
||||
random_(clock_->TimeInMicroseconds()),
|
||||
method_(RtcpMode::kOff),
|
||||
@ -164,7 +165,6 @@ RTCPSender::RTCPSender(const RtpRtcp::Configuration& config)
|
||||
timestamp_offset_(0),
|
||||
last_rtp_timestamp_(0),
|
||||
last_frame_capture_time_ms_(-1),
|
||||
ssrc_(config.local_media_ssrc.value_or(0)),
|
||||
remote_ssrc_(0),
|
||||
receive_statistics_(config.receive_statistics),
|
||||
|
||||
@ -331,23 +331,6 @@ void RTCPSender::SetRtpClockRate(int8_t payload_type, int rtp_clock_rate_hz) {
|
||||
rtp_clock_rates_khz_[payload_type] = rtp_clock_rate_hz / 1000;
|
||||
}
|
||||
|
||||
uint32_t RTCPSender::SSRC() const {
|
||||
rtc::CritScope lock(&critical_section_rtcp_sender_);
|
||||
return ssrc_;
|
||||
}
|
||||
|
||||
void RTCPSender::SetSSRC(uint32_t ssrc) {
|
||||
rtc::CritScope lock(&critical_section_rtcp_sender_);
|
||||
|
||||
if (ssrc_ != 0 && ssrc != ssrc_) {
|
||||
// not first SetSSRC, probably due to a collision
|
||||
// schedule a new RTCP report
|
||||
// make sure that we send a RTP packet
|
||||
next_time_to_send_rtcp_ = clock_->TimeInMilliseconds() + 100;
|
||||
}
|
||||
ssrc_ = ssrc;
|
||||
}
|
||||
|
||||
void RTCPSender::SetRemoteSSRC(uint32_t ssrc) {
|
||||
rtc::CritScope lock(&critical_section_rtcp_sender_);
|
||||
remote_ssrc_ = ssrc;
|
||||
|
||||
Reference in New Issue
Block a user