完善rtsp生成器

This commit is contained in:
xiongziliang 2018-10-23 22:27:10 +08:00
parent 1cb5c9a7ff
commit 68fc3bdcf8

View File

@ -289,7 +289,7 @@ public:
virtual ~RtspMaker(){} virtual ~RtspMaker(){}
/** /**
* track * title
* @param sdp * @param sdp
* @param ssrc rtp ssrc * @param ssrc rtp ssrc
* @param mtu rtp mtu * @param mtu rtp mtu
@ -305,6 +305,23 @@ public:
} }
/**
* title
* @param track
* @param ssrc rtp ssrc
* @param mtu rtp mtu
*/
void addTrack(const Track::Ptr & track,uint32_t ssrc = 0,int mtu = 1400) {
if(track->getCodecId() == CodecInvalid){
addTrack(std::make_shared<TitleSdp>(),ssrc,mtu);
} else {
Sdp::Ptr sdp = Sdp::getSdpByTrack(track);
if(sdp){
addTrack(sdp,ssrc,mtu);
}
}
}
/** /**
* SDP字符串 * SDP字符串
* @return SDP字符串 * @return SDP字符串