Remove GetSendSideDelay from RtpRtcp.
These stats are reported using a callback either way, removing a getter + an old related deadlock suppression. BUG=1695, 2999 R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/50119004 Cr-Commit-Position: refs/heads/master@{#9314}
This commit is contained in:
@ -73,7 +73,6 @@ char kTSanDefaultSuppressions[] =
|
|||||||
"deadlock:webrtc::vcm::VideoReceiver::RegisterPacketRequestCallback\n"
|
"deadlock:webrtc::vcm::VideoReceiver::RegisterPacketRequestCallback\n"
|
||||||
"deadlock:webrtc::ViECaptureImpl::ConnectCaptureDevice\n"
|
"deadlock:webrtc::ViECaptureImpl::ConnectCaptureDevice\n"
|
||||||
"deadlock:webrtc::ViEChannel::StartSend\n"
|
"deadlock:webrtc::ViEChannel::StartSend\n"
|
||||||
"deadlock:webrtc::ViECodecImpl::GetSendSideDelay\n"
|
|
||||||
"deadlock:webrtc::ViEEncoder::OnLocalSsrcChanged\n"
|
"deadlock:webrtc::ViEEncoder::OnLocalSsrcChanged\n"
|
||||||
|
|
||||||
// TODO(pbos): Trace events are racy due to lack of proper POD atomics.
|
// TODO(pbos): Trace events are racy due to lack of proper POD atomics.
|
||||||
|
@ -309,9 +309,6 @@ class RtpRtcp : public Module {
|
|||||||
|
|
||||||
virtual size_t TimeToSendPadding(size_t bytes) = 0;
|
virtual size_t TimeToSendPadding(size_t bytes) = 0;
|
||||||
|
|
||||||
virtual bool GetSendSideDelay(int* avg_send_delay_ms,
|
|
||||||
int* max_send_delay_ms) const = 0;
|
|
||||||
|
|
||||||
// Called on generation of new statistics after an RTP send.
|
// Called on generation of new statistics after an RTP send.
|
||||||
virtual void RegisterSendChannelRtpStatisticsCallback(
|
virtual void RegisterSendChannelRtpStatisticsCallback(
|
||||||
StreamDataCountersCallback* callback) = 0;
|
StreamDataCountersCallback* callback) = 0;
|
||||||
|
@ -126,8 +126,6 @@ class MockRtpRtcp : public RtpRtcp {
|
|||||||
bool retransmission));
|
bool retransmission));
|
||||||
MOCK_METHOD1(TimeToSendPadding,
|
MOCK_METHOD1(TimeToSendPadding,
|
||||||
size_t(size_t bytes));
|
size_t(size_t bytes));
|
||||||
MOCK_CONST_METHOD2(GetSendSideDelay,
|
|
||||||
bool(int* avg_send_delay_ms, int* max_send_delay_ms));
|
|
||||||
MOCK_METHOD2(RegisterRtcpObservers,
|
MOCK_METHOD2(RegisterRtcpObservers,
|
||||||
void(RtcpIntraFrameObserver* intraFrameCallback,
|
void(RtcpIntraFrameObserver* intraFrameCallback,
|
||||||
RtcpBandwidthObserver* bandwidthCallback));
|
RtcpBandwidthObserver* bandwidthCallback));
|
||||||
|
@ -429,13 +429,6 @@ size_t ModuleRtpRtcpImpl::TimeToSendPadding(size_t bytes) {
|
|||||||
return rtp_sender_.TimeToSendPadding(bytes);
|
return rtp_sender_.TimeToSendPadding(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModuleRtpRtcpImpl::GetSendSideDelay(int* avg_send_delay_ms,
|
|
||||||
int* max_send_delay_ms) const {
|
|
||||||
DCHECK(avg_send_delay_ms);
|
|
||||||
DCHECK(max_send_delay_ms);
|
|
||||||
return rtp_sender_.GetSendSideDelay(avg_send_delay_ms, max_send_delay_ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t ModuleRtpRtcpImpl::MaxPayloadLength() const {
|
uint16_t ModuleRtpRtcpImpl::MaxPayloadLength() const {
|
||||||
return rtp_sender_.MaxPayloadLength();
|
return rtp_sender_.MaxPayloadLength();
|
||||||
}
|
}
|
||||||
|
@ -122,9 +122,6 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
|
|||||||
// less than |bytes|.
|
// less than |bytes|.
|
||||||
size_t TimeToSendPadding(size_t bytes) override;
|
size_t TimeToSendPadding(size_t bytes) override;
|
||||||
|
|
||||||
bool GetSendSideDelay(int* avg_send_delay_ms,
|
|
||||||
int* max_send_delay_ms) const override;
|
|
||||||
|
|
||||||
// RTCP part.
|
// RTCP part.
|
||||||
|
|
||||||
// Get RTCP status.
|
// Get RTCP status.
|
||||||
|
@ -219,23 +219,6 @@ uint32_t RTPSender::NackOverheadRate() const {
|
|||||||
return nack_bitrate_.BitrateLast();
|
return nack_bitrate_.BitrateLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RTPSender::GetSendSideDelay(int* avg_send_delay_ms,
|
|
||||||
int* max_send_delay_ms) const {
|
|
||||||
CriticalSectionScoped lock(statistics_crit_.get());
|
|
||||||
SendDelayMap::const_iterator it = send_delays_.upper_bound(
|
|
||||||
clock_->TimeInMilliseconds() - kSendSideDelayWindowMs);
|
|
||||||
if (it == send_delays_.end())
|
|
||||||
return false;
|
|
||||||
int num_delays = 0;
|
|
||||||
for (; it != send_delays_.end(); ++it) {
|
|
||||||
*max_send_delay_ms = std::max(*max_send_delay_ms, it->second);
|
|
||||||
*avg_send_delay_ms += it->second;
|
|
||||||
++num_delays;
|
|
||||||
}
|
|
||||||
*avg_send_delay_ms = (*avg_send_delay_ms + num_delays / 2) / num_delays;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t RTPSender::SetTransmissionTimeOffset(int32_t transmission_time_offset) {
|
int32_t RTPSender::SetTransmissionTimeOffset(int32_t transmission_time_offset) {
|
||||||
if (transmission_time_offset > (0x800000 - 1) ||
|
if (transmission_time_offset > (0x800000 - 1) ||
|
||||||
transmission_time_offset < -(0x800000 - 1)) { // Word24.
|
transmission_time_offset < -(0x800000 - 1)) { // Word24.
|
||||||
@ -1061,6 +1044,9 @@ int32_t RTPSender::SendToNetwork(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RTPSender::UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms) {
|
void RTPSender::UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms) {
|
||||||
|
if (!send_side_delay_observer_)
|
||||||
|
return;
|
||||||
|
|
||||||
uint32_t ssrc;
|
uint32_t ssrc;
|
||||||
int avg_delay_ms = 0;
|
int avg_delay_ms = 0;
|
||||||
int max_delay_ms = 0;
|
int max_delay_ms = 0;
|
||||||
@ -1075,12 +1061,19 @@ void RTPSender::UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms) {
|
|||||||
send_delays_.erase(send_delays_.begin(),
|
send_delays_.erase(send_delays_.begin(),
|
||||||
send_delays_.lower_bound(now_ms -
|
send_delays_.lower_bound(now_ms -
|
||||||
kSendSideDelayWindowMs));
|
kSendSideDelayWindowMs));
|
||||||
|
int num_delays = 0;
|
||||||
|
for (auto it = send_delays_.upper_bound(now_ms - kSendSideDelayWindowMs);
|
||||||
|
it != send_delays_.end(); ++it) {
|
||||||
|
max_delay_ms = std::max(max_delay_ms, it->second);
|
||||||
|
avg_delay_ms += it->second;
|
||||||
|
++num_delays;
|
||||||
|
}
|
||||||
|
if (num_delays == 0)
|
||||||
|
return;
|
||||||
|
avg_delay_ms = (avg_delay_ms + num_delays / 2) / num_delays;
|
||||||
}
|
}
|
||||||
if (send_side_delay_observer_ &&
|
send_side_delay_observer_->SendSideDelayUpdated(avg_delay_ms, max_delay_ms,
|
||||||
GetSendSideDelay(&avg_delay_ms, &max_delay_ms)) {
|
ssrc);
|
||||||
send_side_delay_observer_->SendSideDelayUpdated(avg_delay_ms,
|
|
||||||
max_delay_ms, ssrc);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTPSender::ProcessBitrate() {
|
void RTPSender::ProcessBitrate() {
|
||||||
|
@ -104,10 +104,6 @@ class RTPSender : public RTPSenderInterface {
|
|||||||
uint32_t FecOverheadRate() const;
|
uint32_t FecOverheadRate() const;
|
||||||
uint32_t NackOverheadRate() const;
|
uint32_t NackOverheadRate() const;
|
||||||
|
|
||||||
// Returns true if the statistics have been calculated, and false if no frame
|
|
||||||
// was sent within the statistics window.
|
|
||||||
bool GetSendSideDelay(int* avg_send_delay_ms, int* max_send_delay_ms) const;
|
|
||||||
|
|
||||||
void SetTargetBitrate(uint32_t bitrate);
|
void SetTargetBitrate(uint32_t bitrate);
|
||||||
uint32_t GetTargetBitrate();
|
uint32_t GetTargetBitrate();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user