Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
9f83e53a
提交
9f83e53a
authored
11月 18, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve 'packet' event by not firing both 'keyframe' and 'rtp' types for the same packet
上级
73e29fef
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
57 行增加
和
82 行删除
+57
-82
Consumer.hpp
worker/include/RTC/Consumer.hpp
+1
-1
Producer.hpp
worker/include/RTC/Producer.hpp
+1
-1
Consumer.cpp
worker/src/RTC/Consumer.cpp
+23
-31
PipeConsumer.cpp
worker/src/RTC/PipeConsumer.cpp
+2
-4
Producer.cpp
worker/src/RTC/Producer.cpp
+24
-33
SimpleConsumer.cpp
worker/src/RTC/SimpleConsumer.cpp
+2
-4
SimulcastConsumer.cpp
worker/src/RTC/SimulcastConsumer.cpp
+2
-4
SvcConsumer.cpp
worker/src/RTC/SvcConsumer.cpp
+2
-4
没有找到文件。
worker/include/RTC/Consumer.hpp
浏览文件 @
9f83e53a
...
...
@@ -98,7 +98,7 @@ namespace RTC
virtual
float
GetRtt
()
const
=
0
;
protected
:
void
EmitPacketEventRtp
Type
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
=
false
)
const
;
void
EmitPacketEventRtp
AndKeyFrameTypes
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
=
false
)
const
;
void
EmitPacketEventKeyFrameType
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
=
false
)
const
;
void
EmitPacketEventPliType
(
uint32_t
ssrc
)
const
;
void
EmitPacketEventFirType
(
uint32_t
ssrc
)
const
;
...
...
worker/include/RTC/Producer.hpp
浏览文件 @
9f83e53a
...
...
@@ -111,7 +111,7 @@ namespace RTC
bool
MangleRtpPacket
(
RTC
::
RtpPacket
*
packet
,
RTC
::
RtpStreamRecv
*
rtpStream
)
const
;
void
PostProcessRtpPacket
(
RTC
::
RtpPacket
*
packet
);
void
EmitScore
()
const
;
void
EmitPacketEventRtp
Type
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
=
false
)
const
;
void
EmitPacketEventRtp
AndKeyFrameTypes
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
=
false
)
const
;
void
EmitPacketEventKeyFrameType
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
=
false
)
const
;
void
EmitPacketEventPliType
(
uint32_t
ssrc
)
const
;
void
EmitPacketEventFirType
(
uint32_t
ssrc
)
const
;
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
9f83e53a
...
...
@@ -408,48 +408,40 @@ namespace RTC
this
->
listener
->
OnConsumerProducerClosed
(
this
);
}
void
Consumer
::
EmitPacketEventRtp
Type
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
)
const
void
Consumer
::
EmitPacketEventRtp
AndKeyFrameTypes
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
)
const
{
MS_TRACE
();
if
(
!
this
->
packetEventTypes
.
rtp
)
return
;
json
data
=
json
::
object
();
data
[
"type"
]
=
"rtp"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"out"
;
packet
->
FillJson
(
data
[
"info"
]);
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
if
(
this
->
packetEventTypes
.
keyframe
&&
packet
->
IsKeyFrame
())
{
json
data
=
json
::
object
();
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
}
data
[
"type"
]
=
"keyframe"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"out"
;
void
Consumer
::
EmitPacketEventKeyFrameType
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
)
const
{
MS_TRACE
();
packet
->
FillJson
(
data
[
"info"
]);
if
(
!
this
->
packetEventTypes
.
keyframe
)
return
;
else
if
(
!
packet
->
IsKeyFrame
())
return
;
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
json
data
=
json
::
object
();
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
}
else
if
(
this
->
packetEventTypes
.
rtp
)
{
json
data
=
json
::
object
();
data
[
"type"
]
=
"keyframe
"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"out"
;
data
[
"type"
]
=
"rtp
"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"out"
;
packet
->
FillJson
(
data
[
"info"
]);
packet
->
FillJson
(
data
[
"info"
]);
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
}
}
void
Consumer
::
EmitPacketEventPliType
(
uint32_t
ssrc
)
const
...
...
worker/src/RTC/PipeConsumer.cpp
浏览文件 @
9f83e53a
...
...
@@ -246,8 +246,7 @@ namespace RTC
this
->
listener
->
OnConsumerSendRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
);
EmitPacketEventKeyFrameType
(
packet
);
EmitPacketEventRtpAndKeyFrameTypes
(
packet
);
}
else
{
...
...
@@ -575,7 +574,6 @@ namespace RTC
this
->
listener
->
OnConsumerRetransmitRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
,
rtpStream
->
HasRtx
());
EmitPacketEventKeyFrameType
(
packet
,
rtpStream
->
HasRtx
());
EmitPacketEventRtpAndKeyFrameTypes
(
packet
,
rtpStream
->
HasRtx
());
}
}
// namespace RTC
worker/src/RTC/Producer.cpp
浏览文件 @
9f83e53a
...
...
@@ -617,8 +617,7 @@ namespace RTC
return
result
;
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
,
isRtx
);
EmitPacketEventKeyFrameType
(
packet
,
isRtx
);
EmitPacketEventRtpAndKeyFrameTypes
(
packet
,
isRtx
);
// Mangle the packet before providing the listener with it.
if
(
!
MangleRtpPacket
(
packet
,
rtpStream
))
...
...
@@ -1343,48 +1342,40 @@ namespace RTC
Channel
::
Notifier
::
Emit
(
this
->
id
,
"score"
,
data
);
}
inline
void
Producer
::
EmitPacketEventRtp
Type
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
)
const
inline
void
Producer
::
EmitPacketEventRtp
AndKeyFrameTypes
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
)
const
{
MS_TRACE
();
if
(
!
this
->
packetEventTypes
.
rtp
)
return
;
json
data
=
json
::
object
();
data
[
"type"
]
=
"rtp"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"in"
;
packet
->
FillJson
(
data
[
"info"
]);
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
if
(
this
->
packetEventTypes
.
keyframe
&&
packet
->
IsKeyFrame
())
{
json
data
=
json
::
object
();
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
}
data
[
"type"
]
=
"keyframe"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"in"
;
inline
void
Producer
::
EmitPacketEventKeyFrameType
(
RTC
::
RtpPacket
*
packet
,
bool
isRtx
)
const
{
MS_TRACE
();
packet
->
FillJson
(
data
[
"info"
]);
if
(
!
this
->
packetEventTypes
.
keyframe
)
return
;
else
if
(
!
packet
->
IsKeyFrame
())
return
;
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
json
data
=
json
::
object
();
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
}
else
if
(
this
->
packetEventTypes
.
rtp
)
{
json
data
=
json
::
object
();
data
[
"type"
]
=
"keyframe
"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"in"
;
data
[
"type"
]
=
"rtp
"
;
data
[
"timestamp"
]
=
DepLibUV
::
GetTimeMs
();
data
[
"direction"
]
=
"in"
;
packet
->
FillJson
(
data
[
"info"
]);
packet
->
FillJson
(
data
[
"info"
]);
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
if
(
isRtx
)
data
[
"info"
][
"isRtx"
]
=
true
;
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
Channel
::
Notifier
::
Emit
(
this
->
id
,
"packet"
,
data
);
}
}
inline
void
Producer
::
EmitPacketEventPliType
(
uint32_t
ssrc
)
const
...
...
worker/src/RTC/SimpleConsumer.cpp
浏览文件 @
9f83e53a
...
...
@@ -244,8 +244,7 @@ namespace RTC
this
->
listener
->
OnConsumerSendRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
);
EmitPacketEventKeyFrameType
(
packet
);
EmitPacketEventRtpAndKeyFrameTypes
(
packet
);
}
else
{
...
...
@@ -526,7 +525,6 @@ namespace RTC
this
->
listener
->
OnConsumerRetransmitRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
,
this
->
rtpStream
->
HasRtx
());
EmitPacketEventKeyFrameType
(
packet
,
this
->
rtpStream
->
HasRtx
());
EmitPacketEventRtpAndKeyFrameTypes
(
packet
,
this
->
rtpStream
->
HasRtx
());
}
}
// namespace RTC
worker/src/RTC/SimulcastConsumer.cpp
浏览文件 @
9f83e53a
...
...
@@ -1089,8 +1089,7 @@ namespace RTC
this
->
listener
->
OnConsumerSendRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
);
EmitPacketEventKeyFrameType
(
packet
);
EmitPacketEventRtpAndKeyFrameTypes
(
packet
);
}
else
{
...
...
@@ -1695,7 +1694,6 @@ namespace RTC
this
->
listener
->
OnConsumerRetransmitRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
,
this
->
rtpStream
->
HasRtx
());
EmitPacketEventKeyFrameType
(
packet
,
this
->
rtpStream
->
HasRtx
());
EmitPacketEventRtpAndKeyFrameTypes
(
packet
,
this
->
rtpStream
->
HasRtx
());
}
}
// namespace RTC
worker/src/RTC/SvcConsumer.cpp
浏览文件 @
9f83e53a
...
...
@@ -820,8 +820,7 @@ namespace RTC
this
->
listener
->
OnConsumerSendRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
);
EmitPacketEventKeyFrameType
(
packet
);
EmitPacketEventRtpAndKeyFrameTypes
(
packet
);
}
else
{
...
...
@@ -1288,7 +1287,6 @@ namespace RTC
this
->
listener
->
OnConsumerRetransmitRtpPacket
(
this
,
packet
);
// May emit 'packet' event.
EmitPacketEventRtpType
(
packet
,
this
->
rtpStream
->
HasRtx
());
EmitPacketEventKeyFrameType
(
packet
,
this
->
rtpStream
->
HasRtx
());
EmitPacketEventRtpAndKeyFrameTypes
(
packet
,
this
->
rtpStream
->
HasRtx
());
}
}
// namespace RTC
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论