Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
02b24000
提交
02b24000
authored
9月 02, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do some RTCP handling (Receiver Report)
上级
df77ff1d
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
91 行增加
和
22 行删除
+91
-22
Router.hpp
worker/include/RTC/Router.hpp
+0
-1
Transport.hpp
worker/include/RTC/Transport.hpp
+3
-0
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+3
-3
RtpStreamRecv.cpp
worker/src/RTC/RtpStreamRecv.cpp
+10
-6
Transport.cpp
worker/src/RTC/Transport.cpp
+75
-12
没有找到文件。
worker/include/RTC/Router.hpp
浏览文件 @
02b24000
...
...
@@ -61,7 +61,6 @@ namespace RTC
/* Pure virtual methods inherited from RTC::Transport::Listener. */
public
:
void
OnTransportClosed
(
RTC
::
Transport
*
transport
)
override
;
// TODO: RTCP listener to route RTCP feedback from Consumer to its Producer.
/* Pure virtual methods inherited from RTC::ProducerListener. */
public
:
...
...
worker/include/RTC/Transport.hpp
浏览文件 @
02b24000
...
...
@@ -11,6 +11,7 @@
#include "RTC/ProducerListener.hpp"
#include "RTC/RTCP/CompoundPacket.hpp"
#include "RTC/RTCP/Packet.hpp"
#include "RTC/RTCP/ReceiverReport.hpp"
#include "RTC/RemoteBitrateEstimator/RemoteBitrateEstimatorAbsSendTime.hpp"
#include "RTC/RtpListener.hpp"
#include "RTC/RtpPacket.hpp"
...
...
@@ -69,6 +70,8 @@ namespace RTC
private
:
void
MayRunDtlsTransport
();
void
HandleRtcpPacket
(
RTC
::
RTCP
::
Packet
*
packet
);
RTC
::
Consumer
*
GetConsumer
(
uint32_t
ssrc
)
const
;
/* Private methods to unify UDP and TCP behavior. */
private
:
...
...
worker/src/RTC/RtpPacket.cpp
浏览文件 @
02b24000
...
...
@@ -404,11 +404,11 @@ namespace RTC
{
MS_TRACE
();
//
TODO: This happens often for first RTX packets. May be the browser sends empty
//
RTX packets (for any reason). If so, we should move this to MS_DEBUG_TAG
.
//
Chrome sends some RTX packets with no payload when the stream is started.
//
Just ignore them
.
if
(
this
->
payloadLength
<
2
)
{
MS_
WARN_TAG
(
rtx
,
"not enough space for a RTX header fiel
d"
);
MS_
DEBUG_TAG
(
rtx
,
"ignoring RTX packet with empty payloa
d"
);
return
false
;
}
...
...
worker/src/RTC/RtpStreamRecv.cpp
浏览文件 @
02b24000
...
...
@@ -63,14 +63,14 @@ namespace RTC
{
MS_TRACE
();
MS_ASSERT
(
packet
->
GetSsrc
()
==
this
->
rtxSsrc
,
"invalid ssrc on
rtx
packet"
);
MS_ASSERT
(
packet
->
GetSsrc
()
==
this
->
rtxSsrc
,
"invalid ssrc on
RTX
packet"
);
// Check that the payload type corresponds to the one negotiated.
if
(
packet
->
GetPayloadType
()
!=
this
->
rtxPayloadType
)
{
MS_WARN_TAG
(
rtx
,
"ignoring
rtx
packet with invalid payload type [ssrc: %"
PRIu32
" seqnr: %"
PRIu16
"ignoring
RTX
packet with invalid payload type [ssrc: %"
PRIu32
" seqnr: %"
PRIu16
" payload type: %"
PRIu8
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
(),
...
...
@@ -79,15 +79,19 @@ namespace RTC
return
false
;
}
// Get the
rtx
packet sequence number for logging purposes.
// Get the
RTX
packet sequence number for logging purposes.
auto
rtxSeq
=
packet
->
GetSequenceNumber
();
// Get the original
rtp
packet.
// Get the original
RTP
packet.
if
(
!
packet
->
RtxDecode
(
this
->
params
.
payloadType
,
this
->
params
.
ssrc
))
{
// Ignore RTX packets with no payload.
if
(
packet
->
GetPayloadLength
()
<
2
)
return
false
;
MS_WARN_TAG
(
rtx
,
"ignoring malformed
rtx
packet [ssrc: %"
PRIu32
" seqnr: %"
PRIu16
"ignoring malformed
RTX
packet [ssrc: %"
PRIu32
" seqnr: %"
PRIu16
" payload type: %"
PRIu8
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
(),
...
...
@@ -98,7 +102,7 @@ namespace RTC
MS_DEBUG_TAG
(
rtx
,
"received
rtx
packet [ssrc: %"
PRIu32
" seqnr: %"
PRIu16
"received
RTX
packet [ssrc: %"
PRIu32
" seqnr: %"
PRIu16
"] recovering original [ssrc: %"
PRIu32
" seqnr: %"
PRIu16
"]"
,
this
->
rtxSsrc
,
rtxSeq
,
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
02b24000
...
...
@@ -749,6 +749,75 @@ namespace RTC
}
}
inline
void
Transport
::
HandleRtcpPacket
(
RTC
::
RTCP
::
Packet
*
packet
)
{
MS_TRACE
();
switch
(
packet
->
GetType
())
{
case
RTCP
:
:
Type
::
RR
:
{
auto
*
rr
=
dynamic_cast
<
RTCP
::
ReceiverReportPacket
*>
(
packet
);
auto
it
=
rr
->
Begin
();
for
(;
it
!=
rr
->
End
();
++
it
)
{
auto
&
report
=
(
*
it
);
auto
*
consumer
=
GetConsumer
(
report
->
GetSsrc
());
if
(
consumer
)
{
consumer
->
ReceiveRtcpReceiverReport
(
report
);
}
else
{
MS_WARN_TAG
(
rtcp
,
"no Consumer found for received Receiver Report [ssrc:%"
PRIu32
"]"
,
report
->
GetSsrc
());
}
}
break
;
}
default
:
{
MS_WARN_TAG
(
rtcp
,
"unhandled RTCP type received [type:%"
PRIu8
"]"
,
static_cast
<
uint8_t
>
(
packet
->
GetType
()));
}
}
}
inline
RTC
::
Consumer
*
Transport
::
GetConsumer
(
uint32_t
ssrc
)
const
{
MS_TRACE
();
for
(
auto
consumer
:
this
->
consumers
)
{
// Ignore if not enabled.
if
(
!
consumer
->
IsEnabled
())
continue
;
// NOTE: Use & since, otherwise, a full copy will be retrieved.
auto
&
rtpParameters
=
consumer
->
GetParameters
();
for
(
auto
&
encoding
:
rtpParameters
.
encodings
)
{
if
(
encoding
.
ssrc
==
ssrc
)
return
consumer
;
if
(
encoding
.
hasFec
&&
encoding
.
fec
.
ssrc
==
ssrc
)
return
consumer
;
if
(
encoding
.
hasRtx
&&
encoding
.
rtx
.
ssrc
==
ssrc
)
return
consumer
;
}
}
return
nullptr
;
}
inline
void
Transport
::
OnPacketRecv
(
RTC
::
TransportTuple
*
tuple
,
const
uint8_t
*
data
,
size_t
len
)
{
MS_TRACE
();
...
...
@@ -972,21 +1041,15 @@ namespace RTC
return
;
}
// TODO: No. Instead, process here the packet, get corresponding producers/consumers
// and do stuff here. We may need another listener callback to forward certain
// RTCP messages between consumers and is producers. Let's see.
// this->listener->OnTransportRtcpPacket(this, packet);
// Trick for clients performing aggressive ICE regardless we are ICE-Lite.
// this->iceServer->ForceSelectedTuple(tuple);
// Delete the whole packet.
// Handle each RTCP packet.
while
(
packet
!=
nullptr
)
{
RTC
::
RTCP
::
Packet
*
nextPacket
=
packet
->
GetNext
(
);
HandleRtcpPacket
(
packet
);
delete
packet
;
packet
=
nextPacket
;
RTC
::
RTCP
::
Packet
*
previousPacket
=
packet
;
packet
=
packet
->
GetNext
();
delete
previousPacket
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论