Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
e37dad53
提交
e37dad53
authored
8月 14, 2022
作者:
Nazar Mokrynskyi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change buffer in producer to be static and shared across instances
上级
914c5058
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
10 行增加
和
7 行删除
+10
-7
Producer.hpp
worker/include/RTC/Producer.hpp
+2
-1
Producer.cpp
worker/src/RTC/Producer.cpp
+8
-6
没有找到文件。
worker/include/RTC/Producer.hpp
浏览文件 @
e37dad53
...
@@ -196,7 +196,8 @@ namespace RTC
...
@@ -196,7 +196,8 @@ namespace RTC
bool
videoOrientationDetected
{
false
};
bool
videoOrientationDetected
{
false
};
struct
VideoOrientation
videoOrientation
;
struct
VideoOrientation
videoOrientation
;
struct
TraceEventTypes
traceEventTypes
;
struct
TraceEventTypes
traceEventTypes
;
uint8_t
*
buffer
{
nullptr
};
// Static buffer.
thread_local
static
uint8_t
*
buffer
;
};
};
}
// namespace RTC
}
// namespace RTC
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
e37dad53
...
@@ -18,6 +18,10 @@
...
@@ -18,6 +18,10 @@
namespace
RTC
namespace
RTC
{
{
/* Static variables. */
thread_local
uint8_t
*
Producer
::
buffer
{
nullptr
};
/* Static. */
/* Static. */
static
constexpr
unsigned
int
SendNackDelay
{
10u
};
// In ms.
static
constexpr
unsigned
int
SendNackDelay
{
10u
};
// In ms.
...
@@ -332,8 +336,6 @@ namespace RTC
...
@@ -332,8 +336,6 @@ namespace RTC
// Delete the KeyFrameRequestManager.
// Delete the KeyFrameRequestManager.
delete
this
->
keyFrameRequestManager
;
delete
this
->
keyFrameRequestManager
;
delete
[]
this
->
buffer
;
}
}
void
Producer
::
FillJson
(
json
&
jsonObject
)
const
void
Producer
::
FillJson
(
json
&
jsonObject
)
const
...
@@ -629,13 +631,13 @@ namespace RTC
...
@@ -629,13 +631,13 @@ namespace RTC
}
}
// If this is the first time to receive a RTP packet then allocate the receiving buffer now.
// If this is the first time to receive a RTP packet then allocate the receiving buffer now.
if
(
!
this
->
buffer
)
if
(
!
Producer
::
buffer
)
this
->
buffer
=
new
uint8_t
[
RTC
::
MtuSize
+
100
];
Producer
::
buffer
=
new
uint8_t
[
RTC
::
MtuSize
+
100
];
// Copy the received packet into this buffer so it can be expanded later.
// Copy the received packet into this buffer so it can be expanded later.
std
::
memcpy
(
this
->
buffer
,
data
,
static_cast
<
size_t
>
(
len
));
std
::
memcpy
(
Producer
::
buffer
,
data
,
static_cast
<
size_t
>
(
len
));
RTC
::
RtpPacket
*
packet
=
RTC
::
RtpPacket
::
Parse
(
this
->
buffer
,
len
);
RTC
::
RtpPacket
*
packet
=
RTC
::
RtpPacket
::
Parse
(
Producer
::
buffer
,
len
);
if
(
!
packet
)
if
(
!
packet
)
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论