mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-05 10:58:11 +08:00
copy srt official packet recve rate algorithm
This commit is contained in:
@@ -14,6 +14,20 @@
|
||||
namespace SRT {
|
||||
|
||||
using namespace toolkit;
|
||||
|
||||
static const size_t HDR_SIZE = 4; // packet header size = SRT_PH_E_SIZE * sizeof(uint32_t)
|
||||
|
||||
// Can also be calculated as: sizeof(struct ether_header) + sizeof(struct ip) + sizeof(struct udphdr).
|
||||
static const size_t UDP_HDR_SIZE = 28; // 20 bytes IPv4 + 8 bytes of UDP { u16 sport, dport, len, csum }.
|
||||
|
||||
static const size_t SRT_DATA_HDR_SIZE = UDP_HDR_SIZE + HDR_SIZE;
|
||||
|
||||
// Maximum transmission unit size. 1500 in case of Ethernet II (RFC 1191).
|
||||
static const size_t ETH_MAX_MTU_SIZE = 1500;
|
||||
|
||||
// Maximum payload size of an SRT packet.
|
||||
static const size_t SRT_MAX_PAYLOAD_SIZE = ETH_MAX_MTU_SIZE - SRT_DATA_HDR_SIZE;
|
||||
|
||||
/*
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
|
||||
Reference in New Issue
Block a user