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
49a0183d
Commit
49a0183d
authored
Jun 09, 2022
by
xiongguangjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix clang format change include order result in windows build error
parent
f58211fb
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
21 行增加
和
4 行删除
+21
-4
srt/Common.hpp
+2
-1
srt/Packet.cpp
+7
-3
srt/SrtTransport.cpp
+10
-0
srt/SrtTransport.hpp
+2
-0
没有找到文件。
srt/Common.hpp
查看文件 @
49a0183d
#
ifndef
ZLMEDIAKIT_SRT_COMMON_H
#
ifndef
ZLMEDIAKIT_SRT_COMMON_H
#define ZLMEDIAKIT_SRT_COMMON_H
#define ZLMEDIAKIT_SRT_COMMON_H
#if defined(_WIN32)
#if defined(_WIN32)
#include <Iphlpapi.h>
#include <winsock2.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <ws2tcpip.h>
#include <Iphlpapi.h>
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Iphlpapi.lib")
#pragma comment(lib, "Iphlpapi.lib")
#else
#else
...
...
srt/Packet.cpp
查看文件 @
49a0183d
...
@@ -294,8 +294,12 @@ bool HandshakePacket::loadExtMessage(uint8_t *buf, size_t len) {
...
@@ -294,8 +294,12 @@ bool HandshakePacket::loadExtMessage(uint8_t *buf, size_t len) {
length
=
loadUint16
(
ptr
+
2
);
length
=
loadUint16
(
ptr
+
2
);
switch
(
type
)
{
switch
(
type
)
{
case
HSExt
:
:
SRT_CMD_HSREQ
:
case
HSExt
:
:
SRT_CMD_HSREQ
:
case
HSExt
:
:
SRT_CMD_HSRSP
:
ext
=
std
::
make_shared
<
HSExtMessage
>
();
break
;
case
HSExt
:
:
SRT_CMD_HSRSP
:
case
HSExt
:
:
SRT_CMD_SID
:
ext
=
std
::
make_shared
<
HSExtStreamID
>
();
break
;
ext
=
std
::
make_shared
<
HSExtMessage
>
();
break
;
case
HSExt
:
:
SRT_CMD_SID
:
ext
=
std
::
make_shared
<
HSExtStreamID
>
();
break
;
default
:
default
:
WarnL
<<
"not support ext "
<<
type
;
WarnL
<<
"not support ext "
<<
type
;
break
;
break
;
...
@@ -410,7 +414,7 @@ void HandshakePacket::assignPeerIP(struct sockaddr_storage *addr) {
...
@@ -410,7 +414,7 @@ void HandshakePacket::assignPeerIP(struct sockaddr_storage *addr) {
memset
(
peer_ip_addr
,
0
,
sizeof
(
peer_ip_addr
)
*
sizeof
(
peer_ip_addr
[
0
]));
memset
(
peer_ip_addr
,
0
,
sizeof
(
peer_ip_addr
)
*
sizeof
(
peer_ip_addr
[
0
]));
if
(
addr
->
ss_family
==
AF_INET
)
{
if
(
addr
->
ss_family
==
AF_INET
)
{
struct
sockaddr_in
*
ipv4
=
(
struct
sockaddr_in
*
)
addr
;
struct
sockaddr_in
*
ipv4
=
(
struct
sockaddr_in
*
)
addr
;
//抓包 奇怪好像是小头端???
//
抓包 奇怪好像是小头端???
storeUint32LE
(
peer_ip_addr
,
ipv4
->
sin_addr
.
s_addr
);
storeUint32LE
(
peer_ip_addr
,
ipv4
->
sin_addr
.
s_addr
);
}
else
if
(
addr
->
ss_family
==
AF_INET6
)
{
}
else
if
(
addr
->
ss_family
==
AF_INET6
)
{
if
(
IN6_IS_ADDR_V4MAPPED
(
&
((
struct
sockaddr_in6
*
)
addr
)
->
sin6_addr
))
{
if
(
IN6_IS_ADDR_V4MAPPED
(
&
((
struct
sockaddr_in6
*
)
addr
)
->
sin6_addr
))
{
...
...
srt/SrtTransport.cpp
查看文件 @
49a0183d
...
@@ -127,6 +127,8 @@ void SrtTransport::handleHandshakeInduction(HandshakePacket &pkt, struct sockadd
...
@@ -127,6 +127,8 @@ void SrtTransport::handleHandshakeInduction(HandshakePacket &pkt, struct sockadd
_max_window_size
=
pkt
.
max_flow_window_size
;
_max_window_size
=
pkt
.
max_flow_window_size
;
_mtu
=
pkt
.
mtu
;
_mtu
=
pkt
.
mtu
;
_last_pkt_seq
=
_init_seq_number
-
1
;
_peer_socket_id
=
pkt
.
srt_socket_id
;
_peer_socket_id
=
pkt
.
srt_socket_id
;
HandshakePacket
::
Ptr
res
=
std
::
make_shared
<
HandshakePacket
>
();
HandshakePacket
::
Ptr
res
=
std
::
make_shared
<
HandshakePacket
>
();
res
->
dst_socket_id
=
_peer_socket_id
;
res
->
dst_socket_id
=
_peer_socket_id
;
...
@@ -318,6 +320,10 @@ void SrtTransport::handleDropReq(uint8_t *buf, int len, struct sockaddr_storage
...
@@ -318,6 +320,10 @@ void SrtTransport::handleDropReq(uint8_t *buf, int len, struct sockaddr_storage
uint32_t
max_seq
=
0
;
uint32_t
max_seq
=
0
;
for
(
auto
data
:
list
)
{
for
(
auto
data
:
list
)
{
max_seq
=
data
->
packet_seq_number
;
max_seq
=
data
->
packet_seq_number
;
if
(
_last_pkt_seq
+
1
!=
data
->
packet_seq_number
)
{
TraceL
<<
"pkt lost "
<<
_last_pkt_seq
+
1
<<
"->"
<<
data
->
packet_seq_number
;
}
_last_pkt_seq
=
data
->
packet_seq_number
;
onSRTData
(
std
::
move
(
data
));
onSRTData
(
std
::
move
(
data
));
}
}
_recv_nack
.
drop
(
max_seq
);
_recv_nack
.
drop
(
max_seq
);
...
@@ -454,6 +460,10 @@ void SrtTransport::handleDataPacket(uint8_t *buf, int len, struct sockaddr_stora
...
@@ -454,6 +460,10 @@ void SrtTransport::handleDataPacket(uint8_t *buf, int len, struct sockaddr_stora
uint32_t
last_seq
;
uint32_t
last_seq
;
for
(
auto
data
:
list
)
{
for
(
auto
data
:
list
)
{
last_seq
=
data
->
packet_seq_number
;
last_seq
=
data
->
packet_seq_number
;
if
(
_last_pkt_seq
+
1
!=
data
->
packet_seq_number
)
{
TraceL
<<
"pkt lost "
<<
_last_pkt_seq
+
1
<<
"->"
<<
data
->
packet_seq_number
;
}
_last_pkt_seq
=
data
->
packet_seq_number
;
onSRTData
(
std
::
move
(
data
));
onSRTData
(
std
::
move
(
data
));
}
}
_recv_nack
.
drop
(
last_seq
);
_recv_nack
.
drop
(
last_seq
);
...
...
srt/SrtTransport.hpp
查看文件 @
49a0183d
...
@@ -125,6 +125,8 @@ private:
...
@@ -125,6 +125,8 @@ private:
uint32_t
_light_ack_pkt_count
=
0
;
uint32_t
_light_ack_pkt_count
=
0
;
uint32_t
_ack_number_count
=
0
;
uint32_t
_ack_number_count
=
0
;
uint32_t
_last_ack_pkt_seq_num
=
0
;
uint32_t
_last_ack_pkt_seq_num
=
0
;
uint32_t
_last_pkt_seq
=
0
;
UTicker
_ack_ticker
;
UTicker
_ack_ticker
;
std
::
map
<
uint32_t
,
TimePoint
>
_ack_send_timestamp
;
std
::
map
<
uint32_t
,
TimePoint
>
_ack_send_timestamp
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论