Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
05cdd87a
提交
05cdd87a
authored
3月 03, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
worker: Use a new MS_DUMP() for Dump() methods
上级
5c5be6ec
隐藏空白字符变更
内嵌
并排
正在显示
32 个修改的文件
包含
180 行增加
和
209 行删除
+180
-209
Logger.hpp
worker/include/Logger.hpp
+22
-0
DtlsTransport.cpp
worker/src/RTC/DtlsTransport.cpp
+3
-1
Bye.cpp
worker/src/RTC/RTCP/Bye.cpp
+4
-8
CompoundPacket.cpp
worker/src/RTC/RTCP/CompoundPacket.cpp
+2
-6
Feedback.cpp
worker/src/RTC/RTCP/Feedback.cpp
+3
-3
FeedbackPs.cpp
worker/src/RTC/RTCP/FeedbackPs.cpp
+2
-6
FeedbackPsAfb.cpp
worker/src/RTC/RTCP/FeedbackPsAfb.cpp
+2
-6
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
-6
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
-6
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
-6
FeedbackRtpTllei.cpp
worker/src/RTC/RTCP/FeedbackRtpTllei.cpp
+4
-4
FeedbackRtpTmmb.cpp
worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp
+5
-5
Packet.cpp
worker/src/RTC/RTCP/Packet.cpp
+0
-4
ReceiverReport.cpp
worker/src/RTC/RTCP/ReceiverReport.cpp
+13
-17
Sdes.cpp
worker/src/RTC/RTCP/Sdes.cpp
+11
-19
SenderReport.cpp
worker/src/RTC/RTCP/SenderReport.cpp
+11
-15
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+13
-17
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+4
-7
StunMessage.cpp
worker/src/RTC/StunMessage.cpp
+19
-19
Transport.cpp
worker/src/RTC/Transport.cpp
+0
-3
TransportTuple.cpp
worker/src/RTC/TransportTuple.cpp
+6
-6
TcpConnection.cpp
worker/src/handles/TcpConnection.cpp
+3
-1
TcpServer.cpp
worker/src/handles/TcpServer.cpp
+3
-2
UdpSocket.cpp
worker/src/handles/UdpSocket.cpp
+3
-1
没有找到文件。
worker/include/Logger.hpp
浏览文件 @
05cdd87a
...
...
@@ -39,6 +39,10 @@
* Example:
* MS_DEBUG_DEV("Room closed [roomId:%" PRIu32 "]", roomId);
*
* MS_DUMP(...)
*
* For Dump() methods.
*
* MS_ERROR(...)
*
* Logs an error. Must just be used for internal errors that should not
...
...
@@ -265,6 +269,22 @@ public:
#define MS_WARN_DEV_STD(desc, ...) ;
#endif
#define MS_DUMP(desc, ...) \
do \
{ \
int ms_logger_written = std::snprintf(Logger::buffer, MS_LOGGER_BUFFER_SIZE, "D" _MS_LOG_STR_DESC desc, _MS_LOG_ARG, ##__VA_ARGS__); \
Logger::channel->SendLog(Logger::buffer, ms_logger_written); \
} \
while (0)
#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 (0)
#define MS_ERROR(desc, ...) \
do \
{ \
...
...
@@ -311,6 +331,8 @@ public:
#define MS_DEBUG_DEV MS_DEBUG_DEV_STD
#undef MS_WARN_DEV
#define MS_WARN_DEV MS_WARN_DEV_STD
#undef MS_DUMP
#define MS_DUMP MS_DUMP_STD
#undef MS_ERROR
#define MS_ERROR MS_ERROR_STD
#endif
...
...
worker/src/RTC/DtlsTransport.cpp
浏览文件 @
05cdd87a
...
...
@@ -562,11 +562,13 @@ namespace RTC
{
MS_TRACE
();
MS_DEBUG_TAG
(
dtls
,
"[role:%s, running:%s, handshake done:%s, connected:%s]"
,
MS_DUMP
(
"<DtlsTransport>"
);
MS_DUMP
(
" [role:%s, running:%s, handshake done:%s, connected:%s]"
,
(
this
->
localRole
==
Role
::
SERVER
?
"server"
:
(
this
->
localRole
==
Role
::
CLIENT
?
"client"
:
"none"
)),
IsRunning
()
?
"yes"
:
"no"
,
this
->
handshakeDone
?
"yes"
:
"no"
,
this
->
state
==
DtlsState
::
CONNECTED
?
"yes"
:
"no"
);
MS_DUMP
(
"</DtlsTransport>"
);
}
void
DtlsTransport
::
Run
(
Role
localRole
)
...
...
worker/src/RTC/RTCP/Bye.cpp
浏览文件 @
05cdd87a
...
...
@@ -86,19 +86,15 @@ namespace RTC { namespace RTCP
void
ByePacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<ByePacket>"
);
MS_D
UMP
(
"<ByePacket>"
);
for
(
auto
ssrc
:
this
->
ssrcs
)
{
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
ssrc
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
ssrc
);
}
if
(
!
this
->
reason
.
empty
())
MS_DEBUG_DEV
(
" reason : %s"
,
this
->
reason
.
c_str
());
MS_DEBUG_DEV
(
"</ByePacket>"
);
#endif
MS_DUMP
(
" reason : %s"
,
this
->
reason
.
c_str
());
MS_DUMP
(
"</ByePacket>"
);
}
}}
worker/src/RTC/RTCP/CompoundPacket.cpp
浏览文件 @
05cdd87a
...
...
@@ -73,11 +73,9 @@ namespace RTC { namespace RTCP
void
CompoundPacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<CompoundPacket>"
);
MS_D
UMP
(
"<CompoundPacket>"
);
if
(
this
->
senderReportPacket
.
GetCount
())
{
...
...
@@ -101,9 +99,7 @@ namespace RTC { namespace RTCP
if
(
this
->
sdesPacket
.
GetCount
())
this
->
sdesPacket
.
Dump
();
MS_DEBUG_DEV
(
"</CompoundPacket>"
);
#endif
MS_DUMP
(
"</CompoundPacket>"
);
}
void
CompoundPacket
::
AddSenderReport
(
SenderReport
*
report
)
...
...
worker/src/RTC/RTCP/Feedback.cpp
浏览文件 @
05cdd87a
...
...
@@ -83,9 +83,9 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
" sender ssrc : %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
header
->
s_ssrc
));
MS_D
EBUG_DEV
(
" media ssrc : %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
header
->
m_ssrc
));
MS_D
EBUG_DEV
(
" size : %zu"
,
this
->
GetSize
());
MS_D
UMP
(
" sender ssrc : %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
header
->
s_ssrc
));
MS_D
UMP
(
" media ssrc : %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
header
->
m_ssrc
));
MS_D
UMP
(
" size : %zu"
,
this
->
GetSize
());
}
/* Specialization for Ps class. */
...
...
worker/src/RTC/RTCP/FeedbackPs.cpp
浏览文件 @
05cdd87a
...
...
@@ -69,19 +69,15 @@ namespace RTC { namespace RTCP
template
<
typename
Item
>
void
FeedbackPsItemPacket
<
Item
>::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
MS_D
UMP
(
"<%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
FeedbackPsPacket
::
Dump
();
for
(
auto
item
:
this
->
items
)
{
item
->
Dump
();
}
MS_DEBUG_DEV
(
"</%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
#endif
MS_DUMP
(
"</%s>"
,
FeedbackPsPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
}
// explicit instantiation to have all FeedbackRtpPacket definitions in this file.
...
...
worker/src/RTC/RTCP/FeedbackPsAfb.cpp
浏览文件 @
05cdd87a
...
...
@@ -40,14 +40,10 @@ namespace RTC { namespace RTCP
void
FeedbackPsAfbPacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<FeedbackPsAfbPacket>"
);
MS_D
UMP
(
"<FeedbackPsAfbPacket>"
);
FeedbackPsPacket
::
Dump
();
MS_DEBUG_DEV
(
"</FeedbackPsAfbPacket>"
);
#endif
MS_DUMP
(
"</FeedbackPsAfbPacket>"
);
}
}}
worker/src/RTC/RTCP/FeedbackPsFir.cpp
浏览文件 @
05cdd87a
...
...
@@ -56,9 +56,9 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<FirItem>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
"
\t\t
</FirItem>"
);
MS_D
UMP
(
"<FirItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
"
</FirItem>"
);
}
}}
worker/src/RTC/RTCP/FeedbackPsLei.cpp
浏览文件 @
05cdd87a
...
...
@@ -50,8 +50,8 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<PsLeiItem>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
"</PsLeiItem>"
);
MS_D
UMP
(
"<PsLeiItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
"</PsLeiItem>"
);
}
}}
worker/src/RTC/RTCP/FeedbackPsPli.cpp
浏览文件 @
05cdd87a
...
...
@@ -27,14 +27,10 @@ namespace RTC { namespace RTCP
void
FeedbackPsPliPacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<FeedbackPsPliPacket>"
);
MS_D
UMP
(
"<FeedbackPsPliPacket>"
);
FeedbackPsPacket
::
Dump
();
MS_DEBUG_DEV
(
"</FeedbackPsPliPacket>"
);
#endif
MS_DUMP
(
"</FeedbackPsPliPacket>"
);
}
}}
worker/src/RTC/RTCP/FeedbackPsRpsi.cpp
浏览文件 @
05cdd87a
...
...
@@ -95,10 +95,10 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<RpsiItem>"
);
MS_D
EBUG_DEV
(
" padding bits : %"
PRIu8
,
this
->
header
->
padding_bits
);
MS_D
EBUG_DEV
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
EBUG_DEV
(
" length : %zu"
,
this
->
GetLength
());
MS_D
EBUG_DEV
(
"</RpsiItem>"
);
MS_D
UMP
(
"<RpsiItem>"
);
MS_D
UMP
(
" padding bits : %"
PRIu8
,
this
->
header
->
padding_bits
);
MS_D
UMP
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
UMP
(
" length : %zu"
,
this
->
GetLength
());
MS_D
UMP
(
"</RpsiItem>"
);
}
}}
worker/src/RTC/RTCP/FeedbackPsSli.cpp
浏览文件 @
05cdd87a
...
...
@@ -56,11 +56,11 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<SliItem>"
);
MS_D
EBUG_DEV
(
" first : %"
PRIu16
,
this
->
first
);
MS_D
EBUG_DEV
(
" number : %"
PRIu16
,
this
->
number
);
MS_D
EBUG_DEV
(
" picture id : %"
PRIu8
,
this
->
pictureId
);
MS_D
EBUG_DEV
(
"</SliItem>"
);
MS_D
UMP
(
"<SliItem>"
);
MS_D
UMP
(
" first : %"
PRIu16
,
this
->
first
);
MS_D
UMP
(
" number : %"
PRIu16
,
this
->
number
);
MS_D
UMP
(
" picture id : %"
PRIu8
,
this
->
pictureId
);
MS_D
UMP
(
"</SliItem>"
);
}
}}
worker/src/RTC/RTCP/FeedbackPsTst.cpp
浏览文件 @
05cdd87a
...
...
@@ -58,11 +58,11 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<TstItem>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" index : %"
PRIu32
,
this
->
GetIndex
());
MS_D
EBUG_DEV
(
"</TstItem>"
);
MS_D
UMP
(
"<TstItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
" index : %"
PRIu32
,
this
->
GetIndex
());
MS_D
UMP
(
"</TstItem>"
);
}
/* Specialization for Tstr class. */
...
...
worker/src/RTC/RTCP/FeedbackPsVbcm.cpp
浏览文件 @
05cdd87a
...
...
@@ -66,11 +66,11 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<VbcmItem>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
EBUG_DEV
(
" length : %"
PRIu16
,
this
->
GetLength
());
MS_D
EBUG_DEV
(
"</Vbcm
Item>"
);
MS_D
UMP
(
"<VbcmItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" sequence number : %"
PRIu8
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
" payload type : %"
PRIu8
,
this
->
GetPayloadType
());
MS_D
UMP
(
" length : %"
PRIu16
,
this
->
GetLength
());
MS_D
UMP
(
"</Vbcm
Item>"
);
}
}}
worker/src/RTC/RTCP/FeedbackRtp.cpp
浏览文件 @
05cdd87a
...
...
@@ -67,19 +67,15 @@ namespace RTC { namespace RTCP
template
<
typename
Item
>
void
FeedbackRtpItemPacket
<
Item
>::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
MS_D
UMP
(
"<%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
FeedbackRtpPacket
::
Dump
();
for
(
auto
item
:
this
->
items
)
{
item
->
Dump
();
}
MS_DEBUG_DEV
(
"</%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
#endif
MS_DUMP
(
"</%s>"
,
FeedbackRtpPacket
::
MessageType2String
(
Item
::
MessageType
).
c_str
());
}
// Explicit instantiation to have all FeedbackRtpPacket definitions in this file.
...
...
worker/src/RTC/RTCP/FeedbackRtpEcn.cpp
浏览文件 @
05cdd87a
...
...
@@ -40,14 +40,14 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<EcnItem>"
);
MS_D
EBUG_DEV
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
EBUG_DEV
(
" ect0 counter : %"
PRIu32
,
this
->
GetEct0Counter
());
MS_D
EBUG_DEV
(
" ect1 counter : %"
PRIu32
,
this
->
GetEct1Counter
());
MS_D
EBUG_DEV
(
" ecn ce counter : %"
PRIu16
,
this
->
GetEcnCeCounter
());
MS_D
EBUG_DEV
(
" not ect counter : %"
PRIu16
,
this
->
GetNotEctc
ounter
());
MS_D
EBUG_DEV
(
" lost packets : %"
PRIu16
,
this
->
GetLostPackets
());
MS_D
EBUG_DEV
(
" duplicated packets : %"
PRIu16
,
this
->
GetDuplicatedPackets
());
MS_D
EBUG_DEV
(
"</EcnItem>"
);
MS_D
UMP
(
"<EcnItem>"
);
MS_D
UMP
(
" sequence number : %"
PRIu32
,
this
->
GetSequenceNumber
());
MS_D
UMP
(
" ect0 counter : %"
PRIu32
,
this
->
GetEct0Counter
());
MS_D
UMP
(
" ect1 counter : %"
PRIu32
,
this
->
GetEct1Counter
());
MS_D
UMP
(
" ecn ce counter : %"
PRIu16
,
this
->
GetEcnCeCounter
());
MS_D
UMP
(
" not ect counter : %"
PRIu16
,
this
->
GetNotEctC
ounter
());
MS_D
UMP
(
" lost packets : %"
PRIu16
,
this
->
GetLostPackets
());
MS_D
UMP
(
" duplicated packets : %"
PRIu16
,
this
->
GetDuplicatedPackets
());
MS_D
UMP
(
"</EcnItem>"
);
}
}}
worker/src/RTC/RTCP/FeedbackRtpNack.cpp
浏览文件 @
05cdd87a
...
...
@@ -50,9 +50,9 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<NackItem>"
);
MS_D
EBUG_DEV
(
" pid : %"
PRIu16
,
this
->
GetPacketId
());
MS_D
EBUG_DEV
(
" bpl : %"
PRIu16
,
this
->
GetLostPacketBitmask
());
MS_D
EBUG_DEV
(
"</NackItem>"
);
MS_D
UMP
(
"<NackItem>"
);
MS_D
UMP
(
" pid : %"
PRIu16
,
this
->
GetPacketId
());
MS_D
UMP
(
" bpl : %"
PRIu16
,
this
->
GetLostPacketBitmask
());
MS_D
UMP
(
"</NackItem>"
);
}
}}
worker/src/RTC/RTCP/FeedbackRtpSrReq.cpp
浏览文件 @
05cdd87a
...
...
@@ -26,14 +26,10 @@ namespace RTC { namespace RTCP
void
FeedbackRtpSrReqPacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<FeedbackRtpSrReqPacket>"
);
MS_D
UMP
(
"<FeedbackRtpSrReqPacket>"
);
FeedbackRtpPacket
::
Dump
();
MS_DEBUG_DEV
(
"</FeedbackRtpSrReqPacket>"
);
#endif
MS_DUMP
(
"</FeedbackRtpSrReqPacket>"
);
}
}}
worker/src/RTC/RTCP/FeedbackRtpTllei.cpp
浏览文件 @
05cdd87a
...
...
@@ -50,9 +50,9 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<TlleiItem>"
);
MS_D
EBUG_DEV
(
" pid: %"
PRIu16
,
this
->
GetPacketId
());
MS_D
EBUG_DEV
(
" bpl: %"
PRIu16
,
this
->
GetLostPacketBitmask
());
MS_D
EBUG_DEV
(
"</TlleiItem>"
);
MS_D
UMP
(
"<TlleiItem>"
);
MS_D
UMP
(
" pid: %"
PRIu16
,
this
->
GetPacketId
());
MS_D
UMP
(
" bpl: %"
PRIu16
,
this
->
GetLostPacketBitmask
());
MS_D
UMP
(
"</TlleiItem>"
);
}
}}
worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp
浏览文件 @
05cdd87a
...
...
@@ -81,11 +81,11 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<TmmbItem>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" bitrate : %"
PRIu64
,
this
->
GetBitrate
());
MS_D
EBUG_DEV
(
" overhead : %"
PRIu16
,
this
->
GetOverhead
());
MS_D
EBUG_DEV
(
"</TmmbItem>"
);
MS_D
UMP
(
"<TmmbItem>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" bitrate : %"
PRIu64
,
this
->
GetBitrate
());
MS_D
UMP
(
" overhead : %"
PRIu16
,
this
->
GetOverhead
());
MS_D
UMP
(
"</TmmbItem>"
);
}
/* Specialization for Tmmbr class. */
...
...
worker/src/RTC/RTCP/Packet.cpp
浏览文件 @
05cdd87a
...
...
@@ -134,10 +134,6 @@ namespace RTC { namespace RTCP
return
first
;
}
#ifdef MS_LOG_DEV
// current->Dump();
#endif
data
+=
packet_len
;
len
-=
packet_len
;
...
...
worker/src/RTC/RTCP/ReceiverReport.cpp
浏览文件 @
05cdd87a
#define MS_CLASS "RTC::RTCP::ReceiverReport"
//
#define MS_LOG_DEV
#define MS_LOG_DEV
#include "RTC/RTCP/ReceiverReport.hpp"
#include "Utils.hpp"
...
...
@@ -34,15 +34,15 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<ReceiverReport>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" fraction lost : %"
PRIu32
,
this
->
GetFractionLost
());
MS_D
EBUG_DEV
(
" total lost : %"
PRIu32
,
this
->
GetTotalLost
());
MS_D
EBUG_DEV
(
" last seq : %"
PRIu32
,
this
->
GetLastSeq
());
MS_D
EBUG_DEV
(
" jitter : %"
PRIu32
,
this
->
GetJitter
());
MS_D
EBUG_DEV
(
" lsr : %"
PRIu32
,
this
->
GetLastSenderReport
());
MS_D
EBUG_DEV
(
" dlsr : %"
PRIu32
,
this
->
GetDelaySinceLastSenderReport
());
MS_D
EBUG_DEV
(
"</ReceiverReport>"
);
MS_D
UMP
(
"<ReceiverReport>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" fraction lost : %"
PRIu32
,
this
->
GetFractionLost
());
MS_D
UMP
(
" total lost : %"
PRIu32
,
this
->
GetTotalLost
());
MS_D
UMP
(
" last seq : %"
PRIu32
,
this
->
GetLastSeq
());
MS_D
UMP
(
" jitter : %"
PRIu32
,
this
->
GetJitter
());
MS_D
UMP
(
" lsr : %"
PRIu32
,
this
->
GetLastSenderReport
());
MS_D
UMP
(
" dlsr : %"
PRIu32
,
this
->
GetDelaySinceLastSenderReport
());
MS_D
UMP
(
"</ReceiverReport>"
);
}
size_t
ReceiverReport
::
Serialize
(
uint8_t
*
buffer
)
...
...
@@ -119,16 +119,12 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
#ifdef MS_LOG_DEV
MS_DEBUG_DEV
(
"<ReceiverReportPacket>"
);
MS_DEBUG_DEV
(
" ssrc: %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
ssrc
));
MS_DUMP
(
"<ReceiverReportPacket>"
);
MS_DUMP
(
" ssrc: %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
ssrc
));
for
(
auto
report
:
this
->
reports
)
{
report
->
Dump
();
}
MS_DEBUG_DEV
(
"</ReceiverReportPacket>"
);
#endif
MS_DUMP
(
"</ReceiverReportPacket>"
);
}
}}
worker/src/RTC/RTCP/Sdes.cpp
浏览文件 @
05cdd87a
#define MS_CLASS "RTC::RTCP::Sdes"
//
#define MS_LOG_DEV
#define MS_LOG_DEV
#include "RTC/RTCP/Sdes.hpp"
#include "Utils.hpp"
...
...
@@ -76,11 +76,11 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<SdesItem>"
);
MS_D
EBUG_DEV
(
" type : %s"
,
Type2String
(
this
->
GetType
()).
c_str
());
MS_D
EBUG_DEV
(
" length : %"
PRIu8
,
this
->
header
->
length
);
MS_D
EBUG_DEV
(
" value : %.*s"
,
this
->
header
->
length
,
this
->
header
->
value
);
MS_D
EBUG_DEV
(
"</SdesItem>"
);
MS_D
UMP
(
"<SdesItem>"
);
MS_D
UMP
(
" type : %s"
,
Type2String
(
this
->
GetType
()).
c_str
());
MS_D
UMP
(
" length : %"
PRIu8
,
this
->
header
->
length
);
MS_D
UMP
(
" value : %.*s"
,
this
->
header
->
length
,
this
->
header
->
value
);
MS_D
UMP
(
"</SdesItem>"
);
}
size_t
SdesItem
::
Serialize
(
uint8_t
*
buffer
)
...
...
@@ -161,19 +161,15 @@ namespace RTC { namespace RTCP
void
SdesChunk
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<SdesChunk>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
ssrc
));
MS_D
UMP
(
"<SdesChunk>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
(
uint32_t
)
ntohl
(
this
->
ssrc
));
for
(
auto
item
:
this
->
items
)
{
item
->
Dump
();
}
MS_DEBUG_DEV
(
"</SdesChunk>"
);
#endif
MS_DUMP
(
"</SdesChunk>"
);
}
/* Class methods. */
...
...
@@ -223,17 +219,13 @@ namespace RTC { namespace RTCP
void
SdesPacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<SdesPacket>"
);
MS_D
UMP
(
"<SdesPacket>"
);
for
(
auto
chunk
:
this
->
chunks
)
{
chunk
->
Dump
();
}
MS_DEBUG_DEV
(
"</SdesPacket>"
);
#endif
MS_DUMP
(
"</SdesPacket>"
);
}
}}
worker/src/RTC/RTCP/SenderReport.cpp
浏览文件 @
05cdd87a
#define MS_CLASS "RTC::RTCP::SenderReport"
//
#define MS_LOG_DEV
#define MS_LOG_DEV
#include "RTC/RTCP/SenderReport.hpp"
#include "Logger.hpp"
...
...
@@ -33,14 +33,14 @@ namespace RTC { namespace RTCP
{
MS_TRACE
();
MS_D
EBUG_DEV
(
"<SenderReport>"
);
MS_D
EBUG_DEV
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
EBUG_DEV
(
" ntp sec : %"
PRIu32
,
this
->
GetNtpSec
());
MS_D
EBUG_DEV
(
" ntp frac : %"
PRIu32
,
this
->
GetNtpFrac
());
MS_D
EBUG_DEV
(
" rtp ts : %"
PRIu32
,
this
->
GetRtpTs
());
MS_D
EBUG_DEV
(
" packet count : %"
PRIu32
,
this
->
GetPacketCount
());
MS_D
EBUG_DEV
(
" octet count : %"
PRIu32
,
this
->
GetOctetCount
());
MS_D
EBUG_DEV
(
"</SenderReport>"
);
MS_D
UMP
(
"<SenderReport>"
);
MS_D
UMP
(
" ssrc : %"
PRIu32
,
this
->
GetSsrc
());
MS_D
UMP
(
" ntp sec : %"
PRIu32
,
this
->
GetNtpSec
());
MS_D
UMP
(
" ntp frac : %"
PRIu32
,
this
->
GetNtpFrac
());
MS_D
UMP
(
" rtp ts : %"
PRIu32
,
this
->
GetRtpTs
());
MS_D
UMP
(
" packet count : %"
PRIu32
,
this
->
GetPacketCount
());
MS_D
UMP
(
" octet count : %"
PRIu32
,
this
->
GetOctetCount
());
MS_D
UMP
(
"</SenderReport>"
);
}
size_t
SenderReport
::
Serialize
(
uint8_t
*
buffer
)
...
...
@@ -92,17 +92,13 @@ namespace RTC { namespace RTCP
void
SenderReportPacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<SenderReportPacket>"
);
MS_D
UMP
(
"<SenderReportPacket>"
);
for
(
auto
report
:
this
->
reports
)
{
report
->
Dump
();
}
MS_DEBUG_DEV
(
"</SenderReportPacket>"
);
#endif
MS_DUMP
(
"</SenderReportPacket>"
);
}
}}
worker/src/RTC/RtpPacket.cpp
浏览文件 @
05cdd87a
...
...
@@ -144,28 +144,24 @@ namespace RTC
void
RtpPacket
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<RtpPacket>"
);
MS_D
EBUG_DEV
(
" padding : %s"
,
this
->
header
->
padding
?
"true"
:
"false"
);
MS_D
EBUG_DEV
(
" extension header : %s"
,
HasExtensionHeader
()
?
"true"
:
"false"
);
MS_D
UMP
(
"<RtpPacket>"
);
MS_D
UMP
(
" padding : %s"
,
this
->
header
->
padding
?
"true"
:
"false"
);
MS_D
UMP
(
" extension header : %s"
,
HasExtensionHeader
()
?
"true"
:
"false"
);
if
(
HasExtensionHeader
())
{
MS_D
EBUG_DEV
(
" id : %"
PRIu16
,
GetExtensionHeaderId
());
MS_D
EBUG_DEV
(
" length : %zu bytes"
,
GetExtensionHeaderLength
());
MS_D
UMP
(
" id : %"
PRIu16
,
GetExtensionHeaderId
());
MS_D
UMP
(
" length : %zu bytes"
,
GetExtensionHeaderLength
());
}
MS_DEBUG_DEV
(
" csrc count : %"
PRIu8
,
this
->
header
->
csrc_count
);
MS_DEBUG_DEV
(
" marker : %s"
,
HasMarker
()
?
"true"
:
"false"
);
MS_DEBUG_DEV
(
" payload type : %"
PRIu8
,
GetPayloadType
());
MS_DEBUG_DEV
(
" sequence number : %"
PRIu16
,
GetSequenceNumber
());
MS_DEBUG_DEV
(
" timestamp : %"
PRIu32
,
GetTimestamp
());
MS_DEBUG_DEV
(
" ssrc : %"
PRIu32
,
GetSsrc
());
MS_DEBUG_DEV
(
" payload size : %zu bytes"
,
GetPayloadLength
());
MS_DEBUG_DEV
(
"</RtpPacket>"
);
#endif
MS_DUMP
(
" csrc count : %"
PRIu8
,
this
->
header
->
csrc_count
);
MS_DUMP
(
" marker : %s"
,
HasMarker
()
?
"true"
:
"false"
);
MS_DUMP
(
" payload type : %"
PRIu8
,
GetPayloadType
());
MS_DUMP
(
" sequence number : %"
PRIu16
,
GetSequenceNumber
());
MS_DUMP
(
" timestamp : %"
PRIu32
,
GetTimestamp
());
MS_DUMP
(
" ssrc : %"
PRIu32
,
GetSsrc
());
MS_DUMP
(
" payload size : %zu bytes"
,
GetPayloadLength
());
MS_DUMP
(
"</RtpPacket>"
);
}
void
RtpPacket
::
ParseExtensionElements
()
...
...
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
05cdd87a
...
...
@@ -299,18 +299,15 @@ namespace RTC
{
MS_TRACE
();
MS_DEBUG_TAG
(
rtp
,
"<RtpStreamSend>"
);
MS_DEBUG_TAG
(
rtp
,
" [buffer.size:%zu, storage.size:%zu]"
,
this
->
buffer
.
size
(),
this
->
storage
.
size
());
MS_DUMP
(
"<RtpStreamSend>"
);
MS_DUMP
(
" [buffer.size:%zu, storage.size:%zu]"
,
this
->
buffer
.
size
(),
this
->
storage
.
size
());
for
(
auto
&
buffer_item
:
this
->
buffer
)
{
auto
packet
=
buffer_item
.
packet
;
MS_D
EBUG_TAG
(
rtp
,
" packet [seq:%"
PRIu16
", seq32:%"
PRIu32
"]"
,
packet
->
GetSequenceNumber
(),
buffer_item
.
seq32
);
MS_D
UMP
(
" packet [seq:%"
PRIu16
", seq32:%"
PRIu32
"]"
,
packet
->
GetSequenceNumber
(),
buffer_item
.
seq32
);
}
MS_DEBUG_TAG
(
rtp
,
"</RtpStreamSend>"
);
MS_DUMP
(
"</RtpStreamSend>"
);
}
RTC
::
RTCP
::
SenderReport
*
RtpStreamSend
::
GetRtcpSenderReport
(
uint64_t
now
)
...
...
worker/src/RTC/StunMessage.cpp
浏览文件 @
05cdd87a
...
...
@@ -242,11 +242,9 @@ namespace RTC
void
StunMessage
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
MS_D
EBUG_DEV
(
"<StunMessage>"
);
MS_D
UMP
(
"<StunMessage>"
);
std
::
string
klass
;
switch
(
this
->
klass
)
...
...
@@ -257,30 +255,34 @@ namespace RTC
case
Class
:
:
ErrorResponse
:
klass
=
"ErrorResponse"
;
break
;
}
if
(
this
->
method
==
Method
::
Binding
)
MS_DEBUG_DEV
(
" Binding %s"
,
klass
.
c_str
());
{
MS_DUMP
(
" Binding %s"
,
klass
.
c_str
());
}
else
{
// This prints the unknown method number. Example: TURN Allocate => 0x003.
MS_DEBUG_DEV
(
" %s with unknown method %#.3x"
,
klass
.
c_str
(),
(
uint16_t
)
this
->
method
);
MS_DEBUG_DEV
(
" size: %zu bytes"
,
this
->
size
);
MS_DUMP
(
" %s with unknown method %#.3x"
,
klass
.
c_str
(),
(
uint16_t
)
this
->
method
);
}
MS_DUMP
(
" size: %zu bytes"
,
this
->
size
);
char
transaction_id
[
25
];
for
(
int
i
=
0
;
i
<
12
;
++
i
)
{
// NOTE: n must be 3 because snprintf adds a \0 after printed chars.
std
::
snprintf
(
transaction_id
+
(
i
*
2
),
3
,
"%.2x"
,
this
->
transactionId
[
i
]);
}
MS_D
EBUG_DEV
(
" transactionId: %s"
,
transaction_id
);
MS_D
UMP
(
" transactionId: %s"
,
transaction_id
);
if
(
this
->
errorCode
)
MS_D
EBUG_DEV
(
" errorCode: %"
PRIu16
,
this
->
errorCode
);
MS_D
UMP
(
" errorCode: %"
PRIu16
,
this
->
errorCode
);
if
(
!
this
->
username
.
empty
())
MS_D
EBUG_DEV
(
" username: %s"
,
this
->
username
.
c_str
());
MS_D
UMP
(
" username: %s"
,
this
->
username
.
c_str
());
if
(
this
->
priority
)
MS_D
EBUG_DEV
(
" priority: %"
PRIu32
,
this
->
priority
);
MS_D
UMP
(
" priority: %"
PRIu32
,
this
->
priority
);
if
(
this
->
iceControlling
)
MS_D
EBUG_DEV
(
" iceControlling: %"
PRIu64
,
this
->
iceControlling
);
MS_D
UMP
(
" iceControlling: %"
PRIu64
,
this
->
iceControlling
);
if
(
this
->
iceControlled
)
MS_D
EBUG_DEV
(
" iceControlled: %"
PRIu64
,
this
->
iceControlled
);
MS_D
UMP
(
" iceControlled: %"
PRIu64
,
this
->
iceControlled
);
if
(
this
->
hasUseCandidate
)
MS_D
EBUG_DEV
(
" useCandidate"
);
MS_D
UMP
(
" useCandidate"
);
if
(
this
->
xorMappedAddress
)
{
int
family
;
...
...
@@ -288,7 +290,7 @@ namespace RTC
std
::
string
ip
;
Utils
::
IP
::
GetAddressInfo
(
this
->
xorMappedAddress
,
&
family
,
ip
,
&
port
);
MS_D
EBUG_DEV
(
" xorMappedAddress: %s : %"
PRIu16
,
ip
.
c_str
(),
port
);
MS_D
UMP
(
" xorMappedAddress: %s : %"
PRIu16
,
ip
.
c_str
(),
port
);
}
if
(
this
->
messageIntegrity
)
{
...
...
@@ -298,14 +300,12 @@ namespace RTC
std
::
snprintf
(
message_integrity
+
(
i
*
2
),
3
,
"%.2x"
,
this
->
messageIntegrity
[
i
]);
}
MS_D
EBUG_DEV
(
" messageIntegrity: %s"
,
message_integrity
);
MS_D
UMP
(
" messageIntegrity: %s"
,
message_integrity
);
}
if
(
this
->
hasFingerprint
)
MS_DEBUG_DEV
(
" fingerprint"
);
MS_DEBUG_DEV
(
"</StunMessage>"
);
MS_DUMP
(
" fingerprint"
);
#endif
MS_DUMP
(
"</StunMessage>"
);
}
StunMessage
::
Authentication
StunMessage
::
CheckAuthentication
(
const
std
::
string
&
local_username
,
const
std
::
string
&
local_password
)
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
05cdd87a
...
...
@@ -756,9 +756,6 @@ namespace RTC
}
MS_DEBUG_DEV
(
"valid RTP packet received [ssrc:%"
PRIu32
", payloadType:%"
PRIu8
", rtpReceiver:%"
PRIu32
"]"
,
packet
->
GetSsrc
(),
packet
->
GetPayloadType
(),
rtpReceiver
->
rtpReceiverId
);
#ifdef MS_LOG_DEV
// packet->Dump();
#endif
// Trick for clients performing aggressive ICE regardless we are ICE-Lite.
this
->
iceServer
->
ForceSelectedTuple
(
tuple
);
...
...
worker/src/RTC/TransportTuple.cpp
浏览文件 @
05cdd87a
...
...
@@ -44,8 +44,6 @@ namespace RTC
void
TransportTuple
::
Dump
()
{
#ifdef MS_LOG_DEV
MS_TRACE
();
switch
(
this
->
protocol
)
...
...
@@ -58,21 +56,23 @@ namespace RTC
Utils
::
IP
::
GetAddressInfo
(
GetRemoteAddress
(),
&
remote_family
,
remote_ip
,
&
remote_port
);
MS_DEBUG_DEV
(
"[UDP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
MS_DUMP
(
"<TransportTuple>"
);
MS_DUMP
(
" [UDP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
this
->
udpSocket
->
GetLocalIP
().
c_str
(),
this
->
udpSocket
->
GetLocalPort
(),
remote_ip
.
c_str
(),
remote_port
);
MS_DUMP
(
"</TransportTuple>"
);
break
;
}
case
Protocol
:
:
TCP
:
{
MS_DEBUG_DEV
(
"[TCP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
MS_DUMP
(
"<TransportTuple>"
);
MS_DUMP
(
" [TCP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
"]"
,
this
->
tcpConnection
->
GetLocalIP
().
c_str
(),
this
->
tcpConnection
->
GetLocalPort
(),
this
->
tcpConnection
->
GetPeerIP
().
c_str
(),
this
->
tcpConnection
->
GetPeerPort
());
MS_DUMP
(
"</TransportTuple>"
);
break
;
}
}
#endif
}
}
worker/src/handles/TcpConnection.cpp
浏览文件 @
05cdd87a
...
...
@@ -133,10 +133,12 @@ void TcpConnection::Close()
void
TcpConnection
::
Dump
()
{
MS_DEBUG_DEV
(
"[Tcp, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
", status:%s]"
,
MS_DUMP
(
"<TcpConnection>"
);
MS_DUMP
(
" [TCP, local:%s :%"
PRIu16
", remote:%s :%"
PRIu16
", status:%s]"
,
this
->
localIP
.
c_str
(),
(
uint16_t
)
this
->
localPort
,
this
->
peerIP
.
c_str
(),
(
uint16_t
)
this
->
peerPort
,
(
!
this
->
isClosing
)
?
"open"
:
"closed"
);
MS_DUMP
(
"</TcpConnection>"
);
}
void
TcpConnection
::
Start
()
...
...
worker/src/handles/TcpServer.cpp
浏览文件 @
05cdd87a
...
...
@@ -154,10 +154,12 @@ void TcpServer::Close()
void
TcpServer
::
Dump
()
{
MS_DEBUG_DEV
(
"[TCP, local:%s :%"
PRIu16
", status:%s, connections:%zu]"
,
MS_DUMP
(
"<TcpServer>"
);
MS_DUMP
(
" [TCP, local:%s :%"
PRIu16
", status:%s, connections:%zu]"
,
this
->
localIP
.
c_str
(),
(
uint16_t
)
this
->
localPort
,
(
!
this
->
isClosing
)
?
"open"
:
"closed"
,
this
->
connections
.
size
());
MS_DUMP
(
"</TcpServer>"
);
}
const
struct
sockaddr
*
TcpServer
::
GetLocalAddress
()
...
...
@@ -292,7 +294,6 @@ void TcpServer::onTcpConnectionClosed(TcpConnection* connection, bool is_closed_
bool
wasClosing
=
this
->
isClosing
;
MS_DEBUG_DEV
(
"TCP connection closed"
);
connection
->
Dump
();
// Remove the TcpConnection from the set.
this
->
connections
.
erase
(
connection
);
...
...
worker/src/handles/UdpSocket.cpp
浏览文件 @
05cdd87a
...
...
@@ -172,9 +172,11 @@ void UdpSocket::Close()
void
UdpSocket
::
Dump
()
{
MS_DEBUG_DEV
(
"[UDP, local:%s :%"
PRIu16
", status:%s]"
,
MS_DUMP
(
"<UdpSocket>"
);
MS_DUMP
(
" [UDP, local:%s :%"
PRIu16
", status:%s]"
,
this
->
localIP
.
c_str
(),
(
uint16_t
)
this
->
localPort
,
(
!
this
->
isClosing
)
?
"open"
:
"closed"
);
MS_DUMP
(
"</UdpSocket>"
);
}
void
UdpSocket
::
Send
(
const
uint8_t
*
data
,
size_t
len
,
const
struct
sockaddr
*
addr
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论