优化接口命名,更新ZLToolKit

This commit is contained in:
xiongziliang 2019-05-09 10:49:50 +08:00
parent fe19ea3991
commit 9d92f613e2
5 changed files with 11 additions and 9 deletions

@ -1 +1 @@
Subproject commit 682965692e26ac50652cb574625e3f20e1a651ba Subproject commit beb3be990a26b395359c9e1965a1f645267133fa

View File

@ -357,7 +357,8 @@ void RtspPlayer::handleResSETUP(const Parser &parser, unsigned int uiTrackIndex)
WarnL << "收到其他地址的rtcp数据:" << inet_ntoa(((struct sockaddr_in *) addr)->sin_addr); WarnL << "收到其他地址的rtcp数据:" << inet_ntoa(((struct sockaddr_in *) addr)->sin_addr);
return; return;
} }
strongSelf->onRecvRtcp(uiTrackIndex, strongSelf->_aTrackInfo[uiTrackIndex], (unsigned char *) buf->data(), buf->size()); strongSelf->onRtcpPacket(uiTrackIndex, strongSelf->_aTrackInfo[uiTrackIndex],
(unsigned char *) buf->data(), buf->size());
}); });
} }
} }
@ -481,12 +482,12 @@ void RtspPlayer::onRtpPacket(const char *data, uint64_t len) {
}else{ }else{
trackIdx = getTrackIndexByInterleaved(interleaved - 1); trackIdx = getTrackIndexByInterleaved(interleaved - 1);
if (trackIdx != -1) { if (trackIdx != -1) {
onRecvRtcp(trackIdx,_aTrackInfo[trackIdx],(unsigned char *)data + 4, len - 4); onRtcpPacket(trackIdx, _aTrackInfo[trackIdx], (unsigned char *) data + 4, len - 4);
} }
} }
} }
void RtspPlayer::onRecvRtcp(int iTrackidx,SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen){ void RtspPlayer::onRtcpPacket(int iTrackidx, SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen){
} }

View File

@ -93,7 +93,7 @@ protected:
* @param pucData * @param pucData
* @param uiLen * @param uiLen
*/ */
virtual void onRecvRtcp(int iTrackidx,SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen); virtual void onRtcpPacket(int iTrackidx, SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen);
/** /**
* rtcp包维持心跳 * rtcp包维持心跳

View File

@ -197,12 +197,12 @@ void RtspSession::onRtpPacket(const char *data, uint64_t len) {
}else{ }else{
trackIdx = getTrackIndexByInterleaved(interleaved - 1); trackIdx = getTrackIndexByInterleaved(interleaved - 1);
if (trackIdx != -1) { if (trackIdx != -1) {
onRecvRtcp(trackIdx,_aTrackInfo[trackIdx],(unsigned char *)data + 4, len - 4); onRtcpPacket(trackIdx, _aTrackInfo[trackIdx], (unsigned char *) data + 4, len - 4);
} }
} }
} }
void RtspSession::onRecvRtcp(int iTrackidx,SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen){ void RtspSession::onRtcpPacket(int iTrackidx, SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen){
} }
int64_t RtspSession::getContentLength(Parser &parser) { int64_t RtspSession::getContentLength(Parser &parser) {
@ -996,7 +996,8 @@ inline void RtspSession::onRcvPeerUdpData(int intervaled, const Buffer::Ptr &pBu
if(_udpSockConnected.count(intervaled)){ if(_udpSockConnected.count(intervaled)){
_apRtcpSock[(intervaled - 1) / 2]->setSendPeerAddr(&addr); _apRtcpSock[(intervaled - 1) / 2]->setSendPeerAddr(&addr);
} }
onRecvRtcp((intervaled - 1) / 2,_aTrackInfo[(intervaled - 1) / 2],( unsigned char *)pBuf->data(),pBuf->size()); onRtcpPacket((intervaled - 1) / 2, _aTrackInfo[(intervaled - 1) / 2], (unsigned char *) pBuf->data(),
pBuf->size());
} }
} }

View File

@ -120,7 +120,7 @@ protected:
* @param pucData * @param pucData
* @param uiLen * @param uiLen
*/ */
virtual void onRecvRtcp(int iTrackidx,SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen); virtual void onRtcpPacket(int iTrackidx, SdpTrack::Ptr &track, unsigned char *pucData, unsigned int uiLen);
private: private:
bool handleReq_Options(const Parser &parser); //处理options方法 bool handleReq_Options(const Parser &parser); //处理options方法
bool handleReq_Describe(const Parser &parser); //处理describe方法 bool handleReq_Describe(const Parser &parser); //处理describe方法