mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[fix] update qos module
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: DI JUNKUN
|
||||
* @Date: 2024-12-18
|
||||
* Copyright (c) 2024 by DI JUNKUN, All Rights Reserved.
|
||||
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _ARRAY_VIEW_H_
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2013 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.
|
||||
* @Author: DI JUNKUN
|
||||
* @Date: 2024-12-18
|
||||
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef MODULES_RTP_RTCP_SOURCE_BYTE_IO_H_
|
||||
#define MODULES_RTP_RTCP_SOURCE_BYTE_IO_H_
|
||||
#ifndef _BYTE_IO_H_
|
||||
#define _BYTE_IO_H_
|
||||
|
||||
// This file contains classes for reading and writing integer types from/to
|
||||
// byte array representations. Signed/unsigned, partial (whole byte) sizes,
|
||||
@@ -391,4 +387,4 @@ class ByteWriter<T, 8, false> {
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MODULES_RTP_RTCP_SOURCE_BYTE_IO_H_
|
||||
#endif
|
||||
@@ -1,22 +1,16 @@
|
||||
/*
|
||||
* Copyright 2016 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.
|
||||
* @Author: DI JUNKUN
|
||||
* @Date: 2024-12-18
|
||||
* Copyright 2018 The WebRTC project authors. All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef RTC_BASE_TYPE_TRAITS_H_
|
||||
#define RTC_BASE_TYPE_TRAITS_H_
|
||||
#ifndef _TYPE_TRAITS_H_
|
||||
#define _TYPE_TRAITS_H_
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
namespace rtc {
|
||||
|
||||
// Determines if the given class has zero-argument .data() and .size() methods
|
||||
// whose return values are convertible to T* and size_t, respectively.
|
||||
template <typename DS, typename T>
|
||||
@@ -136,6 +130,4 @@ static_assert(!IsIntlike<S>::value, "");
|
||||
|
||||
} // namespace test_enum_intlike
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
#endif // RTC_BASE_TYPE_TRAITS_H_
|
||||
#endif
|
||||
@@ -4,17 +4,19 @@
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
#include "log.h"
|
||||
|
||||
void CongestionControlFeedbackTracker::ReceivedPacket(
|
||||
const RtpPacketReceived& packet) {
|
||||
int64_t unwrapped_sequence_number =
|
||||
unwrapper_.Unwrap(packet.SequenceNumber());
|
||||
if (last_sequence_number_in_feedback_ &&
|
||||
unwrapped_sequence_number < *last_sequence_number_in_feedback_ + 1) {
|
||||
RTC_LOG(LS_WARNING)
|
||||
<< "Received packet unorderered between feeedback. SSRC: "
|
||||
<< packet.Ssrc() << " Seq: " << packet.SequenceNumber()
|
||||
<< " last feedback: "
|
||||
<< static_cast<uint16_t>(*last_sequence_number_in_feedback_);
|
||||
LOG_WARN(
|
||||
"Received packet unorderered between feeedback. SSRC: {} Seq: {} last "
|
||||
"feedback: {}",
|
||||
packet.Ssrc(), packet.SequenceNumber(),
|
||||
static_cast<uint16_t>(*last_sequence_number_in_feedback_));
|
||||
// TODO: bugs.webrtc.org/374550342 - According to spec, the old packets
|
||||
// should be reported again. But at the moment, we dont store history of
|
||||
// packet we already reported and thus, they will be reported as lost. Note
|
||||
@@ -49,8 +51,14 @@ void CongestionControlFeedbackTracker::AddPacketsToFeedback(
|
||||
for (int64_t sequence_number = *last_sequence_number_in_feedback_ + 1;
|
||||
sequence_number <= packets_.back().unwrapped_sequence_number;
|
||||
++sequence_number) {
|
||||
RTC_DCHECK(packet_it != packets_.end());
|
||||
RTC_DCHECK_EQ(ssrc, packet_it->ssrc);
|
||||
if (packet_it == packets_.end()) {
|
||||
LOG_FATAL("Invalid packet_it");
|
||||
return;
|
||||
}
|
||||
if (ssrc != packet_it->ssrc) {
|
||||
LOG_FATAL("Invalid ssrc");
|
||||
return;
|
||||
}
|
||||
|
||||
rtc::EcnMarking ecn = rtc::EcnMarking::kNotEct;
|
||||
TimeDelta arrival_time_offset = TimeDelta::MinusInfinity();
|
||||
@@ -70,9 +78,8 @@ void CongestionControlFeedbackTracker::AddPacketsToFeedback(
|
||||
if (packet_it->ecn == rtc::EcnMarking::kCe) {
|
||||
ecn = rtc::EcnMarking::kCe;
|
||||
}
|
||||
RTC_LOG(LS_WARNING) << "Received duplicate packet ssrc:" << ssrc
|
||||
<< " seq:" << static_cast<uint16_t>(sequence_number)
|
||||
<< " ecn: " << static_cast<int>(ecn);
|
||||
LOG_WARN("Received duplicate packet ssrc: {} seq: {} ecn: {}", ssrc,
|
||||
static_cast<uint16_t>(sequence_number), static_cast<int>(ecn));
|
||||
++packet_it;
|
||||
}
|
||||
} // else - the packet has not been received yet.
|
||||
@@ -126,8 +126,8 @@ void ReceiveSideCongestionController::OnBitrateChanged(int bitrate_bps) {
|
||||
send_bandwidth_estimate);
|
||||
}
|
||||
|
||||
TimeDelta ReceiveSideCongestionController::MaybeProcess() {
|
||||
Timestamp now = env_.clock().CurrentTime();
|
||||
int64_t ReceiveSideCongestionController::MaybeProcess() {
|
||||
int64_t now = env_.clock().CurrentTime();
|
||||
if (send_rfc8888_congestion_feedback_) {
|
||||
RTC_DCHECK_RUN_ON(&sequence_checker_);
|
||||
return congestion_control_feedback_generator_.Process(now);
|
||||
@@ -8,13 +8,14 @@
|
||||
#define _RECEIVE_SIDE_CONGESTION_CONTROLLER_H_
|
||||
|
||||
class ReceiveSideCongestionController {
|
||||
public:
|
||||
enum MediaType { VIDEO, AUDIO, DATA };
|
||||
|
||||
public:
|
||||
ReceiveSideCongestionController();
|
||||
~ReceiveSideCongestionController() override = default;
|
||||
|
||||
public:
|
||||
void EnablSendCongestionControlFeedbackAccordingToRfc8888();
|
||||
|
||||
void OnReceivedPacket(const RtpPacketReceived& packet, MediaType media_type);
|
||||
|
||||
// Implements CallStatsObserver.
|
||||
@@ -39,13 +40,11 @@ class ReceiveSideCongestionController {
|
||||
|
||||
// Runs periodic tasks if it is time to run them, returns time until next
|
||||
// call to `MaybeProcess` should be non idle.
|
||||
TimeDelta MaybeProcess();
|
||||
int64_t MaybeProcess();
|
||||
|
||||
private:
|
||||
void PickEstimator(bool has_absolute_send_time)
|
||||
RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
|
||||
void PickEstimator(bool has_absolute_send_time);
|
||||
|
||||
const Environment env_;
|
||||
RembThrottler remb_throttler_;
|
||||
|
||||
// TODO: bugs.webrtc.org/42224904 - Use sequence checker for all usage of
|
||||
|
||||
Reference in New Issue
Block a user