Reland of actor NACK bitrate allocation (patchset #1 id:1 of https://codereview.webrtc.org/2131913003/ )
Reason for revert:
Upstream fixes in place, should be OK now.
Original issue's description:
> Revert of Refactor NACK bitrate allocation (patchset #16 id:300001 of https://codereview.webrtc.org/2061423003/ )
>
> Reason for revert:
> Breaks upstream code.
>
> Original issue's description:
> > Refactor NACK bitrate allocation
> >
> > Nack bitrate allocation should not be done on a per-rtp-module basis,
> > but rather shared bitrate pool per call. This CL moves allocation to the
> > pacer and cleans up a bunch if bitrate stats handling.
> >
> > BUG=
> > R=danilchap@webrtc.org, stefan@webrtc.org, tommi@webrtc.org
> >
> > Committed: 5fc59e810b
>
> TBR=tommi@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=
>
> Committed: https://crrev.com/e5dd44101eca485f5ad12e5f7ce6f6b0d204116b
> Cr-Commit-Position: refs/heads/master@{#13417}
TBR=tommi@webrtc.org,danilchap@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=
Review-Url: https://codereview.webrtc.org/2146013002
Cr-Commit-Position: refs/heads/master@{#13465}
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "webrtc/modules/rtp_rtcp/source/bitrate.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
||||
#include "webrtc/modules/rtp_rtcp/source/time_util.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -29,7 +29,8 @@ StreamStatisticianImpl::StreamStatisticianImpl(
|
||||
RtcpStatisticsCallback* rtcp_callback,
|
||||
StreamDataCountersCallback* rtp_callback)
|
||||
: clock_(clock),
|
||||
incoming_bitrate_(clock, NULL),
|
||||
incoming_bitrate_(kStatisticsProcessIntervalMs,
|
||||
RateStatistics::kBpsScale),
|
||||
ssrc_(0),
|
||||
max_reordering_threshold_(kDefaultMaxReorderingThreshold),
|
||||
jitter_q4_(0),
|
||||
@ -61,7 +62,7 @@ void StreamStatisticianImpl::UpdateCounters(const RTPHeader& header,
|
||||
rtc::CritScope cs(&stream_lock_);
|
||||
bool in_order = InOrderPacketInternal(header.sequenceNumber);
|
||||
ssrc_ = header.ssrc;
|
||||
incoming_bitrate_.Update(packet_length);
|
||||
incoming_bitrate_.Update(packet_length, clock_->TimeInMilliseconds());
|
||||
receive_counters_.transmitted.AddPacket(packet_length, header);
|
||||
if (!in_order && retransmitted) {
|
||||
receive_counters_.retransmitted.AddPacket(packet_length, header);
|
||||
@ -300,12 +301,7 @@ void StreamStatisticianImpl::GetReceiveStreamDataCounters(
|
||||
|
||||
uint32_t StreamStatisticianImpl::BitrateReceived() const {
|
||||
rtc::CritScope cs(&stream_lock_);
|
||||
return incoming_bitrate_.BitrateNow();
|
||||
}
|
||||
|
||||
void StreamStatisticianImpl::ProcessBitrate() {
|
||||
rtc::CritScope cs(&stream_lock_);
|
||||
incoming_bitrate_.Process();
|
||||
return incoming_bitrate_.Rate(clock_->TimeInMilliseconds()).value_or(0);
|
||||
}
|
||||
|
||||
void StreamStatisticianImpl::LastReceiveTimeNtp(uint32_t* secs,
|
||||
@ -376,7 +372,6 @@ ReceiveStatistics* ReceiveStatistics::Create(Clock* clock) {
|
||||
|
||||
ReceiveStatisticsImpl::ReceiveStatisticsImpl(Clock* clock)
|
||||
: clock_(clock),
|
||||
last_rate_update_ms_(0),
|
||||
rtcp_stats_callback_(NULL),
|
||||
rtp_stats_callback_(NULL) {}
|
||||
|
||||
@ -452,23 +447,6 @@ void ReceiveStatisticsImpl::SetMaxReorderingThreshold(
|
||||
}
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::Process() {
|
||||
rtc::CritScope cs(&receive_statistics_lock_);
|
||||
for (StatisticianImplMap::iterator it = statisticians_.begin();
|
||||
it != statisticians_.end(); ++it) {
|
||||
it->second->ProcessBitrate();
|
||||
}
|
||||
last_rate_update_ms_ = clock_->TimeInMilliseconds();
|
||||
}
|
||||
|
||||
int64_t ReceiveStatisticsImpl::TimeUntilNextProcess() {
|
||||
rtc::CritScope cs(&receive_statistics_lock_);
|
||||
int64_t time_since_last_update = clock_->TimeInMilliseconds() -
|
||||
last_rate_update_ms_;
|
||||
return std::max<int64_t>(
|
||||
kStatisticsProcessIntervalMs - time_since_last_update, 0);
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::RegisterRtcpStatisticsCallback(
|
||||
RtcpStatisticsCallback* callback) {
|
||||
rtc::CritScope cs(&receive_statistics_lock_);
|
||||
@ -525,10 +503,6 @@ StreamStatistician* NullReceiveStatistics::GetStatistician(
|
||||
void NullReceiveStatistics::SetMaxReorderingThreshold(
|
||||
int max_reordering_threshold) {}
|
||||
|
||||
int64_t NullReceiveStatistics::TimeUntilNextProcess() { return 0; }
|
||||
|
||||
void NullReceiveStatistics::Process() {}
|
||||
|
||||
void NullReceiveStatistics::RegisterRtcpStatisticsCallback(
|
||||
RtcpStatisticsCallback* callback) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user