mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 12:45:35 +08:00
[feat] update qos module
This commit is contained in:
@@ -7,8 +7,32 @@
|
||||
#ifndef _CONGESTION_CONTROL_FEEDBACK_GENERATOR_H_
|
||||
#define _CONGESTION_CONTROL_FEEDBACK_GENERATOR_H_
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "rtcp_packet.h"
|
||||
#include "rtp_packet_received.h"
|
||||
|
||||
class RtpTransportFeedbackGenerator {
|
||||
public:
|
||||
// Function intented to be used for sending RTCP messages generated by an
|
||||
// implementation of this class.
|
||||
using RtcpSender =
|
||||
std::function<void(std::vector<std::unique_ptr<RtcpPacket>> packets)>;
|
||||
virtual ~RtpTransportFeedbackGenerator() = default;
|
||||
|
||||
virtual void OnReceivedPacket(const RtpPacketReceived& packet) = 0;
|
||||
|
||||
// Sends periodic feedback if it is time to send it.
|
||||
// Returns time until next call to Process should be made.
|
||||
virtual int64_t Process(int64_t now) = 0;
|
||||
|
||||
virtual void OnSendBandwidthEstimateChanged(int64_t estimate) = 0;
|
||||
|
||||
// Overhead from transport layers below RTP. Ie, IP, SRTP.
|
||||
virtual void SetTransportOverhead(DataSize overhead_per_packet) = 0;
|
||||
};
|
||||
|
||||
class CongestionControlFeedbackGenerator
|
||||
: public RtpTransportFeedbackGenerator {
|
||||
public:
|
||||
@@ -18,7 +42,7 @@ class CongestionControlFeedbackGenerator
|
||||
|
||||
void OnReceivedPacket(const RtpPacketReceived& packet) override;
|
||||
|
||||
void OnSendBandwidthEstimateChanged(DataRate estimate) override;
|
||||
void OnSendBandwidthEstimateChanged(int64_t estimate) override;
|
||||
|
||||
int64_t Process(int64_t now_ms) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user