#ifndef _RTP_VIDEO_SENDER_H_ #define _RTP_VIDEO_SENDER_H_ #include #include "ringbuffer.h" #include "rtcp_sender_report.h" #include "rtp_packet.h" #include "rtp_statistics.h" #include "thread_base.h" class RtpVideoSender : public ThreadBase { public: RtpVideoSender(); virtual ~RtpVideoSender(); public: void Enqueue(std::vector &rtp_packets); void SetSendDataFunc(std::function data_send_func); private: int SendRtpPacket(RtpPacket &rtp_packet); int SendRtcpSR(RtcpSenderReport &rtcp_sr); bool CheckIsTimeSendSR(); private: bool Process() override; private: std::function data_send_func_ = nullptr; RingBuffer rtp_packe_queue_; private: std::unique_ptr rtp_statistics_ = nullptr; uint32_t last_send_bytes_ = 0; uint32_t last_send_rtcp_sr_packet_ts_ = 0; uint32_t total_rtp_packets_sent_ = 0; uint32_t total_rtp_payload_sent_ = 0; }; #endif