mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
RtpCodec保存和还原Rtp seq
This commit is contained in:
parent
5c92b4e48f
commit
5041cf5ba4
@ -84,7 +84,9 @@ public:
|
||||
uint32_t getSsrc() const {
|
||||
return _ssrc;
|
||||
}
|
||||
|
||||
int16_t getSeq() const {return _seq;}
|
||||
void setSeq(int16_t seq) {_seq = seq;}
|
||||
|
||||
RtpPacket::Ptr makeRtp(TrackType type,const void *data, size_t len, bool mark, uint64_t stamp);
|
||||
|
||||
private:
|
||||
|
@ -38,6 +38,7 @@ void RtspMuxer::onRtp(RtpPacket::Ptr in, bool is_key) {
|
||||
in->ntp_stamp = _ntp_stamp_start + (in->getStamp() * uint64_t(1000) / in->sample_rate);
|
||||
}
|
||||
#endif
|
||||
_rtp_seq[in->type] = in->getSeq() + 1;
|
||||
_rtpRing->write(std::move(in), is_key);
|
||||
}
|
||||
|
||||
@ -71,7 +72,8 @@ bool RtspMuxer::addTrack(const Track::Ptr &track) {
|
||||
if (!encoder) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto rtp = std::dynamic_pointer_cast<RtpInfo>(encoder);
|
||||
rtp->setSeq(_rtp_seq[track->getTrackType()]);
|
||||
//设置rtp输出环形缓存
|
||||
encoder->setRtpRing(_rtpInterceptor);
|
||||
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
* 获取完整的SDP字符串
|
||||
* @return SDP字符串
|
||||
*/
|
||||
std::string getSdp() ;
|
||||
std::string getSdp();
|
||||
|
||||
/**
|
||||
* 获取rtp环形缓存
|
||||
@ -80,7 +80,7 @@ public:
|
||||
/**
|
||||
* 重置所有track
|
||||
*/
|
||||
void resetTracks() override ;
|
||||
void resetTracks() override;
|
||||
|
||||
private:
|
||||
void onRtp(RtpPacket::Ptr in, bool is_key);
|
||||
@ -88,6 +88,7 @@ private:
|
||||
|
||||
private:
|
||||
bool _live = true;
|
||||
uint16_t _rtp_seq[TrackMax]{0};
|
||||
uint32_t _rtp_stamp[TrackMax]{0};
|
||||
uint64_t _ntp_stamp[TrackMax]{0};
|
||||
uint64_t _ntp_stamp_start;
|
||||
|
Loading…
Reference in New Issue
Block a user