Implementation for rtcp sender report

This commit is contained in:
dijunkun
2023-09-12 17:30:08 +08:00
parent 8c545f7544
commit c1d31790d4
15 changed files with 470 additions and 204 deletions

20
src/rtcp/rtcp_header.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "rtcp_header.h"
RtcpHeader::RtcpHeader()
: version_(0), padding_(0), count_or_format_(0), length_(0) {}
RtcpHeader::~RtcpHeader() {}
int RtcpHeader::Encode(uint8_t version, uint8_t padding,
uint8_t count_or_format, uint8_t payload_type,
uint16_t length, uint8_t* buffer) {
if (!buffer) {
return 0;
}
buffer[0] = (version << 6) | (padding << 5) | (count_or_format << 4);
buffer[1] = payload_type;
buffer[2] = length >> 8 & 0xFF;
buffer[3] = length & 0xFF;
return 4;
}