From 93160c0ec7173cf6dfd55b8f562a3d52cdf0c78e Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 23 Apr 2021 15:25:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0rtpfb=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E4=B8=8E=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtcp/Rtcp.cpp | 9 +++++++++ src/Rtcp/Rtcp.h | 12 ++++++++++++ 2 files changed, 21 insertions(+) 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