Delete deprecated variant of ReceiveStatistics::SetMaxReorderingThreshold
Fixed: webrtc:42220729 Change-Id: I87c08769d33746e40dcdbf213096fc9732f82a07 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363962 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org> Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43095}
This commit is contained in:
parent
3ae9578f4d
commit
8d4638f985
@ -898,11 +898,12 @@ void ChannelReceive::SetNACKStatus(bool enable, int max_packets) {
|
||||
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
|
||||
// None of these functions can fail.
|
||||
if (enable) {
|
||||
rtp_receive_statistics_->SetMaxReorderingThreshold(max_packets);
|
||||
rtp_receive_statistics_->SetMaxReorderingThreshold(remote_ssrc_,
|
||||
max_packets);
|
||||
neteq_->EnableNack(max_packets);
|
||||
} else {
|
||||
rtp_receive_statistics_->SetMaxReorderingThreshold(
|
||||
kDefaultMaxReorderingThreshold);
|
||||
remote_ssrc_, kDefaultMaxReorderingThreshold);
|
||||
neteq_->DisableNack();
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,11 +66,6 @@ class ReceiveStatistics : public ReceiveStatisticsProvider,
|
||||
// Returns a pointer to the statistician of an ssrc.
|
||||
virtual StreamStatistician* GetStatistician(uint32_t ssrc) const = 0;
|
||||
|
||||
// TODO(bugs.webrtc.org/10669): Deprecated, delete as soon as downstream
|
||||
// projects are updated. This method sets the max reordering threshold of all
|
||||
// current and future streams.
|
||||
virtual void SetMaxReorderingThreshold(int max_reordering_threshold) = 0;
|
||||
|
||||
// Sets the max reordering threshold in number of packets.
|
||||
virtual void SetMaxReorderingThreshold(uint32_t ssrc,
|
||||
int max_reordering_threshold) = 0;
|
||||
|
||||
@ -41,14 +41,12 @@ TimeDelta UnixEpochDelta(Clock& clock) {
|
||||
|
||||
StreamStatistician::~StreamStatistician() {}
|
||||
|
||||
StreamStatisticianImpl::StreamStatisticianImpl(uint32_t ssrc,
|
||||
Clock* clock,
|
||||
int max_reordering_threshold)
|
||||
StreamStatisticianImpl::StreamStatisticianImpl(uint32_t ssrc, Clock* clock)
|
||||
: ssrc_(ssrc),
|
||||
clock_(clock),
|
||||
delta_internal_unix_epoch_(UnixEpochDelta(*clock_)),
|
||||
incoming_bitrate_(/*max_window_size=*/kStatisticsProcessInterval),
|
||||
max_reordering_threshold_(max_reordering_threshold),
|
||||
max_reordering_threshold_(kDefaultMaxReorderingThreshold),
|
||||
enable_retransmit_detection_(false),
|
||||
cumulative_loss_is_capped_(false),
|
||||
jitter_q4_(0),
|
||||
@ -334,18 +332,16 @@ bool StreamStatisticianImpl::IsRetransmitOfOldPacket(
|
||||
|
||||
std::unique_ptr<ReceiveStatistics> ReceiveStatistics::Create(Clock* clock) {
|
||||
return std::make_unique<ReceiveStatisticsLocked>(
|
||||
clock, [](uint32_t ssrc, Clock* clock, int max_reordering_threshold) {
|
||||
return std::make_unique<StreamStatisticianLocked>(
|
||||
ssrc, clock, max_reordering_threshold);
|
||||
clock, [](uint32_t ssrc, Clock* clock) {
|
||||
return std::make_unique<StreamStatisticianLocked>(ssrc, clock);
|
||||
});
|
||||
}
|
||||
|
||||
std::unique_ptr<ReceiveStatistics> ReceiveStatistics::CreateThreadCompatible(
|
||||
Clock* clock) {
|
||||
return std::make_unique<ReceiveStatisticsImpl>(
|
||||
clock, [](uint32_t ssrc, Clock* clock, int max_reordering_threshold) {
|
||||
return std::make_unique<StreamStatisticianImpl>(
|
||||
ssrc, clock, max_reordering_threshold);
|
||||
clock, [](uint32_t ssrc, Clock* clock) {
|
||||
return std::make_unique<StreamStatisticianImpl>(ssrc, clock);
|
||||
});
|
||||
}
|
||||
|
||||
@ -353,12 +349,10 @@ ReceiveStatisticsImpl::ReceiveStatisticsImpl(
|
||||
Clock* clock,
|
||||
std::function<std::unique_ptr<StreamStatisticianImplInterface>(
|
||||
uint32_t ssrc,
|
||||
Clock* clock,
|
||||
int max_reordering_threshold)> stream_statistician_factory)
|
||||
Clock* clock)> stream_statistician_factory)
|
||||
: clock_(clock),
|
||||
stream_statistician_factory_(std::move(stream_statistician_factory)),
|
||||
last_returned_ssrc_idx_(0),
|
||||
max_reordering_threshold_(kDefaultMaxReorderingThreshold) {}
|
||||
last_returned_ssrc_idx_(0) {}
|
||||
|
||||
void ReceiveStatisticsImpl::OnRtpPacket(const RtpPacketReceived& packet) {
|
||||
// StreamStatisticianImpl instance is created once and only destroyed when
|
||||
@ -380,21 +374,12 @@ StreamStatisticianImplInterface* ReceiveStatisticsImpl::GetOrCreateStatistician(
|
||||
uint32_t ssrc) {
|
||||
std::unique_ptr<StreamStatisticianImplInterface>& impl = statisticians_[ssrc];
|
||||
if (impl == nullptr) { // new element
|
||||
impl =
|
||||
stream_statistician_factory_(ssrc, clock_, max_reordering_threshold_);
|
||||
impl = stream_statistician_factory_(ssrc, clock_);
|
||||
all_ssrcs_.push_back(ssrc);
|
||||
}
|
||||
return impl.get();
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::SetMaxReorderingThreshold(
|
||||
int max_reordering_threshold) {
|
||||
max_reordering_threshold_ = max_reordering_threshold;
|
||||
for (auto& statistician : statisticians_) {
|
||||
statistician.second->SetMaxReorderingThreshold(max_reordering_threshold);
|
||||
}
|
||||
}
|
||||
|
||||
void ReceiveStatisticsImpl::SetMaxReorderingThreshold(
|
||||
uint32_t ssrc,
|
||||
int max_reordering_threshold) {
|
||||
|
||||
@ -44,9 +44,7 @@ class StreamStatisticianImplInterface : public StreamStatistician {
|
||||
// Thread-compatible implementation of StreamStatisticianImplInterface.
|
||||
class StreamStatisticianImpl : public StreamStatisticianImplInterface {
|
||||
public:
|
||||
StreamStatisticianImpl(uint32_t ssrc,
|
||||
Clock* clock,
|
||||
int max_reordering_threshold);
|
||||
StreamStatisticianImpl(uint32_t ssrc, Clock* clock);
|
||||
~StreamStatisticianImpl() override;
|
||||
|
||||
// Implements StreamStatistician
|
||||
@ -119,10 +117,7 @@ class StreamStatisticianImpl : public StreamStatisticianImplInterface {
|
||||
// Thread-safe implementation of StreamStatisticianImplInterface.
|
||||
class StreamStatisticianLocked : public StreamStatisticianImplInterface {
|
||||
public:
|
||||
StreamStatisticianLocked(uint32_t ssrc,
|
||||
Clock* clock,
|
||||
int max_reordering_threshold)
|
||||
: impl_(ssrc, clock, max_reordering_threshold) {}
|
||||
StreamStatisticianLocked(uint32_t ssrc, Clock* clock) : impl_(ssrc, clock) {}
|
||||
~StreamStatisticianLocked() override = default;
|
||||
|
||||
RtpReceiveStats GetStats() const override {
|
||||
@ -171,8 +166,7 @@ class ReceiveStatisticsImpl : public ReceiveStatistics {
|
||||
Clock* clock,
|
||||
std::function<std::unique_ptr<StreamStatisticianImplInterface>(
|
||||
uint32_t ssrc,
|
||||
Clock* clock,
|
||||
int max_reordering_threshold)> stream_statistician_factory);
|
||||
Clock* clock)> stream_statistician_factory);
|
||||
~ReceiveStatisticsImpl() override = default;
|
||||
|
||||
// Implements ReceiveStatisticsProvider.
|
||||
@ -183,7 +177,6 @@ class ReceiveStatisticsImpl : public ReceiveStatistics {
|
||||
|
||||
// Implements ReceiveStatistics.
|
||||
StreamStatistician* GetStatistician(uint32_t ssrc) const override;
|
||||
void SetMaxReorderingThreshold(int max_reordering_threshold) override;
|
||||
void SetMaxReorderingThreshold(uint32_t ssrc,
|
||||
int max_reordering_threshold) override;
|
||||
void EnableRetransmitDetection(uint32_t ssrc, bool enable) override;
|
||||
@ -192,15 +185,12 @@ class ReceiveStatisticsImpl : public ReceiveStatistics {
|
||||
StreamStatisticianImplInterface* GetOrCreateStatistician(uint32_t ssrc);
|
||||
|
||||
Clock* const clock_;
|
||||
std::function<std::unique_ptr<StreamStatisticianImplInterface>(
|
||||
uint32_t ssrc,
|
||||
Clock* clock,
|
||||
int max_reordering_threshold)>
|
||||
std::function<std::unique_ptr<StreamStatisticianImplInterface>(uint32_t ssrc,
|
||||
Clock* clock)>
|
||||
stream_statistician_factory_;
|
||||
// The index within `all_ssrcs_` that was last returned.
|
||||
size_t last_returned_ssrc_idx_;
|
||||
std::vector<uint32_t> all_ssrcs_;
|
||||
int max_reordering_threshold_;
|
||||
flat_map<uint32_t /*ssrc*/, std::unique_ptr<StreamStatisticianImplInterface>>
|
||||
statisticians_;
|
||||
};
|
||||
@ -213,8 +203,7 @@ class ReceiveStatisticsLocked : public ReceiveStatistics {
|
||||
Clock* clock,
|
||||
std::function<std::unique_ptr<StreamStatisticianImplInterface>(
|
||||
uint32_t ssrc,
|
||||
Clock* clock,
|
||||
int max_reordering_threshold)> stream_statitician_factory)
|
||||
Clock* clock)> stream_statitician_factory)
|
||||
: impl_(clock, std::move(stream_statitician_factory)) {}
|
||||
~ReceiveStatisticsLocked() override = default;
|
||||
std::vector<rtcp::ReportBlock> RtcpReportBlocks(size_t max_blocks) override {
|
||||
@ -229,10 +218,6 @@ class ReceiveStatisticsLocked : public ReceiveStatistics {
|
||||
MutexLock lock(&receive_statistics_lock_);
|
||||
return impl_.GetStatistician(ssrc);
|
||||
}
|
||||
void SetMaxReorderingThreshold(int max_reordering_threshold) override {
|
||||
MutexLock lock(&receive_statistics_lock_);
|
||||
return impl_.SetMaxReorderingThreshold(max_reordering_threshold);
|
||||
}
|
||||
void SetMaxReorderingThreshold(uint32_t ssrc,
|
||||
int max_reordering_threshold) override {
|
||||
MutexLock lock(&receive_statistics_lock_);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user