Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
a393689e
提交
a393689e
authored
12月 17, 2018
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
worker Logger: add logLevel "none" and replace MS_DUMP() macro with MS_DEBUG_DEV() (fixes #253)
上级
5aa09304
隐藏空白字符变更
内嵌
并排
正在显示
35 个修改的文件
包含
227 行增加
和
235 行删除
+227
-235
LogLevel.hpp
worker/include/LogLevel.hpp
+4
-3
Logger.hpp
worker/include/Logger.hpp
+35
-47
H264.cpp
worker/src/RTC/Codecs/H264.cpp
+3
-3
VP8.cpp
worker/src/RTC/Codecs/VP8.cpp
+18
-18
DtlsTransport.cpp
worker/src/RTC/DtlsTransport.cpp
+3
-3
Bye.cpp
worker/src/RTC/RTCP/Bye.cpp
+4
-4
CompoundPacket.cpp
worker/src/RTC/RTCP/CompoundPacket.cpp
+2
-2
Feedback.cpp
worker/src/RTC/RTCP/Feedback.cpp
+3
-3
FeedbackPs.cpp
worker/src/RTC/RTCP/FeedbackPs.cpp
+2
-2
FeedbackPsAfb.cpp
worker/src/RTC/RTCP/FeedbackPsAfb.cpp
+2
-2
FeedbackPsFir.cpp
worker/src/RTC/RTCP/FeedbackPsFir.cpp
+4
-4
FeedbackPsLei.cpp
worker/src/RTC/RTCP/FeedbackPsLei.cpp
+3
-3
FeedbackPsPli.cpp
worker/src/RTC/RTCP/FeedbackPsPli.cpp
+2
-2
FeedbackPsRemb.cpp
worker/src/RTC/RTCP/FeedbackPsRemb.cpp
+4
-4
FeedbackPsRpsi.cpp
worker/src/RTC/RTCP/FeedbackPsRpsi.cpp
+5
-5
FeedbackPsSli.cpp
worker/src/RTC/RTCP/FeedbackPsSli.cpp
+5
-5
FeedbackPsTst.cpp
worker/src/RTC/RTCP/FeedbackPsTst.cpp
+5
-5
FeedbackPsVbcm.cpp
worker/src/RTC/RTCP/FeedbackPsVbcm.cpp
+6
-6
FeedbackRtp.cpp
worker/src/RTC/RTCP/FeedbackRtp.cpp
+2
-2
FeedbackRtpEcn.cpp
worker/src/RTC/RTCP/FeedbackRtpEcn.cpp
+9
-9
FeedbackRtpNack.cpp
worker/src/RTC/RTCP/FeedbackRtpNack.cpp
+4
-4
FeedbackRtpSrReq.cpp
worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp
+2
-2
FeedbackRtpTllei.cpp
worker/src/RTC/RTCP/FeedbackRtpTllei.cpp
+4
-4
FeedbackRtpTmmb.cpp
worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp
+5
-5
ReceiverReport.cpp
worker/src/RTC/RTCP/ReceiverReport.cpp
+12
-12
Sdes.cpp
worker/src/RTC/RTCP/Sdes.cpp
+10
-10
SenderReport.cpp
worker/src/RTC/RTCP/SenderReport.cpp
+10
-10
RtpMonitor.cpp
worker/src/RTC/RtpMonitor.cpp
+6
-6
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+18
-18
StunMessage.cpp
worker/src/RTC/StunMessage.cpp
+16
-15
TransportTuple.cpp
worker/src/RTC/TransportTuple.cpp
+6
-6
Settings.cpp
worker/src/Settings.cpp
+4
-2
TcpConnection.cpp
worker/src/handles/TcpConnection.cpp
+3
-3
TcpServer.cpp
worker/src/handles/TcpServer.cpp
+3
-3
UdpSocket.cpp
worker/src/handles/UdpSocket.cpp
+3
-3
没有找到文件。
worker/include/LogLevel.hpp
浏览文件 @
a393689e
...
@@ -5,9 +5,10 @@
...
@@ -5,9 +5,10 @@
enum
class
LogLevel
:
uint8_t
enum
class
LogLevel
:
uint8_t
{
{
LOG_DEBUG
=
2
,
LOG_DEBUG
=
3
,
LOG_WARN
=
1
,
LOG_WARN
=
2
,
LOG_ERROR
=
0
LOG_ERROR
=
1
,
LOG_NONE
=
0
};
};
#endif
#endif
worker/include/Logger.hpp
浏览文件 @
a393689e
...
@@ -3,10 +3,13 @@
...
@@ -3,10 +3,13 @@
*
*
* This include file defines logging macros for source files (.cpp). Each
* This include file defines logging macros for source files (.cpp). Each
* source file including Logger.hpp MUST define its own MS_CLASS macro. Include
* source file including Logger.hpp MUST define its own MS_CLASS macro. Include
* files (.h) MUST NOT include Logger.hpp.
* files (.h
pp
) MUST NOT include Logger.hpp.
*
*
* All the logging macros use the same format as printf(). The XXX_STD version
* All the logging macros use the same format as printf(). The XXX_STD
()
version
* of a macro logs to stdoud/stderr instead of using the Channel instance.
* of a macro logs to stdoud/stderr instead of using the Channel instance.
* However some macros such as MS_ABORT() and MS_ASSERT() always log to stderr.
*
* If the macro MS_LOG_STD is defined, all the macros log to stdout/stderr.
*
*
* If the macro MS_LOG_FILE_LINE is defied, all the logging macros print more
* If the macro MS_LOG_FILE_LINE is defied, all the logging macros print more
* verbose information, including current file and line.
* verbose information, including current file and line.
...
@@ -41,18 +44,15 @@
...
@@ -41,18 +44,15 @@
* MS_DEBUG_DEV(...)
* MS_DEBUG_DEV(...)
* MS_WARN_DEV(...)
* MS_WARN_DEV(...)
*
*
* Logs if the current source file defines the MS_LOG_DEV macro.
* Logs if the current source file defines the MS_LOG_DEV macro and the current
* debug level is satisfied.
* Example:
* Example:
* MS_DEBUG_DEV("Producer closed [producerId:%" PRIu32 "]", producerId);
* MS_DEBUG_DEV("Producer closed [producerId:%" PRIu32 "]", producerId);
*
*
* MS_DUMP(...)
*
* For Dump() methods.
*
* MS_ERROR(...)
* MS_ERROR(...)
*
*
* Logs an error
. Must just be used for internal errors that should not
* Logs an error
if the current debug level is satisfied. Must just be used for
* happen.
*
internal errors that should not
happen.
*
*
* MS_ABORT(...)
* MS_ABORT(...)
*
*
...
@@ -138,7 +138,7 @@ public:
...
@@ -138,7 +138,7 @@ public:
#define MS_TRACE() \
#define MS_TRACE() \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
) \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D(trace) " _MS_LOG_STR, _MS_LOG_ARG); \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D(trace) " _MS_LOG_STR, _MS_LOG_ARG); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
...
@@ -149,7 +149,7 @@ public:
...
@@ -149,7 +149,7 @@ public:
#define MS_TRACE_STD() \
#define MS_TRACE_STD() \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
) \
{ \
{ \
std::fprintf(stdout, "(trace) " _MS_LOG_STR _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG); \
std::fprintf(stdout, "(trace) " _MS_LOG_STR _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG); \
std::fflush(stdout); \
std::fflush(stdout); \
...
@@ -162,15 +162,15 @@ public:
...
@@ -162,15 +162,15 @@ public:
#endif
#endif
#define MS_HAS_DEBUG_TAG(tag) \
#define MS_HAS_DEBUG_TAG(tag) \
(
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED))
(
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED))
#define MS_HAS_WARN_TAG(tag) \
#define MS_HAS_WARN_TAG(tag) \
(
LogLevel::LOG_WARN <= Settings::configuration.logLevel
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED))
(
Settings::configuration.logLevel >= LogLevel::LOG_WARN
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED))
#define MS_DEBUG_TAG(tag, desc, ...) \
#define MS_DEBUG_TAG(tag, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
...
@@ -181,7 +181,7 @@ public:
...
@@ -181,7 +181,7 @@ public:
#define MS_DEBUG_TAG_STD(tag, desc, ...) \
#define MS_DEBUG_TAG_STD(tag, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stdout); \
std::fflush(stdout); \
...
@@ -192,7 +192,7 @@ public:
...
@@ -192,7 +192,7 @@ public:
#define MS_WARN_TAG(tag, desc, ...) \
#define MS_WARN_TAG(tag, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_WARN <= Settings::configuration.logLevel
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel >= LogLevel::LOG_WARN
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "W" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "W" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
...
@@ -203,7 +203,7 @@ public:
...
@@ -203,7 +203,7 @@ public:
#define MS_WARN_TAG_STD(tag, desc, ...) \
#define MS_WARN_TAG_STD(tag, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_WARN <= Settings::configuration.logLevel
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel >= LogLevel::LOG_WARN
&& (_MS_TAG_ENABLED(tag) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stderr); \
std::fflush(stderr); \
...
@@ -214,7 +214,7 @@ public:
...
@@ -214,7 +214,7 @@ public:
#define MS_DEBUG_2TAGS(tag1, tag2, desc, ...) \
#define MS_DEBUG_2TAGS(tag1, tag2, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
...
@@ -225,7 +225,7 @@ public:
...
@@ -225,7 +225,7 @@ public:
#define MS_DEBUG_2TAGS_STD(tag1, tag2, desc, ...) \
#define MS_DEBUG_2TAGS_STD(tag1, tag2, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stdout); \
std::fflush(stdout); \
...
@@ -236,7 +236,7 @@ public:
...
@@ -236,7 +236,7 @@ public:
#define MS_WARN_2TAGS(tag1, tag2, desc, ...) \
#define MS_WARN_2TAGS(tag1, tag2, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_WARN <= Settings::configuration.logLevel
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel >= LogLevel::LOG_WARN
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "W" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "W" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
...
@@ -247,7 +247,7 @@ public:
...
@@ -247,7 +247,7 @@ public:
#define MS_WARN_2TAGS_STD(tag1, tag2, desc, ...) \
#define MS_WARN_2TAGS_STD(tag1, tag2, desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_WARN <= Settings::configuration.logLevel
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
if (
Settings::configuration.logLevel >= LogLevel::LOG_WARN
&& (_MS_TAG_ENABLED_2(tag1, tag2) || _MS_LOG_DEV_ENABLED)) \
{ \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stderr); \
std::fflush(stderr); \
...
@@ -259,7 +259,7 @@ public:
...
@@ -259,7 +259,7 @@ public:
#define MS_DEBUG_DEV(desc, ...) \
#define MS_DEBUG_DEV(desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
) \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
...
@@ -270,7 +270,7 @@ public:
...
@@ -270,7 +270,7 @@ public:
#define MS_DEBUG_DEV_STD(desc, ...) \
#define MS_DEBUG_DEV_STD(desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_DEBUG == Settings::configuration.logLevel
) \
if (
Settings::configuration.logLevel == LogLevel::LOG_DEBUG
) \
{ \
{ \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stdout); \
std::fflush(stdout); \
...
@@ -281,7 +281,7 @@ public:
...
@@ -281,7 +281,7 @@ public:
#define MS_WARN_DEV(desc, ...) \
#define MS_WARN_DEV(desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_WARN <= Settings::configuration.logLevel
) \
if (
Settings::configuration.logLevel >= LogLevel::LOG_WARN
) \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "W" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "W" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
...
@@ -292,7 +292,7 @@ public:
...
@@ -292,7 +292,7 @@ public:
#define MS_WARN_DEV_STD(desc, ...) \
#define MS_WARN_DEV_STD(desc, ...) \
do \
do \
{ \
{ \
if (
LogLevel::LOG_WARN <= Settings::configuration.logLevel
) \
if (
Settings::configuration.logLevel >= LogLevel::LOG_WARN
) \
{ \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stderr); \
std::fflush(stderr); \
...
@@ -306,35 +306,25 @@ public:
...
@@ -306,35 +306,25 @@ public:
#define MS_WARN_DEV_STD(desc, ...) ;
#define MS_WARN_DEV_STD(desc, ...) ;
#endif
#endif
#define MS_DUMP(desc, ...) \
do \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
} \
while (false)
#define MS_DUMP_STD(desc, ...) \
do \
{ \
std::fprintf(stdout, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stdout); \
} \
while (false)
#define MS_ERROR(desc, ...) \
#define MS_ERROR(desc, ...) \
do \
do \
{ \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "E" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
if (Settings::configuration.logLevel >= LogLevel::LOG_ERROR) \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
{ \
int loggerWritten = std::snprintf(Logger::buffer, Logger::bufferSize, "E" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, loggerWritten); \
} \
} \
} \
while (false)
while (false)
#define MS_ERROR_STD(desc, ...) \
#define MS_ERROR_STD(desc, ...) \
do \
do \
{ \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
if (Settings::configuration.logLevel >= LogLevel::LOG_ERROR) \
std::fflush(stderr); \
{ \
std::fprintf(stderr, _MS_LOG_STR_DESC desc _MS_LOG_SEPARATOR_CHAR_STD, _MS_LOG_ARG, ##__VA_ARGS__); \
std::fflush(stderr); \
} \
} \
} \
while (false)
while (false)
...
@@ -368,8 +358,6 @@ public:
...
@@ -368,8 +358,6 @@ public:
#define MS_DEBUG_DEV MS_DEBUG_DEV_STD
#define MS_DEBUG_DEV MS_DEBUG_DEV_STD
#undef MS_WARN_DEV
#undef MS_WARN_DEV
#define MS_WARN_DEV MS_WARN_DEV_STD
#define MS_WARN_DEV MS_WARN_DEV_STD
#undef MS_DUMP
#define MS_DUMP MS_DUMP_STD
#undef MS_ERROR
#undef MS_ERROR
#define MS_ERROR MS_ERROR_STD
#define MS_ERROR MS_ERROR_STD
#endif
#endif
...
...
worker/src/RTC/Codecs/H264.cpp
浏览文件 @
a393689e
...
@@ -85,9 +85,9 @@ namespace RTC
...
@@ -85,9 +85,9 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<PayloadDescriptor>"
);
MS_D
EBUG_DEV
(
"<PayloadDescriptor>"
);
MS_D
UMP
(
" isKeyFrame : %s"
,
this
->
isKeyFrame
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" isKeyFrame : %s"
,
this
->
isKeyFrame
?
"true"
:
"false"
);
MS_D
UMP
(
"</PayloadDescriptor>"
);
MS_D
EBUG_DEV
(
"</PayloadDescriptor>"
);
}
}
H264
::
PayloadDescriptorHandler
::
PayloadDescriptorHandler
(
H264
::
PayloadDescriptor
*
payloadDescriptor
)
H264
::
PayloadDescriptorHandler
::
PayloadDescriptorHandler
(
H264
::
PayloadDescriptor
*
payloadDescriptor
)
...
...
worker/src/RTC/Codecs/VP8.cpp
浏览文件 @
a393689e
...
@@ -146,29 +146,29 @@ namespace RTC
...
@@ -146,29 +146,29 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<PayloadDescriptor>"
);
MS_D
EBUG_DEV
(
"<PayloadDescriptor>"
);
MS_D
UMP
(
" extended : %"
PRIu8
,
this
->
extended
);
MS_D
EBUG_DEV
(
" extended : %"
PRIu8
,
this
->
extended
);
MS_D
UMP
(
" nonReference : %"
PRIu8
,
this
->
nonReference
);
MS_D
EBUG_DEV
(
" nonReference : %"
PRIu8
,
this
->
nonReference
);
MS_D
UMP
(
" start : %"
PRIu8
,
this
->
start
);
MS_D
EBUG_DEV
(
" start : %"
PRIu8
,
this
->
start
);
MS_D
UMP
(
" partitionIndex : %"
PRIu8
,
this
->
partitionIndex
);
MS_D
EBUG_DEV
(
" partitionIndex : %"
PRIu8
,
this
->
partitionIndex
);
MS_D
UMP
(
MS_D
EBUG_DEV
(
" i|l|t|k : %"
PRIu8
"|%"
PRIu8
"|%"
PRIu8
"|%"
PRIu8
,
" i|l|t|k : %"
PRIu8
"|%"
PRIu8
"|%"
PRIu8
"|%"
PRIu8
,
this
->
i
,
this
->
i
,
this
->
l
,
this
->
l
,
this
->
t
,
this
->
t
,
this
->
k
);
this
->
k
);
MS_D
UMP
(
" pictureId : %"
PRIu16
,
this
->
pictureId
);
MS_D
EBUG_DEV
(
" pictureId : %"
PRIu16
,
this
->
pictureId
);
MS_D
UMP
(
" tl0PictureIndex : %"
PRIu8
,
this
->
tl0PictureIndex
);
MS_D
EBUG_DEV
(
" tl0PictureIndex : %"
PRIu8
,
this
->
tl0PictureIndex
);
MS_D
UMP
(
" tlIndex : %"
PRIu8
,
this
->
tlIndex
);
MS_D
EBUG_DEV
(
" tlIndex : %"
PRIu8
,
this
->
tlIndex
);
MS_D
UMP
(
" y : %"
PRIu8
,
this
->
y
);
MS_D
EBUG_DEV
(
" y : %"
PRIu8
,
this
->
y
);
MS_D
UMP
(
" keyIndex : %"
PRIu8
,
this
->
keyIndex
);
MS_D
EBUG_DEV
(
" keyIndex : %"
PRIu8
,
this
->
keyIndex
);
MS_D
UMP
(
" isKeyFrame : %s"
,
this
->
isKeyFrame
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" isKeyFrame : %s"
,
this
->
isKeyFrame
?
"true"
:
"false"
);
MS_D
UMP
(
" hasPictureId : %s"
,
this
->
hasPictureId
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" hasPictureId : %s"
,
this
->
hasPictureId
?
"true"
:
"false"
);
MS_D
UMP
(
" hasOneBytePictureId : %s"
,
this
->
hasOneBytePictureId
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" hasOneBytePictureId : %s"
,
this
->
hasOneBytePictureId
?
"true"
:
"false"
);
MS_D
UMP
(
" hasTwoBytesPictureId : %s"
,
this
->
hasTwoBytesPictureId
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" hasTwoBytesPictureId : %s"
,
this
->
hasTwoBytesPictureId
?
"true"
:
"false"
);
MS_D
UMP
(
" hasTl0PictureIndex : %s"
,
this
->
hasTl0PictureIndex
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" hasTl0PictureIndex : %s"
,
this
->
hasTl0PictureIndex
?
"true"
:
"false"
);
MS_D
UMP
(
" hasTlIndex : %s"
,
this
->
hasTlIndex
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" hasTlIndex : %s"
,
this
->
hasTlIndex
?
"true"
:
"false"
);
MS_D
UMP
(
"</PayloadDescriptor>"
);
MS_D
EBUG_DEV
(
"</PayloadDescriptor>"
);
}
}
VP8
::
PayloadDescriptorHandler
::
PayloadDescriptorHandler
(
VP8
::
PayloadDescriptor
*
payloadDescriptor
)
VP8
::
PayloadDescriptorHandler
::
PayloadDescriptorHandler
(
VP8
::
PayloadDescriptor
*
payloadDescriptor
)
...
...
worker/src/RTC/DtlsTransport.cpp
浏览文件 @
a393689e
...
@@ -609,15 +609,15 @@ namespace RTC
...
@@ -609,15 +609,15 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<DtlsTransport>"
);
MS_D
EBUG_DEV
(
"<DtlsTransport>"
);
MS_D
UMP
(
MS_D
EBUG_DEV
(
" [role:%s, running:%s, handshake done:%s, connected:%s]"
,
" [role:%s, running:%s, handshake done:%s, connected:%s]"
,
(
this
->
localRole
==
Role
::
SERVER
?
"server"
(
this
->
localRole
==
Role
::
SERVER
?
"server"
:
(
this
->
localRole
==
Role
::
CLIENT
?
"client"
:
"none"
)),
:
(
this
->
localRole
==
Role
::
CLIENT
?
"client"
:
"none"
)),
IsRunning
()
?
"yes"
:
"no"
,
IsRunning
()
?
"yes"
:
"no"
,
this
->
handshakeDone
?
"yes"
:
"no"
,
this
->
handshakeDone
?
"yes"
:
"no"
,
this
->
state
==
DtlsState
::
CONNECTED
?
"yes"
:
"no"
);
this
->
state
==
DtlsState
::
CONNECTED
?
"yes"
:
"no"
);
MS_D
UMP
(
"</DtlsTransport>"
);
MS_D
EBUG_DEV
(
"</DtlsTransport>"
);
}
}
void
DtlsTransport
::
Run
(
Role
localRole
)
void
DtlsTransport
::
Run
(
Role
localRole
)
...
...
worker/src/RTC/RTCP/Bye.cpp
浏览文件 @
a393689e
...
@@ -90,14 +90,14 @@ namespace RTC
...
@@ -90,14 +90,14 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<ByePacket>"
);
MS_D
EBUG_DEV
(
"<ByePacket>"
);
for
(
auto
ssrc
:
this
->
ssrcs
)
for
(
auto
ssrc
:
this
->
ssrcs
)
{
{
MS_D
UMP
(
" ssrc : %"
PRIu32
,
ssrc
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
ssrc
);
}
}
if
(
!
this
->
reason
.
empty
())
if
(
!
this
->
reason
.
empty
())
MS_D
UMP
(
" reason : %s"
,
this
->
reason
.
c_str
());
MS_D
EBUG_DEV
(
" reason : %s"
,
this
->
reason
.
c_str
());
MS_D
UMP
(
"</ByePacket>"
);
MS_D
EBUG_DEV
(
"</ByePacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/CompoundPacket.cpp
浏览文件 @
a393689e
...
@@ -85,7 +85,7 @@ namespace RTC
...
@@ -85,7 +85,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<CompoundPacket>"
);
MS_D
EBUG_DEV
(
"<CompoundPacket>"
);
if
(
HasSenderReport
())
if
(
HasSenderReport
())
{
{
...
@@ -100,7 +100,7 @@ namespace RTC
...
@@ -100,7 +100,7 @@ namespace RTC
if
(
this
->
sdesPacket
.
GetCount
()
!=
0u
)
if
(
this
->
sdesPacket
.
GetCount
()
!=
0u
)
this
->
sdesPacket
.
Dump
();
this
->
sdesPacket
.
Dump
();
MS_D
UMP
(
"</CompoundPacket>"
);
MS_D
EBUG_DEV
(
"</CompoundPacket>"
);
}
}
void
CompoundPacket
::
AddSenderReport
(
SenderReport
*
report
)
void
CompoundPacket
::
AddSenderReport
(
SenderReport
*
report
)
...
...
worker/src/RTC/RTCP/Feedback.cpp
浏览文件 @
a393689e
...
@@ -86,9 +86,9 @@ namespace RTC
...
@@ -86,9 +86,9 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
" sender ssrc : %"
PRIu32
,
GetSenderSsrc
());
MS_D
EBUG_DEV
(
" sender ssrc : %"
PRIu32
,
GetSenderSsrc
());
MS_D
UMP
(
" media ssrc : %"
PRIu32
,
GetMediaSsrc
());
MS_D
EBUG_DEV
(
" media ssrc : %"
PRIu32
,
GetMediaSsrc
());
MS_D
UMP
(
" size : %zu"
,
this
->
GetSize
());
MS_D
EBUG_DEV
(
" size : %zu"
,
this
->
GetSize
());
}
}
/* Specialization for Ps class. */
/* Specialization for Ps class. */
...
...
worker/src/RTC/RTCP/FeedbackPs.cpp
浏览文件 @
a393689e
...
@@ -82,13 +82,13 @@ namespace RTC
...
@@ -82,13 +82,13 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
MS_D
EBUG_DEV
(
"<%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
FeedbackPsPacket
::
Dump
();
FeedbackPsPacket
::
Dump
();
for
(
auto
item
:
this
->
items
)
for
(
auto
item
:
this
->
items
)
{
{
item
->
Dump
();
item
->
Dump
();
}
}
MS_D
UMP
(
"</%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
MS_D
EBUG_DEV
(
"</%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
}
}
// explicit instantiation to have all FeedbackRtpPacket definitions in this file.
// explicit instantiation to have all FeedbackRtpPacket definitions in this file.
...
...
worker/src/RTC/RTCP/FeedbackPsAfb.cpp
浏览文件 @
a393689e
...
@@ -61,9 +61,9 @@ namespace RTC
...
@@ -61,9 +61,9 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsAfbPacket>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsAfbPacket>"
);
FeedbackPsPacket
::
Dump
();
FeedbackPsPacket
::
Dump
();
MS_D
UMP
(
"</FeedbackPsAfbPacket>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsAfbPacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackPsFir.cpp
浏览文件 @
a393689e
...
@@ -41,10 +41,10 @@ namespace RTC
...
@@ -41,10 +41,10 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsFirItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsFirItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
"</FeedbackPsFirItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsFirItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackPsLei.cpp
浏览文件 @
a393689e
...
@@ -33,9 +33,9 @@ namespace RTC
...
@@ -33,9 +33,9 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsLeiItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsLeiItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
"</FeedbackPsLeiItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsLeiItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackPsPli.cpp
浏览文件 @
a393689e
...
@@ -32,9 +32,9 @@ namespace RTC
...
@@ -32,9 +32,9 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsPliPacket>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsPliPacket>"
);
FeedbackPsPacket
::
Dump
();
FeedbackPsPacket
::
Dump
();
MS_D
UMP
(
"</FeedbackPsPliPacket>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsPliPacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackPsRemb.cpp
浏览文件 @
a393689e
...
@@ -132,14 +132,14 @@ namespace RTC
...
@@ -132,14 +132,14 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsRembPacket>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsRembPacket>"
);
FeedbackPsPacket
::
Dump
();
FeedbackPsPacket
::
Dump
();
MS_D
UMP
(
" bitrate (bps): %"
PRIu64
,
this
->
bitrate
);
MS_D
EBUG_DEV
(
" bitrate (bps): %"
PRIu64
,
this
->
bitrate
);
for
(
auto
ssrc
:
this
->
ssrcs
)
for
(
auto
ssrc
:
this
->
ssrcs
)
{
{
MS_D
UMP
(
" ssrc: %"
PRIu32
,
ssrc
);
MS_D
EBUG_DEV
(
" ssrc: %"
PRIu32
,
ssrc
);
}
}
MS_D
UMP
(
"</FeedbackPsRembPacket>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsRembPacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackPsRpsi.cpp
浏览文件 @
a393689e
...
@@ -76,11 +76,11 @@ namespace RTC
...
@@ -76,11 +76,11 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsRpsiItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsRpsiItem>"
);
MS_D
UMP
(
" padding bits : %"
PRIu8
,
this
->
header
->
paddingBits
);
MS_D
EBUG_DEV
(
" padding bits : %"
PRIu8
,
this
->
header
->
paddingBits
);
MS_D
UMP
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
EBUG_DEV
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
UMP
(
" length : %zu"
,
this
->
GetLength
());
MS_D
EBUG_DEV
(
" length : %zu"
,
this
->
GetLength
());
MS_D
UMP
(
"</FeedbackPsRpsiItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsRpsiItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackPsSli.cpp
浏览文件 @
a393689e
...
@@ -39,11 +39,11 @@ namespace RTC
...
@@ -39,11 +39,11 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsSliItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsSliItem>"
);
MS_D
UMP
(
" first : %"
PRIu16
,
this
->
first
);
MS_D
EBUG_DEV
(
" first : %"
PRIu16
,
this
->
first
);
MS_D
UMP
(
" number : %"
PRIu16
,
this
->
number
);
MS_D
EBUG_DEV
(
" number : %"
PRIu16
,
this
->
number
);
MS_D
UMP
(
" picture id : %"
PRIu8
,
this
->
pictureId
);
MS_D
EBUG_DEV
(
" picture id : %"
PRIu8
,
this
->
pictureId
);
MS_D
UMP
(
"</FeedbackPsSliItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsSliItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackPsTst.cpp
浏览文件 @
a393689e
...
@@ -40,11 +40,11 @@ namespace RTC
...
@@ -40,11 +40,11 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsTstItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsTstItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
" index : %"
PRIu32
,
this
->
GetIndex
());
MS_D
EBUG_DEV
(
" index : %"
PRIu32
,
this
->
GetIndex
());
MS_D
UMP
(
"</FeedbackPsTstItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsTstItem>"
);
}
}
/* Specialization for Tstr class. */
/* Specialization for Tstr class. */
...
...
worker/src/RTC/RTCP/FeedbackPsVbcm.cpp
浏览文件 @
a393689e
...
@@ -50,12 +50,12 @@ namespace RTC
...
@@ -50,12 +50,12 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackPsVbcmItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackPsVbcmItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
EBUG_DEV
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
UMP
(
" length : %"
PRIu16
,
this
->
GetLength
());
MS_D
EBUG_DEV
(
" length : %"
PRIu16
,
this
->
GetLength
());
MS_D
UMP
(
"</FeedbackPsVbcmItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackPsVbcmItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackRtp.cpp
浏览文件 @
a393689e
...
@@ -73,13 +73,13 @@ namespace RTC
...
@@ -73,13 +73,13 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
MS_D
EBUG_DEV
(
"<%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
FeedbackRtpPacket
::
Dump
();
FeedbackRtpPacket
::
Dump
();
for
(
auto
item
:
this
->
items
)
for
(
auto
item
:
this
->
items
)
{
{
item
->
Dump
();
item
->
Dump
();
}
}
MS_D
UMP
(
"</%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
MS_D
EBUG_DEV
(
"</%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
messageType
).
c_str
());
}
}
// Explicit instantiation to have all FeedbackRtpPacket definitions in this file.
// Explicit instantiation to have all FeedbackRtpPacket definitions in this file.
...
...
worker/src/RTC/RTCP/FeedbackRtpEcn.cpp
浏览文件 @
a393689e
...
@@ -23,15 +23,15 @@ namespace RTC
...
@@ -23,15 +23,15 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackRtpEcnItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackRtpEcnItem>"
);
MS_D
UMP
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
" ect0 counter : %"
PRIu32
,
this
->
GetEct0Counter
());
MS_D
EBUG_DEV
(
" ect0 counter : %"
PRIu32
,
this
->
GetEct0Counter
());
MS_D
UMP
(
" ect1 counter : %"
PRIu32
,
this
->
GetEct1Counter
());
MS_D
EBUG_DEV
(
" ect1 counter : %"
PRIu32
,
this
->
GetEct1Counter
());
MS_D
UMP
(
" ecn ce counter : %"
PRIu16
,
this
->
GetEcnCeCounter
());
MS_D
EBUG_DEV
(
" ecn ce counter : %"
PRIu16
,
this
->
GetEcnCeCounter
());
MS_D
UMP
(
" not ect counter : %"
PRIu16
,
this
->
GetNotEctCounter
());
MS_D
EBUG_DEV
(
" not ect counter : %"
PRIu16
,
this
->
GetNotEctCounter
());
MS_D
UMP
(
" lost packets : %"
PRIu16
,
this
->
GetLostPackets
());
MS_D
EBUG_DEV
(
" lost packets : %"
PRIu16
,
this
->
GetLostPackets
());
MS_D
UMP
(
" duplicated packets : %"
PRIu16
,
this
->
GetDuplicatedPackets
());
MS_D
EBUG_DEV
(
" duplicated packets : %"
PRIu16
,
this
->
GetDuplicatedPackets
());
MS_D
UMP
(
"</FeedbackRtpEcnItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackRtpEcnItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackRtpNack.cpp
浏览文件 @
a393689e
...
@@ -36,10 +36,10 @@ namespace RTC
...
@@ -36,10 +36,10 @@ namespace RTC
std
::
bitset
<
16
>
nackBitset
(
this
->
GetLostPacketBitmask
());
std
::
bitset
<
16
>
nackBitset
(
this
->
GetLostPacketBitmask
());
MS_D
UMP
(
"<FeedbackRtpNackItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackRtpNackItem>"
);
MS_D
UMP
(
" pid : %"
PRIu16
,
this
->
GetPacketId
());
MS_D
EBUG_DEV
(
" pid : %"
PRIu16
,
this
->
GetPacketId
());
MS_D
UMP
(
" bpl : %s"
,
nackBitset
.
to_string
().
c_str
());
MS_D
EBUG_DEV
(
" bpl : %s"
,
nackBitset
.
to_string
().
c_str
());
MS_D
UMP
(
"</FeedbackRtpNackItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackRtpNackItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp
浏览文件 @
a393689e
...
@@ -30,9 +30,9 @@ namespace RTC
...
@@ -30,9 +30,9 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackRtpSrReqPacket>"
);
MS_D
EBUG_DEV
(
"<FeedbackRtpSrReqPacket>"
);
FeedbackRtpPacket
::
Dump
();
FeedbackRtpPacket
::
Dump
();
MS_D
UMP
(
"</FeedbackRtpSrReqPacket>"
);
MS_D
EBUG_DEV
(
"</FeedbackRtpSrReqPacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackRtpTllei.cpp
浏览文件 @
a393689e
...
@@ -33,10 +33,10 @@ namespace RTC
...
@@ -33,10 +33,10 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackRtpTlleiItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackRtpTlleiItem>"
);
MS_D
UMP
(
" pid: %"
PRIu16
,
this
->
GetPacketId
());
MS_D
EBUG_DEV
(
" pid: %"
PRIu16
,
this
->
GetPacketId
());
MS_D
UMP
(
" bpl: %"
PRIu16
,
this
->
GetLostPacketBitmask
());
MS_D
EBUG_DEV
(
" bpl: %"
PRIu16
,
this
->
GetLostPacketBitmask
());
MS_D
UMP
(
"</FeedbackRtpTlleiItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackRtpTlleiItem>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp
浏览文件 @
a393689e
...
@@ -68,11 +68,11 @@ namespace RTC
...
@@ -68,11 +68,11 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<FeedbackRtpTmmbItem>"
);
MS_D
EBUG_DEV
(
"<FeedbackRtpTmmbItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" bitrate : %"
PRIu64
,
this
->
GetBitrate
());
MS_D
EBUG_DEV
(
" bitrate : %"
PRIu64
,
this
->
GetBitrate
());
MS_D
UMP
(
" overhead : %"
PRIu16
,
this
->
GetOverhead
());
MS_D
EBUG_DEV
(
" overhead : %"
PRIu16
,
this
->
GetOverhead
());
MS_D
UMP
(
"</FeedbackRtpTmmbItem>"
);
MS_D
EBUG_DEV
(
"</FeedbackRtpTmmbItem>"
);
}
}
/* Specialization for Tmmbr class. */
/* Specialization for Tmmbr class. */
...
...
worker/src/RTC/RTCP/ReceiverReport.cpp
浏览文件 @
a393689e
...
@@ -36,15 +36,15 @@ namespace RTC
...
@@ -36,15 +36,15 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<ReceiverReport>"
);
MS_D
EBUG_DEV
(
"<ReceiverReport>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" fraction lost : %"
PRIu32
,
this
->
GetFractionLost
());
MS_D
EBUG_DEV
(
" fraction lost : %"
PRIu32
,
this
->
GetFractionLost
());
MS_D
UMP
(
" total lost : %"
PRIu32
,
this
->
GetTotalLost
());
MS_D
EBUG_DEV
(
" total lost : %"
PRIu32
,
this
->
GetTotalLost
());
MS_D
UMP
(
" last seq : %"
PRIu32
,
this
->
GetLastSeq
());
MS_D
EBUG_DEV
(
" last seq : %"
PRIu32
,
this
->
GetLastSeq
());
MS_D
UMP
(
" jitter : %"
PRIu32
,
this
->
GetJitter
());
MS_D
EBUG_DEV
(
" jitter : %"
PRIu32
,
this
->
GetJitter
());
MS_D
UMP
(
" lsr : %"
PRIu32
,
this
->
GetLastSenderReport
());
MS_D
EBUG_DEV
(
" lsr : %"
PRIu32
,
this
->
GetLastSenderReport
());
MS_D
UMP
(
" dlsr : %"
PRIu32
,
this
->
GetDelaySinceLastSenderReport
());
MS_D
EBUG_DEV
(
" dlsr : %"
PRIu32
,
this
->
GetDelaySinceLastSenderReport
());
MS_D
UMP
(
"</ReceiverReport>"
);
MS_D
EBUG_DEV
(
"</ReceiverReport>"
);
}
}
size_t
ReceiverReport
::
Serialize
(
uint8_t
*
buffer
)
size_t
ReceiverReport
::
Serialize
(
uint8_t
*
buffer
)
...
@@ -133,13 +133,13 @@ namespace RTC
...
@@ -133,13 +133,13 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<ReceiverReportPacket>"
);
MS_D
EBUG_DEV
(
"<ReceiverReportPacket>"
);
MS_D
UMP
(
" ssrc: %"
PRIu32
,
static_cast
<
uint32_t
>
(
ntohl
(
this
->
ssrc
)));
MS_D
EBUG_DEV
(
" ssrc: %"
PRIu32
,
static_cast
<
uint32_t
>
(
ntohl
(
this
->
ssrc
)));
for
(
auto
report
:
this
->
reports
)
for
(
auto
report
:
this
->
reports
)
{
{
report
->
Dump
();
report
->
Dump
();
}
}
MS_D
UMP
(
"</ReceiverReportPacket>"
);
MS_D
EBUG_DEV
(
"</ReceiverReportPacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/Sdes.cpp
浏览文件 @
a393689e
...
@@ -85,11 +85,11 @@ namespace RTC
...
@@ -85,11 +85,11 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<SdesItem>"
);
MS_D
EBUG_DEV
(
"<SdesItem>"
);
MS_D
UMP
(
" type : %s"
,
SdesItem
::
Type2String
(
this
->
GetType
()).
c_str
());
MS_D
EBUG_DEV
(
" type : %s"
,
SdesItem
::
Type2String
(
this
->
GetType
()).
c_str
());
MS_D
UMP
(
" length : %"
PRIu8
,
this
->
header
->
length
);
MS_D
EBUG_DEV
(
" length : %"
PRIu8
,
this
->
header
->
length
);
MS_D
UMP
(
" value : %.*s"
,
this
->
header
->
length
,
this
->
header
->
value
);
MS_D
EBUG_DEV
(
" value : %.*s"
,
this
->
header
->
length
,
this
->
header
->
value
);
MS_D
UMP
(
"</SdesItem>"
);
MS_D
EBUG_DEV
(
"</SdesItem>"
);
}
}
size_t
SdesItem
::
Serialize
(
uint8_t
*
buffer
)
size_t
SdesItem
::
Serialize
(
uint8_t
*
buffer
)
...
@@ -167,13 +167,13 @@ namespace RTC
...
@@ -167,13 +167,13 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<SdesChunk>"
);
MS_D
EBUG_DEV
(
"<SdesChunk>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
static_cast
<
uint32_t
>
(
ntohl
(
this
->
ssrc
)));
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
static_cast
<
uint32_t
>
(
ntohl
(
this
->
ssrc
)));
for
(
auto
item
:
this
->
items
)
for
(
auto
item
:
this
->
items
)
{
{
item
->
Dump
();
item
->
Dump
();
}
}
MS_D
UMP
(
"</SdesChunk>"
);
MS_D
EBUG_DEV
(
"</SdesChunk>"
);
}
}
/* Class methods. */
/* Class methods. */
...
@@ -226,12 +226,12 @@ namespace RTC
...
@@ -226,12 +226,12 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<SdesPacket>"
);
MS_D
EBUG_DEV
(
"<SdesPacket>"
);
for
(
auto
chunk
:
this
->
chunks
)
for
(
auto
chunk
:
this
->
chunks
)
{
{
chunk
->
Dump
();
chunk
->
Dump
();
}
}
MS_D
UMP
(
"</SdesPacket>"
);
MS_D
EBUG_DEV
(
"</SdesPacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RTCP/SenderReport.cpp
浏览文件 @
a393689e
...
@@ -35,14 +35,14 @@ namespace RTC
...
@@ -35,14 +35,14 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<SenderReport>"
);
MS_D
EBUG_DEV
(
"<SenderReport>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" ntp sec : %"
PRIu32
,
this
->
GetNtpSec
());
MS_D
EBUG_DEV
(
" ntp sec : %"
PRIu32
,
this
->
GetNtpSec
());
MS_D
UMP
(
" ntp frac : %"
PRIu32
,
this
->
GetNtpFrac
());
MS_D
EBUG_DEV
(
" ntp frac : %"
PRIu32
,
this
->
GetNtpFrac
());
MS_D
UMP
(
" rtp ts : %"
PRIu32
,
this
->
GetRtpTs
());
MS_D
EBUG_DEV
(
" rtp ts : %"
PRIu32
,
this
->
GetRtpTs
());
MS_D
UMP
(
" packet count : %"
PRIu32
,
this
->
GetPacketCount
());
MS_D
EBUG_DEV
(
" packet count : %"
PRIu32
,
this
->
GetPacketCount
());
MS_D
UMP
(
" octet count : %"
PRIu32
,
this
->
GetOctetCount
());
MS_D
EBUG_DEV
(
" octet count : %"
PRIu32
,
this
->
GetOctetCount
());
MS_D
UMP
(
"</SenderReport>"
);
MS_D
EBUG_DEV
(
"</SenderReport>"
);
}
}
size_t
SenderReport
::
Serialize
(
uint8_t
*
buffer
)
size_t
SenderReport
::
Serialize
(
uint8_t
*
buffer
)
...
@@ -97,12 +97,12 @@ namespace RTC
...
@@ -97,12 +97,12 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<SenderReportPacket>"
);
MS_D
EBUG_DEV
(
"<SenderReportPacket>"
);
for
(
auto
report
:
this
->
reports
)
for
(
auto
report
:
this
->
reports
)
{
{
report
->
Dump
();
report
->
Dump
();
}
}
MS_D
UMP
(
"</SenderReportPacket>"
);
MS_D
EBUG_DEV
(
"</SenderReportPacket>"
);
}
}
}
// namespace RTCP
}
// namespace RTCP
}
// namespace RTC
}
// namespace RTC
worker/src/RTC/RtpMonitor.cpp
浏览文件 @
a393689e
...
@@ -139,12 +139,12 @@ namespace RTC
...
@@ -139,12 +139,12 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<RtpMonitor>"
);
MS_D
EBUG_DEV
(
"<RtpMonitor>"
);
MS_D
UMP
(
" score : %"
PRIi8
,
GetScore
());
MS_D
EBUG_DEV
(
" score : %"
PRIi8
,
GetScore
());
MS_D
UMP
(
" totalSourceLoss : %"
PRIi32
,
this
->
totalSourceLoss
);
MS_D
EBUG_DEV
(
" totalSourceLoss : %"
PRIi32
,
this
->
totalSourceLoss
);
MS_D
UMP
(
" totalReportedLoss : %"
PRIi32
,
this
->
totalReportedLoss
);
MS_D
EBUG_DEV
(
" totalReportedLoss : %"
PRIi32
,
this
->
totalReportedLoss
);
MS_D
UMP
(
" repairedPackets size : %zu"
,
this
->
repairedPackets
.
size
());
MS_D
EBUG_DEV
(
" repairedPackets size : %zu"
,
this
->
repairedPackets
.
size
());
MS_D
UMP
(
"</RtpMonitor>"
);
MS_D
EBUG_DEV
(
"</RtpMonitor>"
);
}
}
void
RtpMonitor
::
AddScore
(
uint8_t
score
)
void
RtpMonitor
::
AddScore
(
uint8_t
score
)
...
...
worker/src/RTC/RtpPacket.cpp
浏览文件 @
a393689e
...
@@ -207,21 +207,21 @@ namespace RTC
...
@@ -207,21 +207,21 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<RtpPacket>"
);
MS_D
EBUG_DEV
(
"<RtpPacket>"
);
MS_D
UMP
(
" padding : %s"
,
this
->
header
->
padding
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" padding : %s"
,
this
->
header
->
padding
?
"true"
:
"false"
);
MS_D
UMP
(
" extension header : %s"
,
HasExtensionHeader
()
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" extension header : %s"
,
HasExtensionHeader
()
?
"true"
:
"false"
);
if
(
HasExtensionHeader
())
if
(
HasExtensionHeader
())
{
{
MS_D
UMP
(
" id : %"
PRIu16
,
GetExtensionHeaderId
());
MS_D
EBUG_DEV
(
" id : %"
PRIu16
,
GetExtensionHeaderId
());
MS_D
UMP
(
" length : %zu bytes"
,
GetExtensionHeaderLength
());
MS_D
EBUG_DEV
(
" length : %zu bytes"
,
GetExtensionHeaderLength
());
}
}
if
(
HasOneByteExtensions
())
if
(
HasOneByteExtensions
())
{
{
MS_D
UMP
(
" RFC5285 ext style : One-Byte Header"
);
MS_D
EBUG_DEV
(
" RFC5285 ext style : One-Byte Header"
);
}
}
if
(
HasTwoBytesExtensions
())
if
(
HasTwoBytesExtensions
())
{
{
MS_D
UMP
(
" RFC5285 ext style : Two-Bytes Header"
);
MS_D
EBUG_DEV
(
" RFC5285 ext style : Two-Bytes Header"
);
}
}
if
(
HasOneByteExtensions
()
||
HasTwoBytesExtensions
())
if
(
HasOneByteExtensions
()
||
HasTwoBytesExtensions
())
{
{
...
@@ -243,21 +243,21 @@ namespace RTC
...
@@ -243,21 +243,21 @@ namespace RTC
extIds
.
begin
(),
extIds
.
end
()
-
1
,
std
::
ostream_iterator
<
std
::
string
>
(
extIdsStream
,
","
));
extIds
.
begin
(),
extIds
.
end
()
-
1
,
std
::
ostream_iterator
<
std
::
string
>
(
extIdsStream
,
","
));
extIdsStream
<<
extIds
.
back
();
extIdsStream
<<
extIds
.
back
();
MS_D
UMP
(
" RFC5285 ext ids : %s"
,
extIdsStream
.
str
().
c_str
());
MS_D
EBUG_DEV
(
" RFC5285 ext ids : %s"
,
extIdsStream
.
str
().
c_str
());
}
}
MS_D
UMP
(
" csrc count : %"
PRIu8
,
this
->
header
->
csrcCount
);
MS_D
EBUG_DEV
(
" csrc count : %"
PRIu8
,
this
->
header
->
csrcCount
);
MS_D
UMP
(
" marker : %s"
,
HasMarker
()
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" marker : %s"
,
HasMarker
()
?
"true"
:
"false"
);
MS_D
UMP
(
" payload type : %"
PRIu8
,
GetPayloadType
());
MS_D
EBUG_DEV
(
" payload type : %"
PRIu8
,
GetPayloadType
());
MS_D
UMP
(
" sequence number : %"
PRIu16
,
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu16
,
GetSequenceNumber
());
MS_D
UMP
(
" timestamp : %"
PRIu32
,
GetTimestamp
());
MS_D
EBUG_DEV
(
" timestamp : %"
PRIu32
,
GetTimestamp
());
MS_D
UMP
(
" ssrc : %"
PRIu32
,
GetSsrc
());
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
GetSsrc
());
MS_D
UMP
(
" payload size : %zu bytes"
,
GetPayloadLength
());
MS_D
EBUG_DEV
(
" payload size : %zu bytes"
,
GetPayloadLength
());
if
(
this
->
header
->
padding
!=
0u
)
if
(
this
->
header
->
padding
!=
0u
)
{
{
MS_D
UMP
(
" padding size : %"
PRIu8
" bytes"
,
this
->
payloadPadding
);
MS_D
EBUG_DEV
(
" padding size : %"
PRIu8
" bytes"
,
this
->
payloadPadding
);
}
}
MS_D
UMP
(
" packet size : %zu bytes"
,
GetSize
());
MS_D
EBUG_DEV
(
" packet size : %zu bytes"
,
GetSize
());
MS_D
UMP
(
"</RtpPacket>"
);
MS_D
EBUG_DEV
(
"</RtpPacket>"
);
}
}
void
RtpPacket
::
MangleExtensionHeaderIds
(
const
std
::
map
<
uint8_t
,
uint8_t
>&
idMapping
)
void
RtpPacket
::
MangleExtensionHeaderIds
(
const
std
::
map
<
uint8_t
,
uint8_t
>&
idMapping
)
...
...
worker/src/RTC/StunMessage.cpp
浏览文件 @
a393689e
...
@@ -315,7 +315,7 @@ namespace RTC
...
@@ -315,7 +315,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
MS_D
UMP
(
"<StunMessage>"
);
MS_D
EBUG_DEV
(
"<StunMessage>"
);
std
::
string
klass
;
std
::
string
klass
;
switch
(
this
->
klass
)
switch
(
this
->
klass
)
...
@@ -335,14 +335,15 @@ namespace RTC
...
@@ -335,14 +335,15 @@ namespace RTC
}
}
if
(
this
->
method
==
Method
::
BINDING
)
if
(
this
->
method
==
Method
::
BINDING
)
{
{
MS_D
UMP
(
" Binding %s"
,
klass
.
c_str
());
MS_D
EBUG_DEV
(
" Binding %s"
,
klass
.
c_str
());
}
}
else
else
{
{
// This prints the unknown method number. Example: TURN Allocate => 0x003.
// This prints the unknown method number. Example: TURN Allocate => 0x003.
MS_DUMP
(
" %s with unknown method %#.3x"
,
klass
.
c_str
(),
static_cast
<
uint16_t
>
(
this
->
method
));
MS_DEBUG_DEV
(
" %s with unknown method %#.3x"
,
klass
.
c_str
(),
static_cast
<
uint16_t
>
(
this
->
method
));
}
}
MS_D
UMP
(
" size: %zu bytes"
,
this
->
size
);
MS_D
EBUG_DEV
(
" size: %zu bytes"
,
this
->
size
);
static
char
transactionId
[
25
];
static
char
transactionId
[
25
];
...
@@ -351,19 +352,19 @@ namespace RTC
...
@@ -351,19 +352,19 @@ namespace RTC
// NOTE: n must be 3 because snprintf adds a \0 after printed chars.
// NOTE: n must be 3 because snprintf adds a \0 after printed chars.
std
::
snprintf
(
transactionId
+
(
i
*
2
),
3
,
"%.2x"
,
this
->
transactionId
[
i
]);
std
::
snprintf
(
transactionId
+
(
i
*
2
),
3
,
"%.2x"
,
this
->
transactionId
[
i
]);
}
}
MS_D
UMP
(
" transactionId: %s"
,
transactionId
);
MS_D
EBUG_DEV
(
" transactionId: %s"
,
transactionId
);
if
(
this
->
errorCode
!=
0u
)
if
(
this
->
errorCode
!=
0u
)
MS_D
UMP
(
" errorCode: %"
PRIu16
,
this
->
errorCode
);
MS_D
EBUG_DEV
(
" errorCode: %"
PRIu16
,
this
->
errorCode
);
if
(
!
this
->
username
.
empty
())
if
(
!
this
->
username
.
empty
())
MS_D
UMP
(
" username: %s"
,
this
->
username
.
c_str
());
MS_D
EBUG_DEV
(
" username: %s"
,
this
->
username
.
c_str
());
if
(
this
->
priority
!=
0u
)
if
(
this
->
priority
!=
0u
)
MS_D
UMP
(
" priority: %"
PRIu32
,
this
->
priority
);
MS_D
EBUG_DEV
(
" priority: %"
PRIu32
,
this
->
priority
);
if
(
this
->
iceControlling
!=
0u
)
if
(
this
->
iceControlling
!=
0u
)
MS_D
UMP
(
" iceControlling: %"
PRIu64
,
this
->
iceControlling
);
MS_D
EBUG_DEV
(
" iceControlling: %"
PRIu64
,
this
->
iceControlling
);
if
(
this
->
iceControlled
!=
0u
)
if
(
this
->
iceControlled
!=
0u
)
MS_D
UMP
(
" iceControlled: %"
PRIu64
,
this
->
iceControlled
);
MS_D
EBUG_DEV
(
" iceControlled: %"
PRIu64
,
this
->
iceControlled
);
if
(
this
->
hasUseCandidate
)
if
(
this
->
hasUseCandidate
)
MS_D
UMP
(
" useCandidate"
);
MS_D
EBUG_DEV
(
" useCandidate"
);
if
(
this
->
xorMappedAddress
!=
nullptr
)
if
(
this
->
xorMappedAddress
!=
nullptr
)
{
{
int
family
;
int
family
;
...
@@ -372,7 +373,7 @@ namespace RTC
...
@@ -372,7 +373,7 @@ namespace RTC
Utils
::
IP
::
GetAddressInfo
(
this
->
xorMappedAddress
,
&
family
,
ip
,
&
port
);
Utils
::
IP
::
GetAddressInfo
(
this
->
xorMappedAddress
,
&
family
,
ip
,
&
port
);
MS_D
UMP
(
" xorMappedAddress: %s : %"
PRIu16
,
ip
.
c_str
(),
port
);
MS_D
EBUG_DEV
(
" xorMappedAddress: %s : %"
PRIu16
,
ip
.
c_str
(),
port
);
}
}
if
(
this
->
messageIntegrity
!=
nullptr
)
if
(
this
->
messageIntegrity
!=
nullptr
)
{
{
...
@@ -383,12 +384,12 @@ namespace RTC
...
@@ -383,12 +384,12 @@ namespace RTC
std
::
snprintf
(
messageIntegrity
+
(
i
*
2
),
3
,
"%.2x"
,
this
->
messageIntegrity
[
i
]);
std
::
snprintf
(
messageIntegrity
+
(
i
*
2
),
3
,
"%.2x"
,
this
->
messageIntegrity
[
i
]);
}
}
MS_D
UMP
(
" messageIntegrity: %s"
,
messageIntegrity
);
MS_D
EBUG_DEV
(
" messageIntegrity: %s"
,
messageIntegrity
);
}
}
if
(
this
->
hasFingerprint
)
if
(
this
->
hasFingerprint
)
MS_D
UMP
(
" fingerprint"
);
MS_D
EBUG_DEV
(
" fingerprint"
);
MS_D
UMP
(
"</StunMessage>"
);
MS_D
EBUG_DEV
(
"</StunMessage>"
);
}
}
StunMessage
::
Authentication
StunMessage
::
CheckAuthentication
(
StunMessage
::
Authentication
StunMessage
::
CheckAuthentication
(
...
...
worker/src/RTC/TransportTuple.cpp
浏览文件 @
a393689e
...
@@ -56,27 +56,27 @@ namespace RTC
...
@@ -56,27 +56,27 @@ namespace RTC
Utils
::
IP
::
GetAddressInfo
(
GetRemoteAddress
(),
&
remoteFamily
,
remoteIp
,
&
remotePort
);
Utils
::
IP
::
GetAddressInfo
(
GetRemoteAddress
(),
&
remoteFamily
,
remoteIp
,
&
remotePort
);
MS_D
UMP
(
"<TransportTuple>"
);
MS_D
EBUG_DEV
(
"<TransportTuple>"
);
MS_D
UMP
(
MS_D
EBUG_DEV
(
" [UDP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
" [UDP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
this
->
udpSocket
->
GetLocalIP
().
c_str
(),
this
->
udpSocket
->
GetLocalIP
().
c_str
(),
this
->
udpSocket
->
GetLocalPort
(),
this
->
udpSocket
->
GetLocalPort
(),
remoteIp
.
c_str
(),
remoteIp
.
c_str
(),
remotePort
);
remotePort
);
MS_D
UMP
(
"</TransportTuple>"
);
MS_D
EBUG_DEV
(
"</TransportTuple>"
);
break
;
break
;
}
}
case
Protocol
:
:
TCP
:
case
Protocol
:
:
TCP
:
{
{
MS_D
UMP
(
"<TransportTuple>"
);
MS_D
EBUG_DEV
(
"<TransportTuple>"
);
MS_D
UMP
(
MS_D
EBUG_DEV
(
" [TCP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
" [TCP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
this
->
tcpConnection
->
GetLocalIP
().
c_str
(),
this
->
tcpConnection
->
GetLocalIP
().
c_str
(),
this
->
tcpConnection
->
GetLocalPort
(),
this
->
tcpConnection
->
GetLocalPort
(),
this
->
tcpConnection
->
GetPeerIP
().
c_str
(),
this
->
tcpConnection
->
GetPeerIP
().
c_str
(),
this
->
tcpConnection
->
GetPeerPort
());
this
->
tcpConnection
->
GetPeerPort
());
MS_D
UMP
(
"</TransportTuple>"
);
MS_D
EBUG_DEV
(
"</TransportTuple>"
);
break
;
break
;
}
}
}
}
...
...
worker/src/Settings.cpp
浏览文件 @
a393689e
...
@@ -27,13 +27,15 @@ std::map<std::string, LogLevel> Settings::string2LogLevel =
...
@@ -27,13 +27,15 @@ std::map<std::string, LogLevel> Settings::string2LogLevel =
{
{
{
"debug"
,
LogLevel
::
LOG_DEBUG
},
{
"debug"
,
LogLevel
::
LOG_DEBUG
},
{
"warn"
,
LogLevel
::
LOG_WARN
},
{
"warn"
,
LogLevel
::
LOG_WARN
},
{
"error"
,
LogLevel
::
LOG_ERROR
}
{
"error"
,
LogLevel
::
LOG_ERROR
},
{
"none"
,
LogLevel
::
LOG_NONE
}
};
};
std
::
map
<
LogLevel
,
std
::
string
>
Settings
::
logLevel2String
=
std
::
map
<
LogLevel
,
std
::
string
>
Settings
::
logLevel2String
=
{
{
{
LogLevel
::
LOG_DEBUG
,
"debug"
},
{
LogLevel
::
LOG_DEBUG
,
"debug"
},
{
LogLevel
::
LOG_WARN
,
"warn"
},
{
LogLevel
::
LOG_WARN
,
"warn"
},
{
LogLevel
::
LOG_ERROR
,
"error"
}
{
LogLevel
::
LOG_ERROR
,
"error"
},
{
LogLevel
::
LOG_NONE
,
"none"
}
};
};
// clang-format on
// clang-format on
...
...
worker/src/handles/TcpConnection.cpp
浏览文件 @
a393689e
...
@@ -127,15 +127,15 @@ void TcpConnection::Destroy()
...
@@ -127,15 +127,15 @@ void TcpConnection::Destroy()
void
TcpConnection
::
Dump
()
const
void
TcpConnection
::
Dump
()
const
{
{
MS_D
UMP
(
"<TcpConnection>"
);
MS_D
EBUG_DEV
(
"<TcpConnection>"
);
MS_D
UMP
(
MS_D
EBUG_DEV
(
" [TCP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
", status:%s]"
,
" [TCP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
", status:%s]"
,
this
->
localIP
.
c_str
(),
this
->
localIP
.
c_str
(),
static_cast
<
uint16_t
>
(
this
->
localPort
),
static_cast
<
uint16_t
>
(
this
->
localPort
),
this
->
peerIP
.
c_str
(),
this
->
peerIP
.
c_str
(),
static_cast
<
uint16_t
>
(
this
->
peerPort
),
static_cast
<
uint16_t
>
(
this
->
peerPort
),
(
!
this
->
isClosing
)
?
"open"
:
"closed"
);
(
!
this
->
isClosing
)
?
"open"
:
"closed"
);
MS_D
UMP
(
"</TcpConnection>"
);
MS_D
EBUG_DEV
(
"</TcpConnection>"
);
}
}
void
TcpConnection
::
Start
()
void
TcpConnection
::
Start
()
...
...
worker/src/handles/TcpServer.cpp
浏览文件 @
a393689e
...
@@ -157,14 +157,14 @@ void TcpServer::Destroy()
...
@@ -157,14 +157,14 @@ void TcpServer::Destroy()
void
TcpServer
::
Dump
()
const
void
TcpServer
::
Dump
()
const
{
{
MS_D
UMP
(
"<TcpServer>"
);
MS_D
EBUG_DEV
(
"<TcpServer>"
);
MS_D
UMP
(
MS_D
EBUG_DEV
(
" [TCP, local:%s :%"
PRIu16
", status:%s, connections:%zu]"
,
" [TCP, local:%s :%"
PRIu16
", status:%s, connections:%zu]"
,
this
->
localIP
.
c_str
(),
this
->
localIP
.
c_str
(),
static_cast
<
uint16_t
>
(
this
->
localPort
),
static_cast
<
uint16_t
>
(
this
->
localPort
),
(
!
this
->
isClosing
)
?
"open"
:
"closed"
,
(
!
this
->
isClosing
)
?
"open"
:
"closed"
,
this
->
connections
.
size
());
this
->
connections
.
size
());
MS_D
UMP
(
"</TcpServer>"
);
MS_D
EBUG_DEV
(
"</TcpServer>"
);
}
}
bool
TcpServer
::
SetLocalAddress
()
bool
TcpServer
::
SetLocalAddress
()
...
...
worker/src/handles/UdpSocket.cpp
浏览文件 @
a393689e
...
@@ -170,13 +170,13 @@ void UdpSocket::Destroy()
...
@@ -170,13 +170,13 @@ void UdpSocket::Destroy()
void
UdpSocket
::
Dump
()
const
void
UdpSocket
::
Dump
()
const
{
{
MS_D
UMP
(
"<UdpSocket>"
);
MS_D
EBUG_DEV
(
"<UdpSocket>"
);
MS_D
UMP
(
MS_D
EBUG_DEV
(
" [UDP, local:%s :%"
PRIu16
", status:%s]"
,
" [UDP, local:%s :%"
PRIu16
", status:%s]"
,
this
->
localIP
.
c_str
(),
this
->
localIP
.
c_str
(),
static_cast
<
uint16_t
>
(
this
->
localPort
),
static_cast
<
uint16_t
>
(
this
->
localPort
),
(
!
this
->
isClosing
)
?
"open"
:
"closed"
);
(
!
this
->
isClosing
)
?
"open"
:
"closed"
);
MS_D
UMP
(
"</UdpSocket>"
);
MS_D
EBUG_DEV
(
"</UdpSocket>"
);
}
}
void
UdpSocket
::
Send
(
const
uint8_t
*
data
,
size_t
len
,
const
struct
sockaddr
*
addr
)
void
UdpSocket
::
Send
(
const
uint8_t
*
data
,
size_t
len
,
const
struct
sockaddr
*
addr
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论