Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
642ca499
Commit
642ca499
authored
Sep 22, 2022
by
xiongguangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more dump
parent
533f35da
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
28 行增加
和
4 行删除
+28
-4
srt/Packet.hpp
+1
-1
srt/SrtTransport.cpp
+6
-2
srt/Statistic.cpp
+19
-0
srt/Statistic.hpp
+2
-1
没有找到文件。
srt/Packet.hpp
查看文件 @
642ca499
...
...
@@ -15,7 +15,7 @@ namespace SRT {
using
namespace
toolkit
;
static
const
size_t
HDR_SIZE
=
4
;
// packet header size = SRT_PH_E_SIZE * sizeof(uint32_t)
static
const
size_t
HDR_SIZE
=
16
;
// packet header size = SRT_PH_E_SIZE * sizeof(uint32_t)
// Can also be calculated as: sizeof(struct ether_header) + sizeof(struct ip) + sizeof(struct udphdr).
static
const
size_t
UDP_HDR_SIZE
=
28
;
// 20 bytes IPv4 + 8 bytes of UDP { u16 sport, dport, len, csum }.
...
...
srt/SrtTransport.cpp
查看文件 @
642ca499
...
...
@@ -105,7 +105,7 @@ void SrtTransport::inputSockData(uint8_t *buf, int len, struct sockaddr_storage
if
(
_handleshake_timer
){
_handleshake_timer
.
reset
();
}
_pkt_recv_rate_context
->
inputPacket
(
_now
,
len
-
HDR_SIZE
);
_pkt_recv_rate_context
->
inputPacket
(
_now
,
len
+
UDP_
HDR_SIZE
);
//_recv_rate_context->inputPacket(_now, len);
handleDataPacket
(
buf
,
len
,
addr
);
...
...
@@ -484,7 +484,11 @@ void SrtTransport::sendACKPacket() {
pkt
->
pkt_recv_rate
=
_pkt_recv_rate_context
->
getPacketRecvRate
(
recv_rate
);
pkt
->
estimated_link_capacity
=
_estimated_link_capacity_context
->
getEstimatedLinkCapacity
();
pkt
->
recv_rate
=
recv_rate
;
TraceL
<<
pkt
->
pkt_recv_rate
<<
" pkt/s "
<<
recv_rate
<<
" byte/s "
<<
pkt
->
estimated_link_capacity
<<
" pkt/s (cap)"
;
if
(
pkt
->
pkt_recv_rate
==
0
){
TraceL
<<
pkt
->
pkt_recv_rate
<<
" pkt/s "
<<
recv_rate
<<
" byte/s "
<<
pkt
->
estimated_link_capacity
<<
" pkt/s (cap)"
;
TraceL
<<
_pkt_recv_rate_context
->
dump
();
}
pkt
->
storeToData
();
_ack_send_timestamp
[
pkt
->
ack_number
]
=
_now
;
_last_ack_pkt_seq_num
=
pkt
->
last_ack_pkt_seq_number
;
...
...
srt/Statistic.cpp
查看文件 @
642ca499
...
...
@@ -58,6 +58,25 @@ uint32_t PacketRecvRateContext::getPacketRecvRate(uint32_t &bytesps) {
}
std
::
string
PacketRecvRateContext
::
dump
(){
_StrPrinter
printer
;
printer
<<
"dur array : "
;
for
(
size_t
i
=
0
;
i
<
SIZE
;
i
++
)
{
printer
<<
_ts_arr
[
i
]
<<
" "
;
}
printer
<<
"
\r\n
"
;
printer
<<
"size array : "
;
for
(
size_t
i
=
0
;
i
<
SIZE
;
i
++
)
{
printer
<<
_size_arr
[
i
]
<<
" "
;
}
printer
<<
"
\r\n
"
;
return
std
::
move
(
printer
);
}
EstimatedLinkCapacityContext
::
EstimatedLinkCapacityContext
(
TimePoint
start
)
:
_start
(
start
)
{
for
(
size_t
i
=
0
;
i
<
SIZE
;
i
++
)
{
_dur_probe_arr
[
i
]
=
1000
;
...
...
srt/Statistic.hpp
查看文件 @
642ca499
...
...
@@ -12,6 +12,7 @@ public:
~
PacketRecvRateContext
()
=
default
;
void
inputPacket
(
TimePoint
&
ts
,
size_t
len
=
0
);
uint32_t
getPacketRecvRate
(
uint32_t
&
bytesps
);
std
::
string
dump
();
static
const
int
SIZE
=
16
;
private
:
TimePoint
_last_arrive_time
;
...
...
@@ -30,7 +31,7 @@ public:
}
void
inputPacket
(
TimePoint
&
ts
,
DataPacket
::
Ptr
&
pkt
);
uint32_t
getEstimatedLinkCapacity
();
static
const
int
SIZE
=
16
;
static
const
int
SIZE
=
64
;
private
:
void
probe1Arrival
(
TimePoint
&
ts
,
const
DataPacket
::
Ptr
&
pkt
,
bool
unordered
);
void
probe2Arrival
(
TimePoint
&
ts
,
const
DataPacket
::
Ptr
&
pkt
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论