[feat] use original webrtc header defines

This commit is contained in:
dijunkun
2025-01-16 17:33:46 +08:00
parent a8e9609736
commit 6e2a52e506
90 changed files with 6959 additions and 546 deletions

View File

@@ -1,40 +1,50 @@
/*
* @Author: DI JUNKUN
* @Date: 2024-12-18
* Copyright (c) 2024 by DI JUNKUN, All Rights Reserved.
* Copyright (c) 2024 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_REMOTE_BITRATE_ESTIMATOR_CONGESTION_CONTROL_FEEDBACK_TRACKER_H_
#define MODULES_REMOTE_BITRATE_ESTIMATOR_CONGESTION_CONTROL_FEEDBACK_TRACKER_H_
#ifndef _CONGESTION_CONTROL_FEEDBACK_TRACKER_H_
#define _CONGESTION_CONTROL_FEEDBACK_TRACKER_H_
#include <cstdint>
#include <optional>
#include <vector>
#include "api/units/timestamp.h"
#include "congestion_control_feedback.h"
#include "enc_mark.h"
#include "rtc_base/network/ecn_marking.h"
#include "rtc_base/numerics/sequence_number_unwrapper.h"
#include "rtp_packet_received.h"
#include "sequence_number_unwrapper.h"
namespace webrtc {
// CongestionControlFeedbackTracker is reponsible for creating and keeping track
// of feedback sent for a specific SSRC when feedback is sent according to
// https://datatracker.ietf.org/doc/rfc8888/
class CongestionControlFeedbackTracker {
public:
CongestionControlFeedbackTracker() = default;
void ReceivedPacket(RtpPacketReceived& packet);
void ReceivedPacket(const RtpPacketReceived& packet);
// Adds received packets to `packet_feedback`
// RTP sequence numbers are continous from the last created feedback unless
// reordering has occured between feedback packets. If so, the sequence
// number range may overlap with previousely sent feedback.
void AddPacketsToFeedback(
int64_t feedback_time,
std::vector<CongestionControlFeedback::PacketInfo>& packet_feedback);
Timestamp feedback_time,
std::vector<rtcp::CongestionControlFeedback::PacketInfo>&
packet_feedback);
private:
struct PacketInfo {
uint32_t ssrc;
int64_t unwrapped_sequence_number = 0;
int64_t arrival_time;
EcnMarking ecn = EcnMarking::kNotEct;
Timestamp arrival_time;
rtc::EcnMarking ecn = rtc::EcnMarking::kNotEct;
};
std::optional<int64_t> last_sequence_number_in_feedback_;
@@ -43,4 +53,6 @@ class CongestionControlFeedbackTracker {
std::vector<PacketInfo> packets_;
};
#endif
} // namespace webrtc
#endif // MODULES_REMOTE_BITRATE_ESTIMATOR_CONGESTION_CONTROL_FEEDBACK_TRACKER_H_