2012-03-05 17:12:41 +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.
|
|
|
|
|
*/
|
|
|
|
|
|
2015-10-21 15:52:16 +02:00
|
|
|
#ifndef WEBRTC_CALL_CONGESTION_CONTROLLER_H_
|
|
|
|
|
#define WEBRTC_CALL_CONGESTION_CONTROLLER_H_
|
2012-03-05 17:12:41 +00:00
|
|
|
|
2015-02-26 14:34:55 +00:00
|
|
|
#include "webrtc/base/scoped_ptr.h"
|
2015-10-21 15:52:16 +02:00
|
|
|
#include "webrtc/stream.h"
|
2012-03-05 17:12:41 +00:00
|
|
|
|
2016-02-08 14:31:30 +01:00
|
|
|
namespace rtc {
|
|
|
|
|
struct SentPacket;
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-05 17:12:41 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2015-11-12 21:02:42 -08:00
|
|
|
class BitrateController;
|
|
|
|
|
class BitrateObserver;
|
2012-11-26 12:40:15 +00:00
|
|
|
class CallStats;
|
2016-02-08 14:31:30 +01:00
|
|
|
class Clock;
|
2015-03-26 11:11:06 +01:00
|
|
|
class PacedSender;
|
|
|
|
|
class PacketRouter;
|
2012-03-05 17:12:41 +00:00
|
|
|
class ProcessThread;
|
2013-05-14 12:10:58 +00:00
|
|
|
class RemoteBitrateEstimator;
|
2016-02-08 14:31:30 +01:00
|
|
|
class RemoteBitrateObserver;
|
2015-09-22 05:10:52 -07:00
|
|
|
class RemoteEstimatorProxy;
|
2015-10-21 13:24:28 +02:00
|
|
|
class RtpRtcp;
|
2015-09-22 05:10:52 -07:00
|
|
|
class TransportFeedbackAdapter;
|
2015-11-12 21:02:42 -08:00
|
|
|
class TransportFeedbackObserver;
|
2015-03-09 10:06:40 +00:00
|
|
|
|
2015-11-12 21:02:42 -08:00
|
|
|
class CongestionController {
|
2012-03-05 17:12:41 +00:00
|
|
|
public:
|
2016-02-08 14:31:30 +01:00
|
|
|
CongestionController(Clock* clock,
|
|
|
|
|
ProcessThread* process_thread,
|
|
|
|
|
CallStats* call_stats,
|
|
|
|
|
BitrateObserver* bitrate_observer,
|
|
|
|
|
RemoteBitrateObserver* remote_bitrate_observer);
|
2016-01-12 13:55:00 +01:00
|
|
|
virtual ~CongestionController();
|
|
|
|
|
virtual void SetBweBitrates(int min_bitrate_bps,
|
|
|
|
|
int start_bitrate_bps,
|
|
|
|
|
int max_bitrate_bps);
|
2012-03-05 17:12:41 +00:00
|
|
|
|
2016-01-12 13:55:00 +01:00
|
|
|
virtual void SignalNetworkState(NetworkState state);
|
2015-10-14 03:12:59 -07:00
|
|
|
|
2016-01-12 13:55:00 +01:00
|
|
|
virtual BitrateController* GetBitrateController() const;
|
|
|
|
|
virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator(
|
|
|
|
|
bool send_side_bwe) const;
|
|
|
|
|
virtual int64_t GetPacerQueuingDelayMs() const;
|
|
|
|
|
virtual PacedSender* pacer() const { return pacer_.get(); }
|
|
|
|
|
virtual PacketRouter* packet_router() const { return packet_router_.get(); }
|
|
|
|
|
virtual TransportFeedbackObserver* GetTransportFeedbackObserver();
|
2012-04-27 05:25:53 +00:00
|
|
|
|
2016-01-12 13:55:00 +01:00
|
|
|
virtual void UpdatePacerBitrate(int bitrate_kbps,
|
|
|
|
|
int max_bitrate_kbps,
|
|
|
|
|
int min_bitrate_kbps);
|
2015-03-04 12:24:26 +00:00
|
|
|
|
2016-01-12 13:55:00 +01:00
|
|
|
virtual void OnSentPacket(const rtc::SentPacket& sent_packet);
|
2015-10-15 07:26:07 -07:00
|
|
|
|
2012-03-05 17:12:41 +00:00
|
|
|
private:
|
2016-02-08 14:31:30 +01:00
|
|
|
Clock* const clock_;
|
2015-09-23 13:51:47 +02:00
|
|
|
rtc::scoped_ptr<PacketRouter> packet_router_;
|
|
|
|
|
rtc::scoped_ptr<PacedSender> pacer_;
|
2015-09-24 15:06:57 +02:00
|
|
|
rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
|
|
|
|
|
rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_;
|
2015-10-16 02:31:11 -07:00
|
|
|
|
2013-04-22 12:41:57 +00:00
|
|
|
// Registered at construct time and assumed to outlive this class.
|
2015-09-14 06:42:43 -07:00
|
|
|
ProcessThread* const process_thread_;
|
2015-10-21 13:24:28 +02:00
|
|
|
CallStats* const call_stats_;
|
|
|
|
|
|
2015-03-26 11:11:06 +01:00
|
|
|
rtc::scoped_ptr<ProcessThread> pacer_thread_;
|
|
|
|
|
|
|
|
|
|
rtc::scoped_ptr<BitrateController> bitrate_controller_;
|
2015-09-24 15:06:57 +02:00
|
|
|
rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_;
|
2015-09-28 03:57:14 -07:00
|
|
|
int min_bitrate_bps_;
|
2016-01-12 13:55:00 +01:00
|
|
|
|
|
|
|
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController);
|
2012-03-05 17:12:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2015-10-21 15:52:16 +02:00
|
|
|
#endif // WEBRTC_CALL_CONGESTION_CONTROLLER_H_
|