mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 12:45:35 +08:00
Implementation for rtcp sender report
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include <functional>
|
||||
|
||||
#include "ringbuffer.h"
|
||||
#include "rtcp_packet.h"
|
||||
#include "rtcp_sender_report.h"
|
||||
#include "rtp_packet.h"
|
||||
#include "rtp_video_send_statistics.h"
|
||||
#include "thread_base.h"
|
||||
@@ -17,21 +19,28 @@ class RtpVideoSender : public ThreadBase {
|
||||
void Enqueue(std::vector<RtpPacket> &rtp_packets);
|
||||
|
||||
public:
|
||||
void SetRtpPacketSendFunc(
|
||||
std::function<void(RtpPacket &)> rtp_packet_send_func) {
|
||||
rtp_packet_send_func_ = rtp_packet_send_func;
|
||||
}
|
||||
void SetUdpSender(
|
||||
std::function<int(const char *, size_t)> rtp_packet_send_func);
|
||||
|
||||
private:
|
||||
int SendRtpPacket(RtpPacket &rtp_packet);
|
||||
int SendRtcpSR(RtcpSenderReport &rtcp_sr);
|
||||
|
||||
bool CheckIsTimeSendRtcpPacket();
|
||||
|
||||
private:
|
||||
bool Process() override;
|
||||
|
||||
private:
|
||||
std::function<void(RtpPacket &)> rtp_packet_send_func_ = nullptr;
|
||||
std::function<int(const char *, size_t)> udp_sender_ = nullptr;
|
||||
RingBuffer<RtpPacket> rtp_packe_queue_;
|
||||
|
||||
private:
|
||||
std::unique_ptr<RtpVideoSendStatistics> rtp_video_send_statistics_ = nullptr;
|
||||
uint32_t last_send_bytes_ = 0;
|
||||
uint32_t last_send_rtcp_packet_ts_ = 0;
|
||||
uint32_t total_rtp_packets_sent_ = 0;
|
||||
uint32_t total_rtp_payload_sent_ = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user