mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 20:47:08 +08:00
复用printSSRC函数
This commit is contained in:
parent
80d9f8ccaa
commit
30260e5414
@ -404,4 +404,14 @@ std::pair<Socket::Ptr, Socket::Ptr> 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
|
}//namespace mediakit
|
@ -272,6 +272,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
std::pair<Socket::Ptr, Socket::Ptr> makeSockPair(const EventPoller::Ptr &poller, const string &local_ip);
|
std::pair<Socket::Ptr, Socket::Ptr> makeSockPair(const EventPoller::Ptr &poller, const string &local_ip);
|
||||||
|
string printSSRC(uint32_t ui32Ssrc);
|
||||||
|
|
||||||
} //namespace mediakit
|
} //namespace mediakit
|
||||||
#endif //RTSP_RTSP_H_
|
#endif //RTSP_RTSP_H_
|
||||||
|
@ -1068,15 +1068,6 @@ bool RtspSession::sendRtspResponse(const string &res_code,
|
|||||||
return sendRtspResponse(res_code,header_map,sdp,protocol);
|
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) {
|
inline int RtspSession::getTrackIndexByTrackType(TrackType type) {
|
||||||
for (unsigned int i = 0; i < _aTrackInfo.size(); i++) {
|
for (unsigned int i = 0; i < _aTrackInfo.size(); i++) {
|
||||||
if (type == _aTrackInfo[i]->_type) {
|
if (type == _aTrackInfo[i]->_type) {
|
||||||
|
@ -136,8 +136,6 @@ private:
|
|||||||
void inline send_SessionNotFound();
|
void inline send_SessionNotFound();
|
||||||
//一般rtsp服务器打开端口失败时触发
|
//一般rtsp服务器打开端口失败时触发
|
||||||
void inline send_NotAcceptable();
|
void inline send_NotAcceptable();
|
||||||
//ssrc转字符串
|
|
||||||
inline string printSSRC(uint32_t ui32Ssrc);
|
|
||||||
|
|
||||||
//获取track下标
|
//获取track下标
|
||||||
inline int getTrackIndexByTrackType(TrackType type);
|
inline int getTrackIndexByTrackType(TrackType type);
|
||||||
|
Loading…
Reference in New Issue
Block a user