mirror of
				https://github.com/kunkundi/crossdesk.git
				synced 2025-10-26 20:25:34 +08:00 
			
		
		
		
	[fix] fix padding packets building
This commit is contained in:
		| @@ -412,7 +412,6 @@ void PacingController::ProcessPackets() { | ||||
|   PacedPacketInfo pacing_info; | ||||
|   DataSize recommended_probe_size = DataSize::Zero(); | ||||
|   bool is_probing = prober_.is_probing(); | ||||
|   LOG_WARN("is probing"); | ||||
|   if (is_probing) { | ||||
|     // Probe timing is sensitive, and handled explicitly by BitrateProber, so | ||||
|     // use actual send time rather than target. | ||||
| @@ -474,7 +473,7 @@ void PacingController::ProcessPackets() { | ||||
|                        transport_overhead_per_packet_; | ||||
|       } | ||||
|  | ||||
|       LOG_ERROR("Send packet_size {}", rtp_packet->Size()); | ||||
|       // LOG_ERROR("Send packet_size {}", rtp_packet->Size()); | ||||
|       packet_sender_->SendPacket(std::move(rtp_packet), pacing_info); | ||||
|       for (auto& packet : packet_sender_->FetchFec()) { | ||||
|         EnqueuePacket(std::move(packet)); | ||||
|   | ||||
| @@ -289,7 +289,8 @@ std::vector<std::unique_ptr<RtpPacket>> RtpPacketizerH264::BuildPadding( | ||||
|  | ||||
|     // Add padding bytes | ||||
|     uint32_t padding_size = current_payload_size; | ||||
|     rtp_packet_frame_.insert(rtp_packet_frame_.end(), padding_size - 1, 0); | ||||
|     rtp_packet_frame_.insert(rtp_packet_frame_.end(), padding_size, 0); | ||||
|     rtp_packet_frame_.push_back(padding_size); | ||||
|  | ||||
|     if (use_rtp_packet_to_send) { | ||||
|       std::unique_ptr<webrtc::RtpPacketToSend> rtp_packet = | ||||
|   | ||||
| @@ -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