diff --git a/src/Rtcp/Rtcp.cpp b/src/Rtcp/Rtcp.cpp index 35853e80..33ac59e3 100644 --- a/src/Rtcp/Rtcp.cpp +++ b/src/Rtcp/Rtcp.cpp @@ -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; } diff --git a/src/Rtcp/Rtcp.h b/src/Rtcp/Rtcp.h index 88fa5475..838ddf40 100644 --- a/src/Rtcp/Rtcp.h +++ b/src/Rtcp/Rtcp.h @@ -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