Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
fb83d4f4
Unverified
提交
fb83d4f4
authored
12月 14, 2023
作者:
José Luis Millán
提交者:
GitHub
12月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
worker: disable RtcLogger usage if not enabled (#1264)
worker: disable RtcLogger usage if not enabled
上级
32c37ff1
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
85 行增加
和
2 行删除
+85
-2
CHANGELOG.md
CHANGELOG.md
+5
-0
RtpPacket.hpp
worker/include/RTC/RtpPacket.hpp
+4
-0
PipeConsumer.cpp
worker/src/RTC/PipeConsumer.cpp
+10
-0
Producer.cpp
worker/src/RTC/Producer.cpp
+8
-0
Router.cpp
worker/src/RTC/Router.cpp
+2
-0
RtcLogger.cpp
worker/src/RTC/RtcLogger.cpp
+0
-2
SimpleConsumer.cpp
worker/src/RTC/SimpleConsumer.cpp
+12
-0
SimulcastConsumer.cpp
worker/src/RTC/SimulcastConsumer.cpp
+24
-0
SvcConsumer.cpp
worker/src/RTC/SvcConsumer.cpp
+14
-0
Transport.cpp
worker/src/RTC/Transport.cpp
+6
-0
没有找到文件。
CHANGELOG.md
浏览文件 @
fb83d4f4
# Changelog
### NEXT
*
worker: Disable RtcLogger usage if not enabled (
[
PR #1264
](
https://github.com/versatica/mediasoup/pull/1264
)
).
### 3.13.11
*
liburing: Avoid extra memcpy on RTP (
[
PR #1258
](
https://github.com/versatica/mediasoup/pull/1258
)
).
...
...
worker/include/RTC/RtpPacket.hpp
浏览文件 @
fb83d4f4
...
...
@@ -5,7 +5,9 @@
#include "Utils.hpp"
#include "FBS/rtpPacket.h"
#include "RTC/Codecs/PayloadDescriptorHandler.hpp"
#ifdef MS_RTC_LOGGER_RTP
#include "RTC/RtcLogger.hpp"
#endif
#include <flatbuffers/flatbuffers.h>
#include <absl/container/flat_hash_map.h>
#include <array>
...
...
@@ -649,8 +651,10 @@ namespace RTC
void
ShiftPayload
(
size_t
payloadOffset
,
size_t
shift
,
bool
expand
=
true
);
#ifdef MS_RTC_LOGGER_RTP
public
:
RtcLogger
::
RtpPacket
logger
;
#endif
private
:
void
ParseExtensions
();
...
...
worker/src/RTC/PipeConsumer.cpp
浏览文件 @
fb83d4f4
...
...
@@ -219,11 +219,15 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
consumerId
=
this
->
id
;
#endif
if
(
!
IsActive
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
CONSUMER_INACTIVE
);
#endif
return
;
}
...
...
@@ -236,7 +240,9 @@ namespace RTC
{
MS_DEBUG_DEV
(
"payload type not supported [payloadType:%"
PRIu8
"]"
,
payloadType
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
UNSUPPORTED_PAYLOAD_TYPE
);
#endif
return
;
}
...
...
@@ -250,7 +256,9 @@ namespace RTC
// the packet.
if
(
syncRequired
&&
this
->
keyFrameSupported
&&
!
packet
->
IsKeyFrame
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
NOT_A_KEYFRAME
);
#endif
return
;
}
...
...
@@ -284,8 +292,10 @@ namespace RTC
packet
->
SetSsrc
(
ssrc
);
packet
->
SetSequenceNumber
(
seq
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
sendRtpTimestamp
=
packet
->
GetTimestamp
();
packet
->
logger
.
sendSeqNumber
=
seq
;
#endif
if
(
isSyncPacket
)
{
...
...
worker/src/RTC/Producer.cpp
浏览文件 @
fb83d4f4
...
...
@@ -562,7 +562,9 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
producerId
=
this
->
id
;
#endif
// Reset current packet.
this
->
currentRtpPacket
=
nullptr
;
...
...
@@ -576,7 +578,9 @@ namespace RTC
{
MS_WARN_TAG
(
rtp
,
"no stream found for received packet [ssrc:%"
PRIu32
"]"
,
packet
->
GetSsrc
());
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
RECV_RTP_STREAM_NOT_FOUND
);
#endif
return
ReceiveRtpPacketResult
::
DISCARDED
;
}
...
...
@@ -601,7 +605,9 @@ namespace RTC
NotifyNewRtpStream
(
rtpStream
);
}
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
RECV_RTP_STREAM_DISCARDED
);
#endif
return
result
;
}
...
...
@@ -615,7 +621,9 @@ namespace RTC
// Process the packet.
if
(
!
rtpStream
->
ReceiveRtxPacket
(
packet
))
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
RECV_RTP_STREAM_NOT_FOUND
);
#endif
return
result
;
}
...
...
worker/src/RTC/Router.cpp
浏览文件 @
fb83d4f4
...
...
@@ -652,7 +652,9 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
routerId
=
this
->
id
;
#endif
auto
&
consumers
=
this
->
mapProducerConsumers
.
at
(
producer
);
...
...
worker/src/RTC/RtcLogger.cpp
浏览文件 @
fb83d4f4
...
...
@@ -49,7 +49,6 @@ namespace RTC
void
RtpPacket
::
Log
()
const
{
#ifdef MS_RTC_LOGGER_RTP
MS_TRACE
();
std
::
cout
<<
"{"
;
...
...
@@ -83,7 +82,6 @@ namespace RTC
std
::
cout
<<
",
\"
dropped
\"
: "
<<
(
this
->
dropped
?
"true"
:
"false"
);
std
::
cout
<<
",
\"
dropReason
\"
: '"
<<
dropReason2String
[
this
->
dropReason
]
<<
"'"
;
std
::
cout
<<
"}"
<<
std
::
endl
;
#endif
}
void
RtpPacket
::
Clear
()
...
...
worker/src/RTC/SimpleConsumer.cpp
浏览文件 @
fb83d4f4
...
...
@@ -301,11 +301,15 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
consumerId
=
this
->
id
;
#endif
if
(
!
IsActive
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
CONSUMER_INACTIVE
);
#endif
return
;
}
...
...
@@ -318,7 +322,9 @@ namespace RTC
{
MS_DEBUG_DEV
(
"payload type not supported [payloadType:%"
PRIu8
"]"
,
payloadType
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
UNSUPPORTED_PAYLOAD_TYPE
);
#endif
return
;
}
...
...
@@ -336,7 +342,9 @@ namespace RTC
this
->
rtpSeqManager
.
Drop
(
packet
->
GetSequenceNumber
());
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
DROPPED_BY_CODEC
);
#endif
return
;
}
...
...
@@ -345,7 +353,9 @@ namespace RTC
// the packet.
if
(
this
->
syncRequired
&&
this
->
keyFrameSupported
&&
!
packet
->
IsKeyFrame
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
NOT_A_KEYFRAME
);
#endif
return
;
}
...
...
@@ -379,8 +389,10 @@ namespace RTC
packet
->
SetSsrc
(
this
->
rtpParameters
.
encodings
[
0
].
ssrc
);
packet
->
SetSequenceNumber
(
seq
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
sendRtpTimestamp
=
packet
->
GetTimestamp
();
packet
->
logger
.
sendSeqNumber
=
seq
;
#endif
if
(
isSyncPacket
)
{
...
...
worker/src/RTC/SimulcastConsumer.cpp
浏览文件 @
fb83d4f4
...
...
@@ -712,18 +712,24 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
consumerId
=
this
->
id
;
#endif
if
(
!
IsActive
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
CONSUMER_INACTIVE
);
#endif
return
;
}
if
(
this
->
targetTemporalLayer
==
-
1
)
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
INVALID_TARGET_LAYER
);
#endif
return
;
}
...
...
@@ -736,7 +742,9 @@ namespace RTC
{
MS_DEBUG_DEV
(
"payload type not supported [payloadType:%"
PRIu8
"]"
,
payloadType
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
UNSUPPORTED_PAYLOAD_TYPE
);
#endif
return
;
}
...
...
@@ -751,7 +759,9 @@ namespace RTC
// Ignore if not a key frame.
if
(
!
packet
->
IsKeyFrame
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
NOT_A_KEYFRAME
);
#endif
return
;
}
...
...
@@ -766,7 +776,9 @@ namespace RTC
// drop it.
else
if
(
spatialLayer
!=
this
->
currentSpatialLayer
)
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
SPATIAL_LAYER_MISMATCH
);
#endif
return
;
}
...
...
@@ -774,7 +786,9 @@ namespace RTC
// If we need to sync and this is not a key frame, ignore the packet.
if
(
this
->
syncRequired
&&
!
packet
->
IsKeyFrame
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
NOT_A_KEYFRAME
);
#endif
return
;
}
...
...
@@ -890,7 +904,9 @@ namespace RTC
this
->
syncRequired
=
false
;
this
->
spatialLayerToSync
=
-
1
;
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
TOO_HIGH_TIMESTAMP_EXTRA_NEEDED
);
#endif
return
;
}
...
...
@@ -932,8 +948,10 @@ namespace RTC
if
(
SeqManager
<
uint16_t
>::
IsSeqLowerThan
(
packet
->
GetSequenceNumber
(),
this
->
snReferenceSpatialLayer
))
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
PACKET_PREVIOUS_TO_SPATIAL_LAYER_SWITCH
);
#endif
return
;
}
...
...
@@ -979,7 +997,9 @@ namespace RTC
{
this
->
rtpSeqManager
.
Drop
(
packet
->
GetSequenceNumber
());
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
DROPPED_BY_CODEC
);
#endif
return
;
}
...
...
@@ -1006,8 +1026,10 @@ namespace RTC
packet
->
SetSequenceNumber
(
seq
);
packet
->
SetTimestamp
(
timestamp
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
sendRtpTimestamp
=
timestamp
;
packet
->
logger
.
sendSeqNumber
=
seq
;
#endif
if
(
isSyncPacket
)
{
...
...
@@ -1050,7 +1072,9 @@ namespace RTC
origSeq
,
origTimestamp
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
SEND_RTP_STREAM_DISCARDED
);
#endif
}
// Restore packet fields.
...
...
worker/src/RTC/SvcConsumer.cpp
浏览文件 @
fb83d4f4
...
...
@@ -627,11 +627,15 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
consumerId
=
this
->
id
;
#endif
if
(
!
IsActive
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
CONSUMER_INACTIVE
);
#endif
return
;
}
...
...
@@ -643,7 +647,9 @@ namespace RTC
)
// clang-format on
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
INVALID_TARGET_LAYER
);
#endif
return
;
}
...
...
@@ -656,7 +662,9 @@ namespace RTC
{
MS_DEBUG_DEV
(
"payload type not supported [payloadType:%"
PRIu8
"]"
,
payloadType
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
UNSUPPORTED_PAYLOAD_TYPE
);
#endif
return
;
}
...
...
@@ -664,7 +672,9 @@ namespace RTC
// If we need to sync and this is not a key frame, ignore the packet.
if
(
this
->
syncRequired
&&
!
packet
->
IsKeyFrame
())
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
NOT_A_KEYFRAME
);
#endif
return
;
}
...
...
@@ -696,7 +706,9 @@ namespace RTC
{
this
->
rtpSeqManager
.
Drop
(
packet
->
GetSequenceNumber
());
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
DROPPED_BY_CODEC
);
#endif
return
;
}
...
...
@@ -725,8 +737,10 @@ namespace RTC
packet
->
SetSsrc
(
this
->
rtpParameters
.
encodings
[
0
].
ssrc
);
packet
->
SetSequenceNumber
(
seq
);
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
sendRtpTimestamp
=
packet
->
GetTimestamp
();
packet
->
logger
.
sendSeqNumber
=
seq
;
#endif
if
(
marker
)
{
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
fb83d4f4
...
...
@@ -1546,7 +1546,9 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
recvTransportId
=
this
->
id
;
#endif
// Apply the Transport RTP header extension ids so the RTP listener can use them.
packet
->
SetMidExtensionId
(
this
->
recvRtpHeaderExtensionIds
.
mid
);
...
...
@@ -1568,7 +1570,9 @@ namespace RTC
if
(
!
producer
)
{
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
Dropped
(
RtcLogger
::
RtpPacket
::
DropReason
::
PRODUCER_NOT_FOUND
);
#endif
MS_WARN_TAG
(
rtp
,
...
...
@@ -2442,8 +2446,10 @@ namespace RTC
{
MS_TRACE
();
#ifdef MS_RTC_LOGGER_RTP
packet
->
logger
.
sendTransportId
=
this
->
id
;
packet
->
logger
.
Sent
();
#endif
// Update abs-send-time if present.
packet
->
UpdateAbsSendTime
(
DepLibUV
::
GetTimeMs
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论