[fix] fix timestamp in congestion control feedback

This commit is contained in:
dijunkun
2025-02-08 17:59:30 +08:00
parent 8d7068aa32
commit 61ac3a9971
10 changed files with 38 additions and 71 deletions

View File

@@ -430,15 +430,6 @@ void RtpVideoReceiver::SendCombinedRtcpPacket(
RTCPSender rtcp_sender(
[this](const uint8_t* buffer, size_t size) -> int {
webrtc::rtcp::CommonHeader rtcp_block;
// bool valid = true;
// if (!rtcp_block.Parse(buffer, size)) {
// valid = false;
// }
webrtc::rtcp::CongestionControlFeedback feedback;
feedback.Parse(rtcp_block);
return data_send_func_((const char*)buffer, size);
},
1200);

View File

@@ -82,11 +82,12 @@ int VideoChannelSend::SendVideo(char* data, size_t size) {
}
void VideoChannelSend::OnCongestionControlFeedback(
int64_t recv_ts, const webrtc::rtcp::CongestionControlFeedback& feedback) {
Timestamp recv_ts,
const webrtc::rtcp::CongestionControlFeedback& feedback) {
++feedback_count_;
std::optional<webrtc::TransportPacketsFeedback> feedback_msg =
transport_feedback_adapter_.ProcessCongestionControlFeedback(
feedback, webrtc::Timestamp::Micros(recv_ts));
transport_feedback_adapter_.ProcessCongestionControlFeedback(feedback,
recv_ts);
if (feedback_msg) {
HandleTransportPacketsFeedback(*feedback_msg);
}

View File

@@ -8,6 +8,7 @@
#define _VIDEO_CHANNEL_SEND_H_
#include "api/transport/network_types.h"
#include "api/units/timestamp.h"
#include "clock.h"
#include "congestion_control.h"
#include "congestion_control_feedback.h"
@@ -32,7 +33,8 @@ class VideoChannelSend {
int SendVideo(char* data, size_t size);
void OnCongestionControlFeedback(
int64_t recv_ts, const webrtc::rtcp::CongestionControlFeedback& feedback);
Timestamp recv_ts,
const webrtc::rtcp::CongestionControlFeedback& feedback);
void HandleTransportPacketsFeedback(
const webrtc::TransportPacketsFeedback& feedback);