mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[fix] fix padding packets building
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user