mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[feat] implementation for qos module
This commit is contained in:
46
src/channel/rtp_channel/rtp_data_receiver.h
Normal file
46
src/channel/rtp_channel/rtp_data_receiver.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef _RTP_DATA_RECEIVER_H_
|
||||
#define _RTP_DATA_RECEIVER_H_
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "io_statistics.h"
|
||||
#include "rtcp_receiver_report.h"
|
||||
#include "rtp_codec.h"
|
||||
#include "rtp_statistics.h"
|
||||
|
||||
class RtpDataReceiver {
|
||||
public:
|
||||
RtpDataReceiver();
|
||||
RtpDataReceiver(std::shared_ptr<IOStatistics> io_statistics);
|
||||
~RtpDataReceiver();
|
||||
|
||||
public:
|
||||
void InsertRtpPacket(RtpPacket& rtp_packet);
|
||||
|
||||
void SetSendDataFunc(std::function<int(const char*, size_t)> data_send_func);
|
||||
|
||||
void SetOnReceiveData(
|
||||
std::function<void(const char*, size_t)> on_receive_data) {
|
||||
on_receive_data_ = on_receive_data;
|
||||
}
|
||||
|
||||
private:
|
||||
bool CheckIsTimeSendRR();
|
||||
int SendRtcpRR(RtcpReceiverReport& rtcp_rr);
|
||||
|
||||
private:
|
||||
std::function<void(const char*, size_t)> on_receive_data_ = nullptr;
|
||||
uint32_t last_complete_frame_ts_ = 0;
|
||||
|
||||
private:
|
||||
std::unique_ptr<RtpStatistics> rtp_statistics_ = nullptr;
|
||||
std::shared_ptr<IOStatistics> io_statistics_ = nullptr;
|
||||
uint32_t last_recv_bytes_ = 0;
|
||||
uint32_t total_rtp_payload_recv_ = 0;
|
||||
uint32_t total_rtp_packets_recv_ = 0;
|
||||
|
||||
uint32_t last_send_rtcp_rr_packet_ts_ = 0;
|
||||
std::function<int(const char*, size_t)> data_send_func_ = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user