This reverts commit 7affd9bcbb7a778408942d8afa4fe3ce29a8fc0b. Reason for revert: The perf issue has been addressed in the reland (https://webrtc-review.googlesource.com/c/src/+/167883). Original change's description: > Revert "Adds trial to use correct overhead calculation in pacer." > > This reverts commit 71a77c4b3b314a5e3b4e6b2f12d4886cff1b60d7. > > Reason for revert: https://webrtc-review.googlesource.com/c/src/+/167524 needs to be reverted and this CL causes a merge conflict. > > Original change's description: > > Adds trial to use correct overhead calculation in pacer. > > > > Bug: webrtc:9883 > > Change-Id: I1f25a235468678bf823ee1399ba31d94acf33be9 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166534 > > Reviewed-by: Erik Språng <sprang@webrtc.org> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#30399} > > TBR=sprang@webrtc.org,srte@webrtc.org > > Change-Id: I7d3efa29f70aa0363311766980acae6d88bbcaaa > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9883 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167880 > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#30409} TBR=mbonadei@webrtc.org,sprang@webrtc.org,srte@webrtc.org Change-Id: Iafdef81d08078000dc368e001f67bee660e2f5bc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9883 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167861 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30414}
73 lines
2.6 KiB
C++
73 lines
2.6 KiB
C++
/*
|
|
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef MODULES_PACING_RTP_PACKET_PACER_H_
|
|
#define MODULES_PACING_RTP_PACKET_PACER_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "absl/types/optional.h"
|
|
#include "api/units/data_rate.h"
|
|
#include "api/units/data_size.h"
|
|
#include "api/units/time_delta.h"
|
|
#include "api/units/timestamp.h"
|
|
#include "modules/rtp_rtcp/include/rtp_packet_sender.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class RtpPacketPacer {
|
|
public:
|
|
virtual ~RtpPacketPacer() = default;
|
|
|
|
virtual void CreateProbeCluster(DataRate bitrate, int cluster_id) = 0;
|
|
|
|
// Temporarily pause all sending.
|
|
virtual void Pause() = 0;
|
|
|
|
// Resume sending packets.
|
|
virtual void Resume() = 0;
|
|
|
|
virtual void SetCongestionWindow(DataSize congestion_window_size) = 0;
|
|
virtual void UpdateOutstandingData(DataSize outstanding_data) = 0;
|
|
|
|
// Sets the pacing rates. Must be called once before packets can be sent.
|
|
virtual void SetPacingRates(DataRate pacing_rate, DataRate padding_rate) = 0;
|
|
|
|
// Time since the oldest packet currently in the queue was added.
|
|
virtual TimeDelta OldestPacketWaitTime() const = 0;
|
|
|
|
// Sum of payload + padding bytes of all packets currently in the pacer queue.
|
|
virtual DataSize QueueSizeData() const = 0;
|
|
|
|
// Returns the time when the first packet was sent.
|
|
virtual absl::optional<Timestamp> FirstSentPacketTime() const = 0;
|
|
|
|
// Returns the expected number of milliseconds it will take to send the
|
|
// current packets in the queue, given the current size and bitrate, ignoring
|
|
// priority.
|
|
virtual TimeDelta ExpectedQueueTime() const = 0;
|
|
|
|
// Set the average upper bound on pacer queuing delay. The pacer may send at
|
|
// a higher rate than what was configured via SetPacingRates() in order to
|
|
// keep ExpectedQueueTimeMs() below |limit_ms| on average.
|
|
virtual void SetQueueTimeLimit(TimeDelta limit) = 0;
|
|
|
|
// Currently audio traffic is not accounted by pacer and passed through.
|
|
// With the introduction of audio BWE audio traffic will be accounted for
|
|
// the pacer budget calculation. The audio traffic still will be injected
|
|
// at high priority.
|
|
virtual void SetAccountForAudioPackets(bool account_for_audio) = 0;
|
|
virtual void SetIncludeOverhead() = 0;
|
|
virtual void SetTransportOverhead(DataSize overhead_per_packet) = 0;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
#endif // MODULES_PACING_RTP_PACKET_PACER_H_
|