From 30260e5414d71922b7d4a5a2c2eff146e1e81540 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Tue, 7 Jul 2020 09:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E7=94=A8printSSRC=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/Rtsp.cpp | 10 ++++++++++ src/Rtsp/Rtsp.h | 1 + src/Rtsp/RtspSession.cpp | 9 --------- src/Rtsp/RtspSession.h | 2 -- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Rtsp/Rtsp.cpp b/src/Rtsp/Rtsp.cpp index b55c1d0e..c93331d6 100644 --- a/src/Rtsp/Rtsp.cpp +++ b/src/Rtsp/Rtsp.cpp @@ -404,4 +404,14 @@ std::pair makeSockPair(const EventPoller::Ptr &poller, } } +string printSSRC(uint32_t ui32Ssrc) { + char tmp[9] = { 0 }; + ui32Ssrc = htonl(ui32Ssrc); + uint8_t *pSsrc = (uint8_t *) &ui32Ssrc; + for (int i = 0; i < 4; i++) { + sprintf(tmp + 2 * i, "%02X", pSsrc[i]); + } + return tmp; +} + }//namespace mediakit \ No newline at end of file diff --git a/src/Rtsp/Rtsp.h b/src/Rtsp/Rtsp.h index 3e7a22e7..ff31295c 100644 --- a/src/Rtsp/Rtsp.h +++ b/src/Rtsp/Rtsp.h @@ -272,6 +272,7 @@ private: }; std::pair makeSockPair(const EventPoller::Ptr &poller, const string &local_ip); +string printSSRC(uint32_t ui32Ssrc); } //namespace mediakit #endif //RTSP_RTSP_H_ diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index d73b11f1..d60941b4 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -1068,15 +1068,6 @@ bool RtspSession::sendRtspResponse(const string &res_code, return sendRtspResponse(res_code,header_map,sdp,protocol); } -inline string RtspSession::printSSRC(uint32_t ui32Ssrc) { - char tmp[9] = { 0 }; - ui32Ssrc = htonl(ui32Ssrc); - uint8_t *pSsrc = (uint8_t *) &ui32Ssrc; - for (int i = 0; i < 4; i++) { - sprintf(tmp + 2 * i, "%02X", pSsrc[i]); - } - return tmp; -} inline int RtspSession::getTrackIndexByTrackType(TrackType type) { for (unsigned int i = 0; i < _aTrackInfo.size(); i++) { if (type == _aTrackInfo[i]->_type) { diff --git a/src/Rtsp/RtspSession.h b/src/Rtsp/RtspSession.h index c7e3160c..eeba0d85 100644 --- a/src/Rtsp/RtspSession.h +++ b/src/Rtsp/RtspSession.h @@ -136,8 +136,6 @@ private: void inline send_SessionNotFound(); //一般rtsp服务器打开端口失败时触发 void inline send_NotAcceptable(); - //ssrc转字符串 - inline string printSSRC(uint32_t ui32Ssrc); //获取track下标 inline int getTrackIndexByTrackType(TrackType type);