Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
cbc7c0ba
提交
cbc7c0ba
authored
4月 10, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Room.cpp: unify code
上级
71b8cccf
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
29 行增加
和
31 行删除
+29
-31
Room.hpp
worker/include/RTC/Room.hpp
+1
-0
Room.cpp
worker/src/RTC/Room.cpp
+24
-27
Transport.cpp
worker/src/RTC/Transport.cpp
+4
-4
没有找到文件。
worker/include/RTC/Room.hpp
浏览文件 @
cbc7c0ba
...
...
@@ -51,6 +51,7 @@ namespace RTC
private
:
RTC
::
Peer
*
GetPeerFromRequest
(
Channel
::
Request
*
request
,
uint32_t
*
peerId
=
nullptr
)
const
;
void
SetCapabilities
(
std
::
vector
<
RTC
::
RtpCodecParameters
>&
mediaCodecs
);
void
AddRtpSenderForRtpReceiver
(
RTC
::
Peer
*
senderPeer
,
const
RTC
::
RtpReceiver
*
rtpReceiver
);
/* Pure virtual methods inherited from RTC::Peer::Listener. */
public
:
...
...
worker/src/RTC/Room.cpp
浏览文件 @
cbc7c0ba
...
...
@@ -442,6 +442,28 @@ namespace RTC
this
->
capabilities
.
fecMechanisms
=
Room
::
supportedRtpCapabilities
.
fecMechanisms
;
}
inline
void
Room
::
AddRtpSenderForRtpReceiver
(
RTC
::
Peer
*
senderPeer
,
const
RTC
::
RtpReceiver
*
rtpReceiver
)
{
MS_TRACE
();
MS_ASSERT
(
senderPeer
->
HasCapabilities
(),
"sender peer has no capabilities"
);
MS_ASSERT
(
rtpReceiver
->
GetParameters
(),
"rtpReceiver has no parameters"
);
uint32_t
rtpSenderId
=
Utils
::
Crypto
::
GetRandomUInt
(
10000000
,
99999999
);
RTC
::
RtpSender
*
rtpSender
=
new
RTC
::
RtpSender
(
senderPeer
,
this
->
notifier
,
rtpSenderId
,
rtpReceiver
->
kind
);
// Store into the maps.
this
->
mapRtpReceiverRtpSenders
[
rtpReceiver
].
insert
(
rtpSender
);
this
->
mapRtpSenderRtpReceiver
[
rtpSender
]
=
rtpReceiver
;
auto
rtpParameters
=
rtpReceiver
->
GetParameters
();
auto
associatedRtpReceiverId
=
rtpReceiver
->
rtpReceiverId
;
// Attach the RtpSender to the peer.
senderPeer
->
AddRtpSender
(
rtpSender
,
rtpParameters
,
associatedRtpReceiverId
);
}
void
Room
::
onPeerClosed
(
const
RTC
::
Peer
*
peer
)
{
MS_TRACE
();
...
...
@@ -502,19 +524,7 @@ namespace RTC
if
(
!
rtpReceiver
->
GetParameters
())
continue
;
uint32_t
rtpSenderId
=
Utils
::
Crypto
::
GetRandomUInt
(
10000000
,
99999999
);
RTC
::
RtpSender
*
rtpSender
=
new
RTC
::
RtpSender
(
peer
,
this
->
notifier
,
rtpSenderId
,
rtpReceiver
->
kind
);
// Store into the maps.
this
->
mapRtpReceiverRtpSenders
[
rtpReceiver
].
insert
(
rtpSender
);
this
->
mapRtpSenderRtpReceiver
[
rtpSender
]
=
rtpReceiver
;
auto
rtpParameters
=
rtpReceiver
->
GetParameters
();
auto
associatedRtpReceiverId
=
rtpReceiver
->
rtpReceiverId
;
// Attach the RtpSender to the peer.
peer
->
AddRtpSender
(
rtpSender
,
rtpParameters
,
associatedRtpReceiverId
);
AddRtpSenderForRtpReceiver
(
peer
,
rtpReceiver
);
}
}
}
...
...
@@ -544,20 +554,7 @@ namespace RTC
if
(
!
senderPeer
->
HasCapabilities
())
continue
;
// Create a RtpSender for the other Peer.
uint32_t
rtpSenderId
=
Utils
::
Crypto
::
GetRandomUInt
(
10000000
,
99999999
);
RTC
::
RtpSender
*
rtpSender
=
new
RTC
::
RtpSender
(
senderPeer
,
this
->
notifier
,
rtpSenderId
,
rtpReceiver
->
kind
);
// Store into the maps.
this
->
mapRtpReceiverRtpSenders
[
rtpReceiver
].
insert
(
rtpSender
);
this
->
mapRtpSenderRtpReceiver
[
rtpSender
]
=
rtpReceiver
;
auto
rtpParameters
=
rtpReceiver
->
GetParameters
();
auto
associatedRtpReceiverId
=
rtpReceiver
->
rtpReceiverId
;
// Attach the RtpSender to the senderPeer.
senderPeer
->
AddRtpSender
(
rtpSender
,
rtpParameters
,
associatedRtpReceiverId
);
AddRtpSenderForRtpReceiver
(
senderPeer
,
rtpReceiver
);
}
}
// If this is not a new RtpReceiver let's retrieve its updated parameters
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
cbc7c0ba
...
...
@@ -758,7 +758,7 @@ namespace RTC
// Ensure DTLS is connected.
if
(
this
->
dtlsTransport
->
GetState
()
!=
RTC
::
DtlsTransport
::
DtlsState
::
CONNECTED
)
{
MS_
WARN
_2TAGS
(
dtls
,
rtp
,
"ignoring RTP packet while DTLS not connected"
);
MS_
DEBUG
_2TAGS
(
dtls
,
rtp
,
"ignoring RTP packet while DTLS not connected"
);
return
;
}
...
...
@@ -766,7 +766,7 @@ namespace RTC
// Ensure there is receiving SRTP session.
if
(
!
this
->
srtpRecvSession
)
{
MS_
WARN
_TAG
(
srtp
,
"ignoring RTP packet due to non receiving SRTP session"
);
MS_
DEBUG
_TAG
(
srtp
,
"ignoring RTP packet due to non receiving SRTP session"
);
return
;
}
...
...
@@ -868,7 +868,7 @@ namespace RTC
// Ensure DTLS is connected.
if
(
this
->
dtlsTransport
->
GetState
()
!=
RTC
::
DtlsTransport
::
DtlsState
::
CONNECTED
)
{
MS_
WARN
_2TAGS
(
dtls
,
rtcp
,
"ignoring RTCP packet while DTLS not connected"
);
MS_
DEBUG
_2TAGS
(
dtls
,
rtcp
,
"ignoring RTCP packet while DTLS not connected"
);
return
;
}
...
...
@@ -876,7 +876,7 @@ namespace RTC
// Ensure there is receiving SRTP session.
if
(
!
this
->
srtpRecvSession
)
{
MS_
WARN
_TAG
(
srtp
,
"ignoring RTCP packet due to non receiving SRTP session"
);
MS_
DEBUG
_TAG
(
srtp
,
"ignoring RTCP packet due to non receiving SRTP session"
);
return
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论