[fix] fix padding packets building

This commit is contained in:
dijunkun
2025-03-17 10:28:58 +08:00
parent bd65d87137
commit 5c598be51d
4 changed files with 18 additions and 15 deletions

View File

@@ -183,7 +183,6 @@ int IceTransportController::SendVideo(const XVideoFrame* video_frame) {
[this](std::shared_ptr<VideoFrameWrapper> encoded_frame) -> int {
if (video_channel_send_) {
video_channel_send_->SendVideo(encoded_frame);
LOG_WARN("SendVideo rtp packets");
}
return 0;

View File

@@ -72,17 +72,21 @@ void PacketSender::SetPacingRates(webrtc::DataRate pacing_rate,
void PacketSender::EnqueuePackets(
std::vector<std::unique_ptr<webrtc::RtpPacketToSend>> packets) {
task_queue_.PostTask([this, packets = std::move(packets)]() mutable {
for (auto &packet : packets) {
size_t packet_size = packet->payload_size() + packet->padding_size();
if (include_overhead_) {
packet_size += packet->headers_size();
}
packet_size_.Apply(1, packet_size);
pacing_controller_.EnqueuePacket(std::move(packet));
}
MaybeProcessPackets(webrtc::Timestamp::MinusInfinity());
});
webrtc::PacedPacketInfo cluster_info;
for (auto &packet : packets) {
SendPacket(std::move(packet), cluster_info);
}
// task_queue_.PostTask([this, packets = std::move(packets)]() mutable {
// for (auto &packet : packets) {
// size_t packet_size = packet->payload_size() + packet->padding_size();
// if (include_overhead_) {
// packet_size += packet->headers_size();
// }
// packet_size_.Apply(1, packet_size);
// pacing_controller_.EnqueuePacket(std::move(packet));
// }
// MaybeProcessPackets(webrtc::Timestamp::MinusInfinity());
// });
}
void PacketSender::RemovePacketsForSsrc(uint32_t ssrc) {