mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-27 13:49:01 +08:00
Compare commits
5 Commits
efbfd991d2
...
92e1e46642
Author | SHA1 | Date | |
---|---|---|---|
|
92e1e46642 | ||
|
226b87a633 | ||
|
6119ac9c53 | ||
|
a33c1d5a08 | ||
|
e7e157c312 |
@ -105,6 +105,16 @@ bool GB28181Process::inputRtp(bool, const char *data, size_t data_len) {
|
||||
_rtp_decoder[pt] = Factory::getRtpDecoderByCodecId(track->getCodecId());
|
||||
break;
|
||||
}
|
||||
case Rtsp::PT_L16_Mono: {
|
||||
//L16
|
||||
ref = std::make_shared<RtpReceiverImp>(16000, [this](RtpPacket::Ptr rtp) { onRtpSorted(std::move(rtp)); });
|
||||
auto track = Factory::getTrackByCodecId(CodecL16, 16000, 1, 16);
|
||||
CHECK(track);
|
||||
track->setIndex(pt);
|
||||
_interface->addTrack(track);
|
||||
_rtp_decoder[pt] = Factory::getRtpDecoderByCodecId(track->getCodecId());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (pt == opus_pt) {
|
||||
// opus负载 [AUTO-TRANSLATED:defa6a8d]
|
||||
|
@ -23,11 +23,10 @@ void RtspMuxer::onRtp(RtpPacket::Ptr in, bool is_key) {
|
||||
if (ref.rtp_stamp != in->getHeader()->stamp) {
|
||||
// rtp时间戳变化才计算ntp,节省cpu资源 [AUTO-TRANSLATED:729d54f2]
|
||||
// Only calculate NTP when the RTP timestamp changes, saving CPU resources
|
||||
int64_t stamp_ms = in->getStamp() * uint64_t(1000) / in->sample_rate;
|
||||
int64_t stamp_ms_inc;
|
||||
// 求rtp时间戳增量 [AUTO-TRANSLATED:f6ba022f]
|
||||
// Get the RTP timestamp increment
|
||||
ref.stamp.revise(stamp_ms, stamp_ms, stamp_ms_inc, stamp_ms_inc);
|
||||
ref.stamp.revise(in->ntp_stamp, in->ntp_stamp, stamp_ms_inc, stamp_ms_inc);
|
||||
ref.rtp_stamp = in->getHeader()->stamp;
|
||||
ref.ntp_stamp = stamp_ms_inc + _ntp_stamp_start;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user