Remove ModuleRtpRtcpImpl2::LastReceivedNTP

`LastReceivedNTP()` does not need to be part of the public members of
`ModuleRtpRtcpImpl` and `ModuleRtpRtcpImpl2` since it is used only
once in the same class.

This change is requried by the child CL [1] which adds a public getter
needed to add remote-outbound stats.

[1] https://webrtc-review.googlesource.com/c/src/+/211041

Bug: webrtc:12529
Change-Id: I82cfea5ee795de37fffa3d759ce9f581ca775d55
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211043
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33420}
This commit is contained in:
Alessio Bazzica
2021-03-10 14:52:35 +01:00
committed by Commit Bot
parent ee8cd20ec5
commit 79011ef4a7
4 changed files with 20 additions and 46 deletions

View File

@ -312,8 +312,16 @@ RTCPSender::FeedbackState ModuleRtpRtcpImpl::GetFeedbackState() {
}
state.receiver = &rtcp_receiver_;
LastReceivedNTP(&state.last_rr_ntp_secs, &state.last_rr_ntp_frac,
&state.remote_sr);
uint32_t received_ntp_secs = 0;
uint32_t received_ntp_frac = 0;
state.remote_sr = 0;
if (rtcp_receiver_.NTP(&received_ntp_secs, &received_ntp_frac,
/*rtcp_arrival_time_secs=*/&state.last_rr_ntp_secs,
/*rtcp_arrival_time_frac=*/&state.last_rr_ntp_frac,
/*rtcp_timestamp=*/nullptr)) {
state.remote_sr = ((received_ntp_secs & 0x0000ffff) << 16) +
((received_ntp_frac & 0xffff0000) >> 16);
}
state.last_xr_rtis = rtcp_receiver_.ConsumeReceivedXrReferenceTimeInfo();
@ -702,23 +710,6 @@ void ModuleRtpRtcpImpl::OnReceivedRtcpReportBlocks(
}
}
bool ModuleRtpRtcpImpl::LastReceivedNTP(
uint32_t* rtcp_arrival_time_secs, // When we got the last report.
uint32_t* rtcp_arrival_time_frac,
uint32_t* remote_sr) const {
// Remote SR: NTP inside the last received (mid 16 bits from sec and frac).
uint32_t ntp_secs = 0;
uint32_t ntp_frac = 0;
if (!rtcp_receiver_.NTP(&ntp_secs, &ntp_frac, rtcp_arrival_time_secs,
rtcp_arrival_time_frac, NULL)) {
return false;
}
*remote_sr =
((ntp_secs & 0x0000ffff) << 16) + ((ntp_frac & 0xffff0000) >> 16);
return true;
}
void ModuleRtpRtcpImpl::set_rtt_ms(int64_t rtt_ms) {
{
MutexLock lock(&mutex_rtt_);

View File

@ -228,10 +228,6 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
bool decodability_flag,
bool buffering_allowed) override;
bool LastReceivedNTP(uint32_t* NTPsecs,
uint32_t* NTPfrac,
uint32_t* remote_sr) const;
RtpSendRates GetSendRates() const override;
void OnReceivedNack(

View File

@ -260,8 +260,16 @@ RTCPSender::FeedbackState ModuleRtpRtcpImpl2::GetFeedbackState() {
}
state.receiver = &rtcp_receiver_;
LastReceivedNTP(&state.last_rr_ntp_secs, &state.last_rr_ntp_frac,
&state.remote_sr);
uint32_t received_ntp_secs = 0;
uint32_t received_ntp_frac = 0;
state.remote_sr = 0;
if (rtcp_receiver_.NTP(&received_ntp_secs, &received_ntp_frac,
/*rtcp_arrival_time_secs=*/&state.last_rr_ntp_secs,
/*rtcp_arrival_time_frac=*/&state.last_rr_ntp_frac,
/*rtcp_timestamp=*/nullptr)) {
state.remote_sr = ((received_ntp_secs & 0x0000ffff) << 16) +
((received_ntp_frac & 0xffff0000) >> 16);
}
state.last_xr_rtis = rtcp_receiver_.ConsumeReceivedXrReferenceTimeInfo();
@ -668,23 +676,6 @@ void ModuleRtpRtcpImpl2::OnReceivedRtcpReportBlocks(
}
}
bool ModuleRtpRtcpImpl2::LastReceivedNTP(
uint32_t* rtcp_arrival_time_secs, // When we got the last report.
uint32_t* rtcp_arrival_time_frac,
uint32_t* remote_sr) const {
// Remote SR: NTP inside the last received (mid 16 bits from sec and frac).
uint32_t ntp_secs = 0;
uint32_t ntp_frac = 0;
if (!rtcp_receiver_.NTP(&ntp_secs, &ntp_frac, rtcp_arrival_time_secs,
rtcp_arrival_time_frac, NULL)) {
return false;
}
*remote_sr =
((ntp_secs & 0x0000ffff) << 16) + ((ntp_frac & 0xffff0000) >> 16);
return true;
}
void ModuleRtpRtcpImpl2::set_rtt_ms(int64_t rtt_ms) {
RTC_DCHECK_RUN_ON(worker_queue_);
{

View File

@ -240,10 +240,6 @@ class ModuleRtpRtcpImpl2 final : public RtpRtcpInterface,
bool decodability_flag,
bool buffering_allowed) override;
bool LastReceivedNTP(uint32_t* NTPsecs,
uint32_t* NTPfrac,
uint32_t* remote_sr) const;
RtpSendRates GetSendRates() const override;
void OnReceivedNack(