2012-11-09 20:56:23 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_PACING_PACED_SENDER_H_
|
|
|
|
|
#define MODULES_PACING_PACED_SENDER_H_
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2016-03-17 09:17:43 -07:00
|
|
|
#include <memory>
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2018-06-18 10:48:16 +02:00
|
|
|
#include "absl/types/optional.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/pacing/pacer.h"
|
2018-09-13 17:11:06 +02:00
|
|
|
#include "modules/pacing/round_robin_packet_queue.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/criticalsection.h"
|
|
|
|
|
#include "rtc_base/thread_annotations.h"
|
2012-11-09 20:56:23 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
class AlrDetector;
|
2014-10-23 11:57:05 +00:00
|
|
|
class BitrateProber;
|
2014-07-04 09:20:42 +00:00
|
|
|
class Clock;
|
2017-03-29 01:23:13 -07:00
|
|
|
class RtcEventLog;
|
2017-07-11 06:56:04 -07:00
|
|
|
class IntervalBudget;
|
2014-07-04 09:20:42 +00:00
|
|
|
|
2017-08-20 09:19:58 -07:00
|
|
|
class PacedSender : public Pacer {
|
2012-11-09 20:56:23 +00:00
|
|
|
public:
|
2016-05-11 06:01:13 -07:00
|
|
|
class PacketSender {
|
2012-11-09 20:56:23 +00:00
|
|
|
public:
|
|
|
|
|
// Note: packets sent as a result of a callback should not pass by this
|
|
|
|
|
// module again.
|
|
|
|
|
// Called when it's time to send a queued packet.
|
2013-06-20 20:18:31 +00:00
|
|
|
// Returns false if packet cannot be sent.
|
2013-11-13 15:29:21 +00:00
|
|
|
virtual bool TimeToSendPacket(uint32_t ssrc,
|
|
|
|
|
uint16_t sequence_number,
|
|
|
|
|
int64_t capture_time_ms,
|
2016-05-13 11:13:05 +02:00
|
|
|
bool retransmission,
|
2017-02-17 03:59:43 -08:00
|
|
|
const PacedPacketInfo& cluster_info) = 0;
|
2012-11-09 20:56:23 +00:00
|
|
|
// Called when it's a good time to send a padding data.
|
2014-07-04 09:20:42 +00:00
|
|
|
// Returns the number of bytes sent.
|
2017-02-17 03:59:43 -08:00
|
|
|
virtual size_t TimeToSendPadding(size_t bytes,
|
|
|
|
|
const PacedPacketInfo& cluster_info) = 0;
|
2014-02-27 22:32:40 +00:00
|
|
|
|
2012-11-09 20:56:23 +00:00
|
|
|
protected:
|
2016-05-11 06:01:13 -07:00
|
|
|
virtual ~PacketSender() {}
|
2012-11-09 20:56:23 +00:00
|
|
|
};
|
2018-03-09 12:48:01 +01:00
|
|
|
static constexpr int64_t kNoCongestionWindow = -1;
|
2013-11-27 14:16:20 +00:00
|
|
|
|
2015-11-20 09:00:37 -08:00
|
|
|
// Expected max pacer delay in ms. If ExpectedQueueTimeMs() is higher than
|
|
|
|
|
// this value, the packet producers should wait (eg drop frames rather than
|
|
|
|
|
// encoding them). Bitrate sent may temporarily exceed target set by
|
|
|
|
|
// UpdateBitrate() so that this limit will be upheld.
|
|
|
|
|
static const int64_t kMaxQueueLengthMs;
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
// Pacing-rate relative to our target send rate.
|
|
|
|
|
// Multiplicative factor that is applied to the target bitrate to calculate
|
|
|
|
|
// the number of bytes that can be transmitted per interval.
|
|
|
|
|
// Increasing this factor will result in lower delays in cases of bitrate
|
|
|
|
|
// overshoots from the encoder.
|
|
|
|
|
static const float kDefaultPaceMultiplier;
|
2014-07-04 09:20:42 +00:00
|
|
|
|
2017-03-29 01:23:13 -07:00
|
|
|
PacedSender(const Clock* clock,
|
|
|
|
|
PacketSender* packet_sender,
|
|
|
|
|
RtcEventLog* event_log);
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2017-05-31 02:24:52 -07:00
|
|
|
~PacedSender() override;
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2017-01-04 07:05:25 -08:00
|
|
|
virtual void CreateProbeCluster(int bitrate_bps);
|
2016-08-17 11:11:59 +02:00
|
|
|
|
2013-03-22 23:39:29 +00:00
|
|
|
// Temporarily pause all sending.
|
|
|
|
|
void Pause();
|
|
|
|
|
|
|
|
|
|
// Resume sending packets.
|
|
|
|
|
void Resume();
|
|
|
|
|
|
2018-03-09 12:48:01 +01:00
|
|
|
void SetCongestionWindow(int64_t congestion_window_bytes);
|
|
|
|
|
void UpdateOutstandingData(int64_t outstanding_bytes);
|
|
|
|
|
|
2015-02-16 15:47:51 +00:00
|
|
|
// Enable bitrate probing. Enabled by default, mostly here to simplify
|
|
|
|
|
// testing. Must be called before any packets are being sent to have an
|
|
|
|
|
// effect.
|
|
|
|
|
void SetProbingEnabled(bool enabled);
|
|
|
|
|
|
2018-02-20 10:46:39 +01:00
|
|
|
// Deprecated, SetPacingRates should be used instead.
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
void SetEstimatedBitrate(uint32_t bitrate_bps) override;
|
2018-02-20 10:46:39 +01:00
|
|
|
// Deprecated, SetPacingRates should be used instead.
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
void SetSendBitrateLimits(int min_send_bitrate_bps,
|
|
|
|
|
int max_padding_bitrate_bps);
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2018-02-20 10:46:39 +01:00
|
|
|
// Sets the pacing rates. Must be called once before packets can be sent.
|
|
|
|
|
void SetPacingRates(uint32_t pacing_rate_bps,
|
|
|
|
|
uint32_t padding_rate_bps) override;
|
|
|
|
|
|
2012-11-09 20:56:23 +00:00
|
|
|
// Returns true if we send the packet now, else it will add the packet
|
|
|
|
|
// information to the queue and call TimeToSendPacket when it's time to send.
|
2015-10-08 11:44:14 +02:00
|
|
|
void InsertPacket(RtpPacketSender::Priority priority,
|
|
|
|
|
uint32_t ssrc,
|
|
|
|
|
uint16_t sequence_number,
|
|
|
|
|
int64_t capture_time_ms,
|
|
|
|
|
size_t bytes,
|
|
|
|
|
bool retransmission) override;
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2017-10-20 10:37:47 +02:00
|
|
|
// 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.
|
|
|
|
|
void SetAccountForAudioPackets(bool account_for_audio) override;
|
|
|
|
|
|
2013-12-13 22:03:27 +00:00
|
|
|
// Returns the time since the oldest queued packet was enqueued.
|
2014-12-15 22:09:40 +00:00
|
|
|
virtual int64_t QueueInMs() const;
|
2013-03-27 16:36:01 +00:00
|
|
|
|
2014-10-23 11:57:05 +00:00
|
|
|
virtual size_t QueueSizePackets() const;
|
|
|
|
|
|
2017-04-19 23:28:53 -07:00
|
|
|
// Returns the time when the first packet was sent, or -1 if no packet is
|
|
|
|
|
// sent.
|
|
|
|
|
virtual int64_t FirstSentPacketTimeMs() const;
|
|
|
|
|
|
2014-11-04 16:27:16 +00:00
|
|
|
// Returns the number of milliseconds it will take to send the current
|
|
|
|
|
// packets in the queue, given the current size and bitrate, ignoring prio.
|
2014-11-17 22:21:14 +00:00
|
|
|
virtual int64_t ExpectedQueueTimeMs() const;
|
2014-11-04 16:27:16 +00:00
|
|
|
|
2018-02-20 10:46:39 +01:00
|
|
|
// Deprecated, alr detection will be moved out of the pacer.
|
2018-06-18 10:48:16 +02:00
|
|
|
virtual absl::optional<int64_t> GetApplicationLimitedRegionStartTime() const;
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
|
2012-11-09 20:56:23 +00:00
|
|
|
// Returns the number of milliseconds until the module want a worker thread
|
|
|
|
|
// to call Process.
|
2015-03-04 12:58:35 +00:00
|
|
|
int64_t TimeUntilNextProcess() override;
|
2012-11-09 20:56:23 +00:00
|
|
|
|
|
|
|
|
// Process any pending packets in the queue(s).
|
2016-02-25 04:50:01 -08:00
|
|
|
void Process() override;
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2017-03-15 07:45:36 -07:00
|
|
|
// Called when the prober is associated with a process thread.
|
|
|
|
|
void ProcessThreadAttached(ProcessThread* process_thread) override;
|
2018-02-20 10:46:39 +01:00
|
|
|
// Deprecated, SetPacingRates should be used instead.
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
void SetPacingFactor(float pacing_factor);
|
2017-06-30 13:27:40 -07:00
|
|
|
void SetQueueTimeLimit(int limit_ms);
|
|
|
|
|
|
2012-11-09 20:56:23 +00:00
|
|
|
private:
|
|
|
|
|
// Updates the number of bytes that can be sent for the next time interval.
|
2016-10-04 08:43:09 -07:00
|
|
|
void UpdateBudgetWithElapsedTime(int64_t delta_time_in_ms)
|
2017-09-07 07:53:45 -07:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
|
2016-10-04 08:43:09 -07:00
|
|
|
void UpdateBudgetWithBytesSent(size_t bytes)
|
2017-09-07 07:53:45 -07:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
|
2012-11-09 20:56:23 +00:00
|
|
|
|
2018-09-13 17:11:06 +02:00
|
|
|
bool SendPacket(const RoundRobinPacketQueue::Packet& packet,
|
2017-02-17 03:59:43 -08:00
|
|
|
const PacedPacketInfo& cluster_info)
|
2017-09-07 07:53:45 -07:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
|
2017-02-17 03:59:43 -08:00
|
|
|
size_t SendPadding(size_t padding_needed, const PacedPacketInfo& cluster_info)
|
2017-09-07 07:53:45 -07:00
|
|
|
RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
|
2014-07-07 10:20:35 +00:00
|
|
|
|
2018-03-09 12:48:01 +01:00
|
|
|
void OnBytesSent(size_t bytes_sent) RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
|
|
|
|
|
bool Congested() const RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
|
2018-09-04 18:40:19 +02:00
|
|
|
int64_t TimeMilliseconds() const RTC_EXCLUSIVE_LOCKS_REQUIRED(critsect_);
|
2018-03-09 12:48:01 +01:00
|
|
|
|
2017-03-09 07:09:31 -08:00
|
|
|
const Clock* const clock_;
|
2016-05-11 06:01:13 -07:00
|
|
|
PacketSender* const packet_sender_;
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
const std::unique_ptr<AlrDetector> alr_detector_ RTC_PT_GUARDED_BY(critsect_);
|
2018-06-25 19:23:05 +02:00
|
|
|
|
|
|
|
|
const bool drain_large_queues_;
|
2018-06-15 14:46:11 +02:00
|
|
|
const bool send_padding_if_silent_;
|
2018-06-15 14:47:35 +02:00
|
|
|
const bool video_blocks_audio_;
|
2018-09-04 18:40:19 +02:00
|
|
|
|
2017-03-30 01:14:41 -07:00
|
|
|
rtc::CriticalSection critsect_;
|
2018-09-04 18:40:19 +02:00
|
|
|
// TODO(webrtc:9716): Remove this when we are certain clocks are monotonic.
|
|
|
|
|
// The last millisecond timestamp returned by |clock_|.
|
|
|
|
|
mutable int64_t last_timestamp_ms_ RTC_GUARDED_BY(critsect_);
|
2017-09-07 07:53:45 -07:00
|
|
|
bool paused_ RTC_GUARDED_BY(critsect_);
|
2013-06-04 09:36:56 +00:00
|
|
|
// This is the media budget, keeping track of how many bits of media
|
|
|
|
|
// we can pace out during the current interval.
|
2017-10-18 13:08:22 +02:00
|
|
|
const std::unique_ptr<IntervalBudget> media_budget_
|
|
|
|
|
RTC_PT_GUARDED_BY(critsect_);
|
2013-06-04 09:36:56 +00:00
|
|
|
// This is the padding budget, keeping track of how many bits of padding we're
|
2014-03-19 10:59:52 +00:00
|
|
|
// allowed to send out during the current interval. This budget will be
|
|
|
|
|
// utilized when there's no media to send.
|
2017-10-18 13:08:22 +02:00
|
|
|
const std::unique_ptr<IntervalBudget> padding_budget_
|
|
|
|
|
RTC_PT_GUARDED_BY(critsect_);
|
2014-07-07 10:20:35 +00:00
|
|
|
|
2017-10-18 13:08:22 +02:00
|
|
|
const std::unique_ptr<BitrateProber> prober_ RTC_PT_GUARDED_BY(critsect_);
|
2017-10-17 14:17:54 +02:00
|
|
|
bool probing_send_failure_ RTC_GUARDED_BY(critsect_);
|
2015-11-20 09:00:37 -08:00
|
|
|
// Actual configured bitrates (media_budget_ may temporarily be higher in
|
|
|
|
|
// order to meet pace time constraint).
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
uint32_t estimated_bitrate_bps_ RTC_GUARDED_BY(critsect_);
|
|
|
|
|
uint32_t min_send_bitrate_kbps_ RTC_GUARDED_BY(critsect_);
|
|
|
|
|
uint32_t max_padding_bitrate_kbps_ RTC_GUARDED_BY(critsect_);
|
2017-09-07 07:53:45 -07:00
|
|
|
uint32_t pacing_bitrate_kbps_ RTC_GUARDED_BY(critsect_);
|
2014-10-23 11:57:05 +00:00
|
|
|
|
2018-02-21 13:39:26 +01:00
|
|
|
int64_t time_last_process_us_ RTC_GUARDED_BY(critsect_);
|
|
|
|
|
int64_t last_send_time_us_ RTC_GUARDED_BY(critsect_);
|
2017-09-07 07:53:45 -07:00
|
|
|
int64_t first_sent_packet_ms_ RTC_GUARDED_BY(critsect_);
|
2014-07-07 10:20:35 +00:00
|
|
|
|
2018-09-13 17:11:06 +02:00
|
|
|
RoundRobinPacketQueue packets_ RTC_GUARDED_BY(critsect_);
|
2017-10-17 14:17:54 +02:00
|
|
|
uint64_t packet_counter_ RTC_GUARDED_BY(critsect_);
|
2017-06-30 13:27:40 -07:00
|
|
|
|
2018-03-09 12:48:01 +01:00
|
|
|
int64_t congestion_window_bytes_ RTC_GUARDED_BY(critsect_) =
|
|
|
|
|
kNoCongestionWindow;
|
|
|
|
|
int64_t outstanding_bytes_ RTC_GUARDED_BY(critsect_) = 0;
|
Revert "Revert "Revert "Reland "Moved congestion controller to task queue.""""
This reverts commit 65792c5a5c542201f7b9feefded505842692e6ed.
Reason for revert: <INSERT REASONING HERE>
Original change's description:
> Revert "Revert "Reland "Moved congestion controller to task queue."""
>
> This reverts commit 4e849f6925b2ac44b0957a228d7131fc391fca54.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Revert "Reland "Moved congestion controller to task queue.""
> >
> > This reverts commit 57daeb7ac7f3d80992905b53fea500953fcfd793.
> >
> > Reason for revert: Cause increased congestion and deadlocks in downstream project
> >
> > Original change's description:
> > > Reland "Moved congestion controller to task queue."
> > >
> > > This is a reland of 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.
> > >
> > > Original change's description:
> > > > Moved congestion controller to task queue.
> > > >
> > > > The goal of this work is to make it easier to experiment with the
> > > > bandwidth estimation implementation. For this reason network control
> > > > functionality is moved from SendSideCongestionController(SSCC),
> > > > PacedSender and BitrateController to the newly created
> > > > GoogCcNetworkController which implements the newly created
> > > > NetworkControllerInterface. This allows the implementation to be
> > > > replaced at runtime in the future.
> > > >
> > > > This is the first part of a split of a larger CL, see:
> > > > https://webrtc-review.googlesource.com/c/src/+/39788/8
> > > > For further explanations.
> > > >
> > > > Bug: webrtc:8415
> > > > Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> > > > Reviewed-on: https://webrtc-review.googlesource.com/43840
> > > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > > Reviewed-by: Björn Terelius <terelius@webrtc.org>
> > > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > > Cr-Commit-Position: refs/heads/master@{#21868}
> > >
> > > Bug: webrtc:8415
> > > Change-Id: I1d1756a30deed5b421b1c91c1918a13b6bb455da
> > > Reviewed-on: https://webrtc-review.googlesource.com/48000
> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> > > Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> > > Cr-Commit-Position: refs/heads/master@{#21899}
> >
> > TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: webrtc:8415
> > Change-Id: Ida8074dcac2cc28b3629228eb22846d8a8e81b83
> > Reviewed-on: https://webrtc-review.googlesource.com/52980
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22017}
>
> TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
>
> Change-Id: I3393b74370c4f4d0955f50728005b2b925be169b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:8415
> Reviewed-on: https://webrtc-review.googlesource.com/53262
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22023}
TBR=danilchap@webrtc.org,terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org
Change-Id: Id68ad986ee51142b7be3381d0793709b4392fe2c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/53360
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22024}
2018-02-14 16:53:38 +00:00
|
|
|
float pacing_factor_ RTC_GUARDED_BY(critsect_);
|
2018-02-20 10:46:39 +01:00
|
|
|
// Lock to avoid race when attaching process thread. This can happen due to
|
|
|
|
|
// the Call class setting network state on SendSideCongestionController, which
|
|
|
|
|
// in turn calls Pause/Resume on Pacedsender, before actually starting the
|
|
|
|
|
// pacer process thread. If SendSideCongestionController is running on a task
|
|
|
|
|
// queue separate from the thread used by Call, this causes a race.
|
|
|
|
|
rtc::CriticalSection process_thread_lock_;
|
|
|
|
|
ProcessThread* process_thread_ RTC_GUARDED_BY(process_thread_lock_) = nullptr;
|
|
|
|
|
|
2017-09-07 07:53:45 -07:00
|
|
|
int64_t queue_time_limit RTC_GUARDED_BY(critsect_);
|
2017-10-20 10:37:47 +02:00
|
|
|
bool account_for_audio_ RTC_GUARDED_BY(critsect_);
|
2012-11-09 20:56:23 +00:00
|
|
|
};
|
|
|
|
|
} // namespace webrtc
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_PACING_PACED_SENDER_H_
|