Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
5be7578a
提交
5be7578a
authored
10月 24, 2017
作者:
José Luis Millán
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Worker Transport: add send/recv options to mirror socket
上级
05d633c4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
50 行增加
和
18 行删除
+50
-18
Transport.hpp
worker/include/RTC/Transport.hpp
+4
-2
PlainRtpTransport.cpp
worker/src/RTC/PlainRtpTransport.cpp
+14
-2
Router.cpp
worker/src/RTC/Router.cpp
+12
-6
WebRtcTransport.cpp
worker/src/RTC/WebRtcTransport.cpp
+20
-8
没有找到文件。
worker/include/RTC/Transport.hpp
浏览文件 @
5be7578a
...
...
@@ -59,8 +59,10 @@ namespace RTC
{
std
::
string
remoteIP
;
uint16_t
remotePort
;
bool
rtp
{
true
};
bool
rtcp
{
true
};
bool
sendRtp
{
true
};
bool
sendRtcp
{
true
};
bool
recvRtp
{
true
};
bool
recvRtcp
{
true
};
};
public
:
...
...
worker/src/RTC/PlainRtpTransport.cpp
浏览文件 @
5be7578a
...
...
@@ -125,6 +125,10 @@ namespace RTC
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
// Mirror RTP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
sendRtp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
this
->
tuple
->
Send
(
data
,
len
);
}
...
...
@@ -138,6 +142,10 @@ namespace RTC
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
// Mirror RTCP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
sendRtcp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
this
->
tuple
->
Send
(
data
,
len
);
}
...
...
@@ -156,6 +164,10 @@ namespace RTC
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
// Mirror RTCP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
sendRtcp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
this
->
tuple
->
Send
(
data
,
len
);
}
...
...
@@ -185,7 +197,7 @@ namespace RTC
MS_TRACE
();
// Mirror RTP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
rtp
)
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
r
ecvR
tp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
RTC
::
RtpPacket
*
packet
=
RTC
::
RtpPacket
::
Parse
(
data
,
len
);
...
...
@@ -243,7 +255,7 @@ namespace RTC
MS_TRACE
();
// Mirror RTCP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
rtcp
)
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
r
ecvR
tcp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
RTC
::
RTCP
::
Packet
*
packet
=
RTC
::
RTCP
::
Packet
::
Parse
(
data
,
len
);
...
...
worker/src/RTC/Router.cpp
浏览文件 @
5be7578a
...
...
@@ -828,8 +828,10 @@ namespace RTC
{
static
const
Json
::
StaticString
JsonStringRemoteIP
{
"remoteIP"
};
static
const
Json
::
StaticString
JsonStringRemotePort
{
"remotePort"
};
static
const
Json
::
StaticString
JsonStringRtp
{
"rtp"
};
static
const
Json
::
StaticString
JsonStringRtcp
{
"rtcp"
};
static
const
Json
::
StaticString
JsonStringSendRtp
{
"sendRtp"
};
static
const
Json
::
StaticString
JsonStringSendRtcp
{
"sendRtcp"
};
static
const
Json
::
StaticString
JsonStringRecvRtp
{
"recvRtp"
};
static
const
Json
::
StaticString
JsonStringRecvRtcp
{
"recvRtcp"
};
RTC
::
Transport
*
transport
;
...
...
@@ -856,10 +858,14 @@ namespace RTC
options
.
remotePort
=
request
->
data
[
JsonStringRemotePort
].
asUInt
();
if
(
request
->
data
[
JsonStringRtp
].
isBool
())
options
.
rtp
=
request
->
data
[
JsonStringRtp
].
asBool
();
if
(
request
->
data
[
JsonStringRtcp
].
isBool
())
options
.
rtcp
=
request
->
data
[
JsonStringRtcp
].
asBool
();
if
(
request
->
data
[
JsonStringSendRtp
].
isBool
())
options
.
sendRtp
=
request
->
data
[
JsonStringSendRtp
].
asBool
();
if
(
request
->
data
[
JsonStringSendRtcp
].
isBool
())
options
.
sendRtcp
=
request
->
data
[
JsonStringSendRtcp
].
asBool
();
if
(
request
->
data
[
JsonStringRecvRtp
].
isBool
())
options
.
recvRtp
=
request
->
data
[
JsonStringRecvRtp
].
asBool
();
if
(
request
->
data
[
JsonStringRecvRtcp
].
isBool
())
options
.
recvRtcp
=
request
->
data
[
JsonStringRecvRtcp
].
asBool
();
try
{
...
...
worker/src/RTC/WebRtcTransport.cpp
浏览文件 @
5be7578a
...
...
@@ -556,6 +556,10 @@ namespace RTC
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
// Mirror RTP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
sendRtp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
if
(
!
this
->
srtpSendSession
->
EncryptRtp
(
&
data
,
&
len
))
return
;
...
...
@@ -569,6 +573,13 @@ namespace RTC
if
(
!
IsConnected
())
return
;
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
// Mirror RTCP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
sendRtcp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
// Ensure there is sending SRTP session.
if
(
this
->
srtpSendSession
==
nullptr
)
{
...
...
@@ -577,9 +588,6 @@ namespace RTC
return
;
}
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
if
(
!
this
->
srtpSendSession
->
EncryptRtcp
(
&
data
,
&
len
))
return
;
...
...
@@ -657,6 +665,13 @@ namespace RTC
if
(
!
IsConnected
())
return
;
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
// Mirror RTCP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
sendRtcp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
// Ensure there is sending SRTP session.
if
(
this
->
srtpSendSession
==
nullptr
)
{
...
...
@@ -665,9 +680,6 @@ namespace RTC
return
;
}
const
uint8_t
*
data
=
packet
->
GetData
();
size_t
len
=
packet
->
GetSize
();
if
(
!
this
->
srtpSendSession
->
EncryptRtcp
(
&
data
,
&
len
))
return
;
...
...
@@ -808,7 +820,7 @@ namespace RTC
}
// Mirror RTP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
rtp
)
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
r
ecvR
tp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
RTC
::
RtpPacket
*
packet
=
RTC
::
RtpPacket
::
Parse
(
data
,
len
);
...
...
@@ -904,7 +916,7 @@ namespace RTC
return
;
// Mirror RTCP if needed.
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
rtcp
)
if
(
this
->
mirrorTuple
!=
nullptr
&&
this
->
mirroringOptions
.
r
ecvR
tcp
)
this
->
mirrorTuple
->
Send
(
data
,
len
);
RTC
::
RTCP
::
Packet
*
packet
=
RTC
::
RTCP
::
Packet
::
Parse
(
data
,
len
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论