mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-23 01:57:50 +08:00
Compare commits
No commits in common. "8c9439571032a0db7d678a0104443125dc0d6916" and "6f16c81d97fd95b2601704de16f017ed42ca19e7" have entirely different histories.
8c94395710
...
6f16c81d97
@ -1 +1 @@
|
||||
Subproject commit 493d14e1682cc0c79e72b3893dd98f865d45b8e9
|
||||
Subproject commit 84a853154215d045be2edb569a357c263e941bf1
|
||||
@ -338,7 +338,7 @@ gop_cache=1
|
||||
|
||||
#国标发送g711 rtp 打包时,每个包的语音时长是多少,默认是100 ms,范围为20~180ms (gb28181-2016,c.2.4规定),
|
||||
#最好为20 的倍数,程序自动向20的倍数取整
|
||||
rtp_g711_dur_ms=100
|
||||
rtp_g711_dur_ms = 100
|
||||
#udp接收数据socket buffer大小配置
|
||||
#4*1024*1024=4196304
|
||||
udp_recv_socket_buffer=4194304
|
||||
@ -359,12 +359,8 @@ iceTransportPolicy=0
|
||||
#STUN/TURN 服务Ice密码
|
||||
iceUfrag=ZLMediaKit
|
||||
icePwd=ZLMediaKit
|
||||
#webrtc datachannel是否回显数据,测试用
|
||||
datachannel_echo=1
|
||||
|
||||
max_stun_retry=7
|
||||
#TURN服务分配端口池
|
||||
port_range=49152-65535
|
||||
portRange=50000-65000
|
||||
#rtc播放推流、播放超时时间
|
||||
timeoutSec=15
|
||||
#本机对rtc客户端的可见ip,作为服务器时一般为公网ip,可有多个,用','分开,当置空时,会自动获取网卡ip
|
||||
@ -430,6 +426,7 @@ pktBufSize=8192
|
||||
#srt udp服务器的密码,为空表示不加密
|
||||
passPhrase=
|
||||
|
||||
|
||||
[rtsp]
|
||||
#rtsp专有鉴权方式是采用base64还是md5方式
|
||||
authBasic=0
|
||||
@ -456,13 +453,9 @@ lowLatency=0
|
||||
#当客户端发起RTSP SETUP的时候如果传输类型和此配置不一致则返回461 Unsupported transport
|
||||
#迫使客户端重新SETUP并切换到对应协议。目前支持FFMPEG和VLC
|
||||
rtpTransportType=-1
|
||||
|
||||
[shell]
|
||||
#调试telnet服务器接受最大buffer大小
|
||||
maxReqSize=1024
|
||||
#调试telnet服务器监听端口
|
||||
port=0
|
||||
|
||||
# onvif搜索用
|
||||
[onvif]
|
||||
port=3702
|
||||
|
||||
@ -30,22 +30,7 @@ bool loadIniConfig(const char *ini_path) {
|
||||
ini = exePath() + ".ini";
|
||||
}
|
||||
try {
|
||||
mINI tmp;
|
||||
tmp.parseFile(ini);
|
||||
|
||||
auto &ref = mINI::Instance();
|
||||
for (auto &pr : tmp) {
|
||||
if (ref.find(pr.first) == ref.end()) {
|
||||
// 新增键
|
||||
WarnL << "unknow config: " << pr.first << " = " << pr.second;
|
||||
ref.emplace(pr);
|
||||
} else {
|
||||
// 更新键
|
||||
ref[pr.first] = pr.second;
|
||||
}
|
||||
}
|
||||
// 更新注释和排序
|
||||
ref.updateFrom(tmp);
|
||||
mINI::Instance().parseFile(ini);
|
||||
NOTICE_EMIT(BroadcastReloadConfigArgs, Broadcast::kBroadcastReloadConfig);
|
||||
return true;
|
||||
} catch (std::exception &) {
|
||||
|
||||
@ -464,7 +464,7 @@ void RtspPlayer::sendPause(int type, uint32_t seekMS) {
|
||||
// Start or pause RTSP
|
||||
switch (type) {
|
||||
case type_pause: sendRtspRequest("PAUSE", _control_url, {}); break;
|
||||
case type_play:
|
||||
case type_play: sendRtspRequest("PLAY", _content_base); break;
|
||||
case type_seek:
|
||||
sendRtspRequest("PLAY", _control_url, { "Range", StrPrinter << "npt=" << setiosflags(ios::fixed) << setprecision(2) << seekMS / 1000.0 << "-" });
|
||||
break;
|
||||
@ -582,9 +582,6 @@ void RtspPlayer::onRtcpPacket(int track_idx, SdpTrack::Ptr &track, uint8_t *data
|
||||
|
||||
void RtspPlayer::onRtpSorted(RtpPacket::Ptr rtppt, int trackidx) {
|
||||
_stamp[trackidx] = rtppt->getStampMS();
|
||||
if (!_first_stamp[trackidx]) {
|
||||
_first_stamp[trackidx] = _stamp[trackidx];
|
||||
}
|
||||
_rtp_recv_ticker.resetTime();
|
||||
onRecvRTP(std::move(rtppt), _sdp_track[trackidx]);
|
||||
}
|
||||
@ -612,7 +609,7 @@ float RtspPlayer::getPacketLossRate(TrackType type) const {
|
||||
}
|
||||
|
||||
uint32_t RtspPlayer::getProgressMilliSecond() const {
|
||||
return MAX(_stamp[0] - _first_stamp[0], _stamp[1] - _first_stamp[1]);
|
||||
return MAX(_stamp[0], _stamp[1]);
|
||||
}
|
||||
|
||||
void RtspPlayer::seekToMilliSecond(uint32_t ms) {
|
||||
@ -688,18 +685,14 @@ void RtspPlayer::sendRtspRequest(const string &cmd, const string &url, const Str
|
||||
printer << cmd << " " << url << " RTSP/1.0\r\n";
|
||||
|
||||
TraceL << cmd << " "<< url;
|
||||
|
||||
if (cmd == "PLAY") {
|
||||
// play命令时支持覆盖更新rtsp头,用于onvif点播等场景
|
||||
for (auto &pr : _custom_header) {
|
||||
header[pr.first] = pr.second;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &pr : header) {
|
||||
printer << pr.first << ": " << pr.second << "\r\n";
|
||||
}
|
||||
|
||||
if (cmd == "PLAY") {
|
||||
for (auto &pr : _custom_header) {
|
||||
printer << pr.first << ": " << pr.second << "\r\n";
|
||||
}
|
||||
}
|
||||
printer << "\r\n";
|
||||
SockSender::send(std::move(printer));
|
||||
}
|
||||
|
||||
@ -184,12 +184,9 @@ protected:
|
||||
Rtsp::eRtpType _rtp_type = Rtsp::RTP_TCP;
|
||||
|
||||
private:
|
||||
// 起始时间戳
|
||||
uint64_t _first_stamp[2] = {0, 0};
|
||||
|
||||
// 当前rtp时间戳 [AUTO-TRANSLATED:410f2691]
|
||||
// Current rtp timestamp
|
||||
uint64_t _stamp[2] = {0, 0};
|
||||
uint32_t _stamp[2] = {0, 0};
|
||||
|
||||
// 超时功能实现 [AUTO-TRANSLATED:1d603b3a]
|
||||
// Timeout function implementation
|
||||
|
||||
Loading…
Reference in New Issue
Block a user