Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
44bbc6d1
提交
44bbc6d1
authored
3月 16, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minimal code cleanup in RtpReceiver.cpp/RtpSender.cpp
上级
f8b61863
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
11 行删除
+12
-11
RtpSender.hpp
worker/include/RTC/RtpSender.hpp
+3
-3
RtpSender.cpp
worker/src/RTC/RtpSender.cpp
+9
-8
没有找到文件。
worker/include/RTC/RtpSender.hpp
浏览文件 @
44bbc6d1
...
@@ -87,11 +87,11 @@ namespace RTC
...
@@ -87,11 +87,11 @@ namespace RTC
bool
available
=
false
;
bool
available
=
false
;
// Whether this RtpSender has been disabled by the app.
// Whether this RtpSender has been disabled by the app.
bool
disabled
=
false
;
bool
disabled
=
false
;
// RTP counters.
RTC
::
RtpDataCounter
transmitted
;
// Timestamp when last RTCP was sent.
// Timestamp when last RTCP was sent.
uint64_t
lastRtcpSentTime
=
0
;
uint64_t
lastRtcpSentTime
=
0
;
uint16_t
maxRtcpInterval
;
uint16_t
maxRtcpInterval
;
// RTP counters.
RTC
::
RtpDataCounter
transmittedCounter
;
// TODO: keep track of retransmitted data too.
// TODO: keep track of retransmitted data too.
// RTC::RtpDataCounter retransmitted;
// RTC::RtpDataCounter retransmitted;
};
};
...
@@ -142,7 +142,7 @@ namespace RTC
...
@@ -142,7 +142,7 @@ namespace RTC
inline
inline
uint32_t
RtpSender
::
GetTransmissionRate
(
uint64_t
now
)
uint32_t
RtpSender
::
GetTransmissionRate
(
uint64_t
now
)
{
{
return
this
->
transmitted
.
GetRate
(
now
);
return
this
->
transmitted
Counter
.
GetRate
(
now
);
}
}
}
}
...
...
worker/src/RTC/RtpSender.cpp
浏览文件 @
44bbc6d1
...
@@ -320,18 +320,13 @@ namespace RTC
...
@@ -320,18 +320,13 @@ namespace RTC
return
;
return
;
}
}
// Process the packet.
// TODO: Must check what kind of packet we are checking. For example, RTX
// packets (once implemented) should have a different handling.
if
(
!
this
->
rtpStream
->
ReceivePacket
(
packet
))
return
;
// Map the payload type.
// Map the payload type.
uint8_t
payloadType
=
packet
->
GetPayloadType
();
uint8_t
payloadType
=
packet
->
GetPayloadType
();
auto
it
=
this
->
supportedPayloadTypes
.
find
(
payloadType
);
auto
it
=
this
->
supportedPayloadTypes
.
find
(
payloadType
);
// NOTE: This may happen if this peer supports just some codecs from the
// NOTE: This may happen if this peer supports just some codecs from the
// given RtpParameters.
// given RtpParameters.
// TODO: We should just ignore those packets as they have non been negotiated.
if
(
it
==
this
->
supportedPayloadTypes
.
end
())
if
(
it
==
this
->
supportedPayloadTypes
.
end
())
{
{
MS_DEBUG_TAG
(
rtp
,
"payload type not supported [payloadType:%"
PRIu8
"]"
,
payloadType
);
MS_DEBUG_TAG
(
rtp
,
"payload type not supported [payloadType:%"
PRIu8
"]"
,
payloadType
);
...
@@ -339,11 +334,17 @@ namespace RTC
...
@@ -339,11 +334,17 @@ namespace RTC
return
;
return
;
}
}
// Process the packet.
// TODO: Must check what kind of packet we are checking. For example, RTX
// packets (once implemented) should have a different handling.
if
(
!
this
->
rtpStream
->
ReceivePacket
(
packet
))
return
;
// Send the packet.
// Send the packet.
this
->
transport
->
SendRtpPacket
(
packet
);
this
->
transport
->
SendRtpPacket
(
packet
);
// Save RTP data.
// Save RTP data.
this
->
transmitted
.
Update
(
packet
);
this
->
transmitted
Counter
.
Update
(
packet
);
}
}
void
RtpSender
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
void
RtpSender
::
GetRtcp
(
RTC
::
RTCP
::
CompoundPacket
*
packet
,
uint64_t
now
)
...
@@ -365,7 +366,7 @@ namespace RTC
...
@@ -365,7 +366,7 @@ namespace RTC
report
->
SetSsrc
(
ssrc
);
report
->
SetSsrc
(
ssrc
);
packet
->
AddSenderReport
(
report
);
packet
->
AddSenderReport
(
report
);
// Build
sdes
chunk for this sender.
// Build
SDES
chunk for this sender.
RTC
::
RTCP
::
SdesChunk
*
sdesChunk
=
new
RTC
::
RTCP
::
SdesChunk
(
ssrc
);
RTC
::
RTCP
::
SdesChunk
*
sdesChunk
=
new
RTC
::
RTCP
::
SdesChunk
(
ssrc
);
RTC
::
RTCP
::
SdesItem
*
sdesItem
=
new
RTC
::
RTCP
::
SdesItem
(
RTC
::
RTCP
::
SdesItem
::
Type
::
CNAME
,
cname
.
size
(),
cname
.
c_str
());
RTC
::
RTCP
::
SdesItem
*
sdesItem
=
new
RTC
::
RTCP
::
SdesItem
(
RTC
::
RTCP
::
SdesItem
::
Type
::
CNAME
,
cname
.
size
(),
cname
.
c_str
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论