添加rtpfb枚举与工具类

This commit is contained in:
xia-chu 2021-04-23 15:25:33 +08:00
parent 48338af700
commit 93160c0ec7
2 changed files with 21 additions and 0 deletions

View File

@ -42,6 +42,15 @@ const char *psfbTypeToStr(PSFBType type) {
}
}
const char *rtpfbTypeToStr(RTPFBType type) {
switch (type){
#define SWITCH_CASE(key, value) case RTPFBType::key : return #value "(" #key ")";
RTPFB_TYPE_MAP(SWITCH_CASE)
#undef SWITCH_CASE
default: return "unknown transport layer feedback messages fmt type";
}
}
static size_t alignSize(size_t bytes) {
return (size_t)((bytes + 3) / 4) << 2;
}

View File

@ -133,6 +133,13 @@ enum class PSFBType : uint8_t {
#undef XX
};
//rtpfb类型枚举
enum class RTPFBType : uint8_t {
#define XX(key, value) key = value,
RTPFB_TYPE_MAP(XX)
#undef XX
};
/**
* RtcpType转描述字符串
*/
@ -148,6 +155,11 @@ const char *sdesTypeToStr(SdesType type);
*/
const char *psfbTypeToStr(PSFBType type);
/**
* rtpfb枚举转描述字符串
*/
const char *rtpfbTypeToStr(RTPFBType type);
class RtcpHeader {
public:
#if __BYTE_ORDER == __BIG_ENDIAN