mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[feat] update rtp packet history module
This commit is contained in:
@@ -11,8 +11,12 @@
|
||||
|
||||
RtpVideoSender::RtpVideoSender() {}
|
||||
|
||||
RtpVideoSender::RtpVideoSender(std::shared_ptr<IOStatistics> io_statistics)
|
||||
: ssrc_(GenerateUniqueSsrc()), io_statistics_(io_statistics) {
|
||||
RtpVideoSender::RtpVideoSender(std::shared_ptr<webrtc::Clock> clock,
|
||||
std::shared_ptr<IOStatistics> io_statistics)
|
||||
: ssrc_(GenerateUniqueSsrc()),
|
||||
clock_(clock),
|
||||
io_statistics_(io_statistics),
|
||||
rtp_packet_history_(std::make_unique<RtpPacketHistory>(clock)) {
|
||||
SetPeriod(std::chrono::milliseconds(5));
|
||||
#ifdef SAVE_RTP_SENT_STREAM
|
||||
file_rtp_sent_ = fopen("rtp_sent_stream.h264", "w+b");
|
||||
@@ -67,11 +71,12 @@ int RtpVideoSender::SendRtpPacket(std::shared_ptr<RtpPacket> rtp_packet) {
|
||||
}
|
||||
|
||||
if (on_sent_packet_func_) {
|
||||
webrtc::RtpPacketToSend* rtp_packet_to_send =
|
||||
dynamic_cast<webrtc::RtpPacketToSend*>(rtp_packet.get());
|
||||
std::shared_ptr<webrtc::RtpPacketToSend> rtp_packet_to_send =
|
||||
std::dynamic_pointer_cast<webrtc::RtpPacketToSend>(rtp_packet);
|
||||
rtp_packet_to_send->set_transport_sequence_number(transport_seq_++);
|
||||
rtp_packet_to_send->set_packet_type(webrtc::RtpPacketMediaType::kVideo);
|
||||
on_sent_packet_func_(*rtp_packet_to_send);
|
||||
rtp_packet_history_->AddPacket(rtp_packet_to_send, clock_->CurrentTime());
|
||||
}
|
||||
|
||||
if (0 != data_send_func_((const char*)rtp_packet->Buffer().data(),
|
||||
|
||||
Reference in New Issue
Block a user