diff --git a/src/Rtcp/Rtcp.cpp b/src/Rtcp/Rtcp.cpp index 16e9c9fa..4b7dbd25 100644 --- a/src/Rtcp/Rtcp.cpp +++ b/src/Rtcp/Rtcp.cpp @@ -236,7 +236,6 @@ public: } private: - std::size_t _size; std::shared_ptr _rtcp; }; @@ -604,7 +603,7 @@ std::shared_ptr RtcpBye::create(const std::vector &ssrcs, con setupHeader(ptr, RtcpType::RTCP_BYE, ssrcs.size(), bytes); setupPadding(ptr, bytes - real_size); - auto *ssrc_ptr = &(((RtcpBye *) ptr)->ssrc); + auto ssrc_ptr = ((RtcpBye *) ptr)->ssrc; for (auto ssrc : ssrcs) { *ssrc_ptr = htonl(ssrc); ++ssrc_ptr; @@ -623,7 +622,7 @@ std::shared_ptr RtcpBye::create(const std::vector &ssrcs, con vector RtcpBye::getSSRC() { vector ret; - uint32_t *ssrc_ptr = &ssrc; + auto ssrc_ptr = ssrc; for (size_t i = 0; i < report_count; ++i) { ret.emplace_back(ssrc_ptr); ssrc_ptr += 1; @@ -652,7 +651,7 @@ string RtcpBye::dumpString() const { void RtcpBye::net2Host(size_t size) { static const size_t kMinSize = sizeof(RtcpHeader); CHECK_MIN_SIZE(size, kMinSize); - uint32_t *ssrc_ptr = &ssrc; + auto ssrc_ptr = ssrc; size_t offset = kMinSize; size_t i = 0; for (; i < report_count && offset + sizeof(ssrc) <= size; ++i) { diff --git a/src/Rtcp/Rtcp.h b/src/Rtcp/Rtcp.h index 836699d2..c4055f71 100644 --- a/src/Rtcp/Rtcp.h +++ b/src/Rtcp/Rtcp.h @@ -622,7 +622,7 @@ class RtcpBye : public RtcpHeader { public: friend class RtcpHeader; /* 变长,根据count决定有多少个ssrc */ - uint32_t ssrc; + uint32_t ssrc[1]; /** 中间可能有若干个 ssrc **/ diff --git a/src/Rtcp/RtcpFCI.cpp b/src/Rtcp/RtcpFCI.cpp index d0f4fb62..6acb4d3a 100644 --- a/src/Rtcp/RtcpFCI.cpp +++ b/src/Rtcp/RtcpFCI.cpp @@ -149,7 +149,7 @@ string FCI_REMB::dumpString() const { for (auto &ssrc : ((FCI_REMB *) this)->getSSRC()) { printer << ssrc << " "; } - return printer; + return std::move(printer); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/webrtc/RtpExt.cpp b/webrtc/RtpExt.cpp index a0f47bf1..5ea0192d 100644 --- a/webrtc/RtpExt.cpp +++ b/webrtc/RtpExt.cpp @@ -130,7 +130,7 @@ static bool isOneByteExt(){ } template -static void appendExt(map &ret, uint8_t *ptr, const uint8_t *end) { +void appendExt(map &ret, uint8_t *ptr, const uint8_t *end) { while (ptr < end) { auto ext = reinterpret_cast(ptr); if (ext->getId() == (uint8_t) RtpExtType::padding) { @@ -191,7 +191,7 @@ map RtpExt::getExtValue(const RtpHeader *header) XX(encrypt, "urn:ietf:params:rtp-hdrext:encrypt") #define XX(type, url) {RtpExtType::type , url}, -static unordered_map s_type_to_url = {RTP_EXT_MAP(XX)}; +static map s_type_to_url = {RTP_EXT_MAP(XX)}; #undef XX @@ -353,7 +353,7 @@ uint32_t RtpExt::getAbsSendTime() const { uint16_t RtpExt::getTransportCCSeq() const { CHECK(_type == RtpExtType::transport_cc && size() >= 2); uint16_t ret; - ret |= (*this)[0] << 8; + ret = (*this)[0] << 8; ret |= (*this)[1]; return ret; } diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index f2e232d8..38fecd1f 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -667,7 +667,7 @@ static void changeRtpExtId(const RtpPacket::Ptr &rtp, const Type &map) { auto header = rtp->getHeader(); auto ext_map = RtpExt::getExtValue(header); for (auto &pr : ext_map) { - auto it = map.find((Type::key_type) pr.first); + auto it = map.find((typename Type::key_type) (pr.first)); if (it == map.end()) { WarnL << "未处理的rtp ext, 类型不识别:" << (int) pr.first; pr.second.clearExt(); diff --git a/webrtc/WebRtcTransport.h b/webrtc/WebRtcTransport.h index 84394534..84fdbde5 100644 --- a/webrtc/WebRtcTransport.h +++ b/webrtc/WebRtcTransport.h @@ -226,7 +226,7 @@ private: //根据推流端rtcp的ssrc获取相关信息 unordered_map _rtp_info_ssrc; //发送rtp时需要修改rtp ext id - unordered_map _rtp_ext_type_to_id; + map _rtp_ext_type_to_id; //接收rtp时需要修改rtp ext id unordered_map _rtp_ext_id_to_type; };