rtsp and rtp h264 lowlatency mode config

This commit is contained in:
xiongguangjie
2022-10-19 14:20:53 +08:00
parent 4a51d6b488
commit 0d2e035215
5 changed files with 33 additions and 5 deletions

View File

@@ -283,11 +283,19 @@ bool H264RtpEncoder::inputFrame(const Frame::Ptr &frame) {
default: break;
}
if (_last_frame) {
//如果时间戳发生了变化那么markbit才置true
inputFrame_l(_last_frame, _last_frame->pts() != frame->pts());
GET_CONFIG(int,lowLatency,Rtp::KLowLatency);
if (lowLatency) { // 低延迟模式
if (_last_frame) {
flush();
}
inputFrame_l(frame, true);
} else {
if (_last_frame) {
//如果时间戳发生了变化那么markbit才置true
inputFrame_l(_last_frame, _last_frame->pts() != frame->pts());
}
_last_frame = Frame::getCacheAbleFrame(frame);
}
_last_frame = Frame::getCacheAbleFrame(frame);
return true;
}