add srt config for lantency multiplier

This commit is contained in:
xiongguangjie
2022-06-06 19:55:47 +08:00
parent 9f357c24b8
commit 83d75c9a72
5 changed files with 16 additions and 5 deletions

View File

@@ -11,6 +11,8 @@ const std::string kTimeOutSec = SRT_FIELD"timeoutSec";
//srt 单端口udp服务器
const std::string kPort = SRT_FIELD"port";
const std::string kLantencyMul = SRT_FIELD"lantencyMul";
static std::atomic<uint32_t> s_srt_socket_id_generate{125};
//////////// SrtTransport //////////////////////////
SrtTransport::SrtTransport(const EventPoller::Ptr &poller)
@@ -155,7 +157,7 @@ void SrtTransport::handleHandshakeConclusion(HandshakePacket &pkt, struct sockad
HSExtMessage::Ptr req;
HSExtStreamID::Ptr sid;
uint32_t srt_flag = 0xbf;
uint16_t delay = DurationCountMicroseconds(_now - _induction_ts)*4/1000;
uint16_t delay = DurationCountMicroseconds(_now - _induction_ts)*getLantencyMul()/1000;
for (auto ext : pkt.ext_list) {
//TraceL << getIdentifier() << " ext " << ext->dump();
@@ -210,8 +212,6 @@ void SrtTransport::handleHandshakeConclusion(HandshakePacket &pkt, struct sockad
}
_last_ack_pkt_seq_num = _init_seq_number;
}
void SrtTransport::bufCheckInterval(){
}
void SrtTransport::handleHandshake(uint8_t *buf, int len, struct sockaddr_storage *addr){
HandshakePacket pkt;
assert(pkt.loadFromData(buf,len));