Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
8721a713
提交
8721a713
authored
5月 04, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RtpStreamSend: refactor new buffer design to use less memory
上级
0025c89a
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
15 行增加
和
29 行删除
+15
-29
RtpStreamSend.hpp
worker/include/RTC/RtpStreamSend.hpp
+13
-27
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+0
-0
SimpleConsumer.cpp
worker/src/RTC/SimpleConsumer.cpp
+1
-1
SimulcastConsumer.cpp
worker/src/RTC/SimulcastConsumer.cpp
+1
-1
没有找到文件。
worker/include/RTC/RtpStreamSend.hpp
浏览文件 @
8721a713
...
@@ -19,19 +19,18 @@ namespace RTC
...
@@ -19,19 +19,18 @@ namespace RTC
};
};
public
:
public
:
struct
BufferItem
{
RTC
::
RtpPacket
*
packet
{
nullptr
};
uint64_t
resentAtTime
{
0
};
// Last time this packet was resent.
uint8_t
sentTimes
{
0
};
// Number of times this packet was resent.
bool
rtxEncoded
{
false
};
// Whether the packet has already been RTX encoded.
};
private
:
struct
StorageItem
struct
StorageItem
{
{
// Allow some more space for RTX encoding.
// Cloned packet.
uint8_t
store
[
RTC
::
MtuSize
+
200
];
RTC
::
RtpPacket
*
packet
{
nullptr
};
// Memory to hold the cloned packet (with extra space for RTX encoding).
uint8_t
store
[
RTC
::
MtuSize
+
100
];
// Last time this packet was resent.
uint64_t
resentAtTime
{
0
};
// Number of times this packet was resent.
uint8_t
sentTimes
{
0
};
// Whether the packet has been already RTX encoded.
bool
rtxEncoded
{
false
};
};
};
public
:
public
:
...
@@ -55,16 +54,16 @@ namespace RTC
...
@@ -55,16 +54,16 @@ namespace RTC
private
:
private
:
void
StorePacket
(
RTC
::
RtpPacket
*
packet
);
void
StorePacket
(
RTC
::
RtpPacket
*
packet
);
void
ResetBufferItem
(
BufferItem
&
bufferItem
);
void
ClearBuffer
();
void
ResetStorageItem
(
StorageItem
*
storateItem
);
void
UpdateBufferStartIdx
();
void
UpdateBufferStartIdx
();
void
ClearRetransmissionBuffer
();
void
FillRetransmissionContainer
(
uint16_t
seq
,
uint16_t
bitmask
);
void
FillRetransmissionContainer
(
uint16_t
seq
,
uint16_t
bitmask
);
void
UpdateScore
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
void
UpdateScore
(
RTC
::
RTCP
::
ReceiverReport
*
report
);
private
:
private
:
uint32_t
lostPrior
{
0
};
// Packets lost at last interval.
uint32_t
lostPrior
{
0
};
// Packets lost at last interval.
uint32_t
sentPrior
{
0
};
// Packets sent at last interval.
uint32_t
sentPrior
{
0
};
// Packets sent at last interval.
std
::
vector
<
BufferItem
>
buffer
;
std
::
vector
<
StorageItem
*
>
buffer
;
uint16_t
bufferStartIdx
{
0
};
uint16_t
bufferStartIdx
{
0
};
size_t
bufferSize
{
0
};
size_t
bufferSize
{
0
};
std
::
vector
<
StorageItem
>
storage
;
std
::
vector
<
StorageItem
>
storage
;
...
@@ -86,19 +85,6 @@ namespace RTC
...
@@ -86,19 +85,6 @@ namespace RTC
{
{
return
this
->
transmissionCounter
.
GetBitrate
(
now
);
return
this
->
transmissionCounter
.
GetBitrate
(
now
);
}
}
inline
void
RtpStreamSend
::
ResetBufferItem
(
BufferItem
&
bufferItem
)
{
if
(
!
bufferItem
.
packet
)
return
;
delete
bufferItem
.
packet
;
bufferItem
.
packet
=
nullptr
;
bufferItem
.
resentAtTime
=
0
;
bufferItem
.
sentTimes
=
0
;
bufferItem
.
rtxEncoded
=
false
;
}
}
// namespace RTC
}
// namespace RTC
#endif
#endif
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
8721a713
差异被折叠。
点击展开。
worker/src/RTC/SimpleConsumer.cpp
浏览文件 @
8721a713
...
@@ -413,7 +413,7 @@ namespace RTC
...
@@ -413,7 +413,7 @@ namespace RTC
}
}
// Create a RtpStreamSend for sending a single media stream.
// Create a RtpStreamSend for sending a single media stream.
size_t
bufferSize
=
params
.
useNack
?
15
00
:
0
;
size_t
bufferSize
=
params
.
useNack
?
6
00
:
0
;
this
->
rtpStream
=
new
RTC
::
RtpStreamSend
(
this
,
params
,
bufferSize
);
this
->
rtpStream
=
new
RTC
::
RtpStreamSend
(
this
,
params
,
bufferSize
);
this
->
rtpStreams
.
push_back
(
this
->
rtpStream
);
this
->
rtpStreams
.
push_back
(
this
->
rtpStream
);
...
...
worker/src/RTC/SimulcastConsumer.cpp
浏览文件 @
8721a713
...
@@ -895,7 +895,7 @@ namespace RTC
...
@@ -895,7 +895,7 @@ namespace RTC
}
}
// Create a RtpStreamSend for sending a single media stream.
// Create a RtpStreamSend for sending a single media stream.
size_t
bufferSize
=
params
.
useNack
?
15
00
:
0
;
size_t
bufferSize
=
params
.
useNack
?
6
00
:
0
;
this
->
rtpStream
=
new
RTC
::
RtpStreamSend
(
this
,
params
,
bufferSize
);
this
->
rtpStream
=
new
RTC
::
RtpStreamSend
(
this
,
params
,
bufferSize
);
this
->
rtpStreams
.
push_back
(
this
->
rtpStream
);
this
->
rtpStreams
.
push_back
(
this
->
rtpStream
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论