Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
22900858
提交
22900858
authored
9月 03, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clang-format: Use 2 spaces for indentation instead of 4
上级
7fc6a08a
显示空白字符变更
内嵌
并排
正在显示
81 个修改的文件
包含
73 行增加
和
105 行删除
+73
-105
.clang-format
worker/.clang-format
+2
-2
Notifier.hpp
worker/include/Channel/Notifier.hpp
+0
-0
Consumer.hpp
worker/include/RTC/Consumer.hpp
+0
-0
DtlsTransport.hpp
worker/include/RTC/DtlsTransport.hpp
+0
-0
IceServer.hpp
worker/include/RTC/IceServer.hpp
+0
-0
NackGenerator.hpp
worker/include/RTC/NackGenerator.hpp
+0
-0
Parameters.hpp
worker/include/RTC/Parameters.hpp
+0
-0
Peer.hpp
worker/include/RTC/Peer.hpp
+0
-0
Producer.hpp
worker/include/RTC/Producer.hpp
+0
-0
FeedbackPs.hpp
worker/include/RTC/RTCP/FeedbackPs.hpp
+0
-0
FeedbackPsAfb.hpp
worker/include/RTC/RTCP/FeedbackPsAfb.hpp
+0
-0
FeedbackPsPli.hpp
worker/include/RTC/RTCP/FeedbackPsPli.hpp
+0
-0
FeedbackPsRemb.hpp
worker/include/RTC/RTCP/FeedbackPsRemb.hpp
+0
-0
FeedbackPsVbcm.hpp
worker/include/RTC/RTCP/FeedbackPsVbcm.hpp
+0
-0
FeedbackRtp.hpp
worker/include/RTC/RTCP/FeedbackRtp.hpp
+0
-0
FeedbackRtpNack.hpp
worker/include/RTC/RTCP/FeedbackRtpNack.hpp
+0
-0
FeedbackRtpSrReq.hpp
worker/include/RTC/RTCP/FeedbackRtpSrReq.hpp
+0
-0
FeedbackRtpTllei.hpp
worker/include/RTC/RTCP/FeedbackRtpTllei.hpp
+0
-0
Packet.hpp
worker/include/RTC/RTCP/Packet.hpp
+0
-0
AimdRateControl.hpp
...er/include/RTC/RemoteBitrateEstimator/AimdRateControl.hpp
+0
-0
InterArrival.hpp
worker/include/RTC/RemoteBitrateEstimator/InterArrival.hpp
+0
-0
OveruseEstimator.hpp
...r/include/RTC/RemoteBitrateEstimator/OveruseEstimator.hpp
+0
-0
RateControlInput.hpp
...r/include/RTC/RemoteBitrateEstimator/RateControlInput.hpp
+0
-0
RemoteBitrateEstimator.hpp
...ude/RTC/RemoteBitrateEstimator/RemoteBitrateEstimator.hpp
+0
-0
RemoteBitrateEstimatorAbsSendTime.hpp
...oteBitrateEstimator/RemoteBitrateEstimatorAbsSendTime.hpp
+0
-0
RemoteBitrateEstimatorSingleStream.hpp
...teBitrateEstimator/RemoteBitrateEstimatorSingleStream.hpp
+0
-0
Router.hpp
worker/include/RTC/Router.hpp
+0
-0
RtpDataCounter.hpp
worker/include/RTC/RtpDataCounter.hpp
+0
-0
RtpListener.hpp
worker/include/RTC/RtpListener.hpp
+0
-0
RtpPacket.hpp
worker/include/RTC/RtpPacket.hpp
+0
-0
RtpStreamRecv.hpp
worker/include/RTC/RtpStreamRecv.hpp
+0
-0
RtpStreamSend.hpp
worker/include/RTC/RtpStreamSend.hpp
+0
-0
StunMessage.hpp
worker/include/RTC/StunMessage.hpp
+0
-0
TcpServer.hpp
worker/include/RTC/TcpServer.hpp
+0
-0
Transport.hpp
worker/include/RTC/Transport.hpp
+5
-8
TransportTuple.hpp
worker/include/RTC/TransportTuple.hpp
+0
-0
UdpSocket.hpp
worker/include/RTC/UdpSocket.hpp
+1
-4
Utils.hpp
worker/include/Utils.hpp
+3
-9
TcpConnection.hpp
worker/include/handles/TcpConnection.hpp
+0
-0
Notifier.cpp
worker/src/Channel/Notifier.cpp
+0
-0
UnixStreamSocket.cpp
worker/src/Channel/UnixStreamSocket.cpp
+2
-2
Consumer.cpp
worker/src/RTC/Consumer.cpp
+0
-0
DtlsTransport.cpp
worker/src/RTC/DtlsTransport.cpp
+4
-6
IceCandidate.cpp
worker/src/RTC/IceCandidate.cpp
+0
-0
IceServer.cpp
worker/src/RTC/IceServer.cpp
+0
-0
NackGenerator.cpp
worker/src/RTC/NackGenerator.cpp
+1
-2
Peer.cpp
worker/src/RTC/Peer.cpp
+0
-0
Producer.cpp
worker/src/RTC/Producer.cpp
+3
-3
CompoundPacket.cpp
worker/src/RTC/RTCP/CompoundPacket.cpp
+0
-0
Feedback.cpp
worker/src/RTC/RTCP/Feedback.cpp
+1
-3
FeedbackPs.cpp
worker/src/RTC/RTCP/FeedbackPs.cpp
+0
-0
FeedbackPsRemb.cpp
worker/src/RTC/RTCP/FeedbackPsRemb.cpp
+1
-2
FeedbackPsRpsi.cpp
worker/src/RTC/RTCP/FeedbackPsRpsi.cpp
+0
-0
FeedbackPsTst.cpp
worker/src/RTC/RTCP/FeedbackPsTst.cpp
+0
-0
FeedbackPsVbcm.cpp
worker/src/RTC/RTCP/FeedbackPsVbcm.cpp
+0
-0
FeedbackRtp.cpp
worker/src/RTC/RTCP/FeedbackRtp.cpp
+0
-0
FeedbackRtpTmmb.cpp
worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp
+0
-0
Packet.cpp
worker/src/RTC/RTCP/Packet.cpp
+0
-0
ReceiverReport.cpp
worker/src/RTC/RTCP/ReceiverReport.cpp
+0
-0
AimdRateControl.cpp
worker/src/RTC/RemoteBitrateEstimator/AimdRateControl.cpp
+3
-4
InterArrival.cpp
worker/src/RTC/RemoteBitrateEstimator/InterArrival.cpp
+0
-0
OveruseEstimator.cpp
worker/src/RTC/RemoteBitrateEstimator/OveruseEstimator.cpp
+4
-3
RemoteBitrateEstimatorAbsSendTime.cpp
...oteBitrateEstimator/RemoteBitrateEstimatorAbsSendTime.cpp
+5
-4
RemoteBitrateEstimatorSingleStream.cpp
...teBitrateEstimator/RemoteBitrateEstimatorSingleStream.cpp
+2
-1
Router.cpp
worker/src/RTC/Router.cpp
+0
-0
Parameters.cpp
worker/src/RTC/RtpDictionaries/Parameters.cpp
+0
-0
RtpParameters.cpp
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
+1
-2
RtpListener.cpp
worker/src/RTC/RtpListener.cpp
+2
-1
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+0
-0
RtpStream.cpp
worker/src/RTC/RtpStream.cpp
+0
-0
RtpStreamRecv.cpp
worker/src/RTC/RtpStreamRecv.cpp
+5
-6
RtpStreamSend.cpp
worker/src/RTC/RtpStreamSend.cpp
+0
-0
SrtpSession.cpp
worker/src/RTC/SrtpSession.cpp
+0
-0
StunMessage.cpp
worker/src/RTC/StunMessage.cpp
+4
-4
TcpConnection.cpp
worker/src/RTC/TcpConnection.cpp
+0
-0
TcpServer.cpp
worker/src/RTC/TcpServer.cpp
+3
-9
Transport.cpp
worker/src/RTC/Transport.cpp
+14
-13
TransportTuple.cpp
worker/src/RTC/TransportTuple.cpp
+0
-0
UdpSocket.cpp
worker/src/RTC/UdpSocket.cpp
+3
-9
Settings.cpp
worker/src/Settings.cpp
+3
-4
Crypto.cpp
worker/src/Utils/Crypto.cpp
+1
-4
没有找到文件。
worker/.clang-format
浏览文件 @
22900858
...
@@ -37,8 +37,8 @@ BreakStringLiterals: false
...
@@ -37,8 +37,8 @@ BreakStringLiterals: false
ColumnLimit: 100
ColumnLimit: 100
CommentPragmas: 'NOLINT'
CommentPragmas: 'NOLINT'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth:
4
ConstructorInitializerIndentWidth:
2
ContinuationIndentWidth:
4
ContinuationIndentWidth:
2
Cpp11BracedListStyle: false
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DerivePointerAlignment: false
DisableFormat: false
DisableFormat: false
...
...
worker/include/Channel/Notifier.hpp
浏览文件 @
22900858
worker/include/RTC/Consumer.hpp
浏览文件 @
22900858
worker/include/RTC/DtlsTransport.hpp
浏览文件 @
22900858
worker/include/RTC/IceServer.hpp
浏览文件 @
22900858
worker/include/RTC/NackGenerator.hpp
浏览文件 @
22900858
worker/include/RTC/Parameters.hpp
浏览文件 @
22900858
worker/include/RTC/Peer.hpp
浏览文件 @
22900858
worker/include/RTC/Producer.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackPs.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackPsAfb.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackPsPli.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackPsRemb.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackPsVbcm.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackRtp.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackRtpNack.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackRtpSrReq.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/FeedbackRtpTllei.hpp
浏览文件 @
22900858
worker/include/RTC/RTCP/Packet.hpp
浏览文件 @
22900858
worker/include/RTC/RemoteBitrateEstimator/AimdRateControl.hpp
浏览文件 @
22900858
worker/include/RTC/RemoteBitrateEstimator/InterArrival.hpp
浏览文件 @
22900858
worker/include/RTC/RemoteBitrateEstimator/OveruseEstimator.hpp
浏览文件 @
22900858
worker/include/RTC/RemoteBitrateEstimator/RateControlInput.hpp
浏览文件 @
22900858
worker/include/RTC/RemoteBitrateEstimator/RemoteBitrateEstimator.hpp
浏览文件 @
22900858
worker/include/RTC/RemoteBitrateEstimator/RemoteBitrateEstimatorAbsSendTime.hpp
浏览文件 @
22900858
worker/include/RTC/RemoteBitrateEstimator/RemoteBitrateEstimatorSingleStream.hpp
浏览文件 @
22900858
worker/include/RTC/Router.hpp
浏览文件 @
22900858
worker/include/RTC/RtpDataCounter.hpp
浏览文件 @
22900858
worker/include/RTC/RtpListener.hpp
浏览文件 @
22900858
worker/include/RTC/RtpPacket.hpp
浏览文件 @
22900858
worker/include/RTC/RtpStreamRecv.hpp
浏览文件 @
22900858
worker/include/RTC/RtpStreamSend.hpp
浏览文件 @
22900858
worker/include/RTC/StunMessage.hpp
浏览文件 @
22900858
worker/include/RTC/TcpServer.hpp
浏览文件 @
22900858
worker/include/RTC/Transport.hpp
浏览文件 @
22900858
...
@@ -84,10 +84,7 @@ namespace RTC
...
@@ -84,10 +84,7 @@ namespace RTC
/* Pure virtual methods inherited from RTC::UdpSocket::Listener. */
/* Pure virtual methods inherited from RTC::UdpSocket::Listener. */
public
:
public
:
void
OnPacketRecv
(
void
OnPacketRecv
(
RTC
::
UdpSocket
*
socket
,
RTC
::
UdpSocket
*
socket
,
const
uint8_t
*
data
,
size_t
len
,
const
struct
sockaddr
*
remoteAddr
)
override
;
const
uint8_t
*
data
,
size_t
len
,
const
struct
sockaddr
*
remoteAddr
)
override
;
/* Pure virtual methods inherited from RTC::TcpServer::Listener. */
/* Pure virtual methods inherited from RTC::TcpServer::Listener. */
public
:
public
:
...
@@ -101,9 +98,7 @@ namespace RTC
...
@@ -101,9 +98,7 @@ namespace RTC
/* Pure virtual methods inherited from RTC::IceServer::Listener. */
/* Pure virtual methods inherited from RTC::IceServer::Listener. */
public
:
public
:
void
OnOutgoingStunMessage
(
void
OnOutgoingStunMessage
(
const
RTC
::
IceServer
*
iceServer
,
const
RTC
::
IceServer
*
iceServer
,
const
RTC
::
StunMessage
*
msg
,
RTC
::
TransportTuple
*
tuple
)
override
;
const
RTC
::
StunMessage
*
msg
,
RTC
::
TransportTuple
*
tuple
)
override
;
void
OnIceSelectedTuple
(
const
RTC
::
IceServer
*
iceServer
,
RTC
::
TransportTuple
*
tuple
)
override
;
void
OnIceSelectedTuple
(
const
RTC
::
IceServer
*
iceServer
,
RTC
::
TransportTuple
*
tuple
)
override
;
void
OnIceConnected
(
const
RTC
::
IceServer
*
iceServer
)
override
;
void
OnIceConnected
(
const
RTC
::
IceServer
*
iceServer
)
override
;
void
OnIceCompleted
(
const
RTC
::
IceServer
*
iceServer
)
override
;
void
OnIceCompleted
(
const
RTC
::
IceServer
*
iceServer
)
override
;
...
@@ -182,7 +177,9 @@ namespace RTC
...
@@ -182,7 +177,9 @@ namespace RTC
inline
bool
Transport
::
IsConnected
()
const
inline
bool
Transport
::
IsConnected
()
const
{
{
return
this
->
dtlsTransport
->
GetState
()
==
RTC
::
DtlsTransport
::
DtlsState
::
CONNECTED
;
return
(
this
->
selectedTuple
!=
nullptr
&&
this
->
dtlsTransport
->
GetState
()
==
RTC
::
DtlsTransport
::
DtlsState
::
CONNECTED
);
}
}
inline
void
Transport
::
EnableRemb
()
inline
void
Transport
::
EnableRemb
()
...
...
worker/include/RTC/TransportTuple.hpp
浏览文件 @
22900858
worker/include/RTC/UdpSocket.hpp
浏览文件 @
22900858
...
@@ -18,10 +18,7 @@ namespace RTC
...
@@ -18,10 +18,7 @@ namespace RTC
public
:
public
:
virtual
void
OnPacketRecv
(
virtual
void
OnPacketRecv
(
RTC
::
UdpSocket
*
socket
,
RTC
::
UdpSocket
*
socket
,
const
uint8_t
*
data
,
size_t
len
,
const
struct
sockaddr
*
remoteAddr
)
=
0
;
const
uint8_t
*
data
,
size_t
len
,
const
struct
sockaddr
*
remoteAddr
)
=
0
;
};
};
public
:
public
:
...
...
worker/include/Utils.hpp
浏览文件 @
22900858
...
@@ -29,8 +29,7 @@ namespace Utils
...
@@ -29,8 +29,7 @@ namespace Utils
inline
bool
IP
::
CompareAddresses
(
const
struct
sockaddr
*
addr1
,
const
struct
sockaddr
*
addr2
)
inline
bool
IP
::
CompareAddresses
(
const
struct
sockaddr
*
addr1
,
const
struct
sockaddr
*
addr2
)
{
{
// Compare family.
// Compare family.
if
(
addr1
->
sa_family
!=
addr2
->
sa_family
||
if
(
addr1
->
sa_family
!=
addr2
->
sa_family
||
(
addr1
->
sa_family
!=
AF_INET
&&
addr1
->
sa_family
!=
AF_INET6
))
(
addr1
->
sa_family
!=
AF_INET
&&
addr1
->
sa_family
!=
AF_INET6
))
{
{
return
false
;
return
false
;
}
}
...
@@ -43,18 +42,13 @@ namespace Utils
...
@@ -43,18 +42,13 @@ namespace Utils
switch
(
addr1
->
sa_family
)
switch
(
addr1
->
sa_family
)
{
{
case
AF_INET
:
case
AF_INET
:
if
(
std
::
memcmp
(
if
(
std
::
memcmp
(
&
((
struct
sockaddr_in
*
)
addr1
)
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
addr2
)
->
sin_addr
,
4
)
==
0
)
&
((
struct
sockaddr_in
*
)
addr1
)
->
sin_addr
,
&
((
struct
sockaddr_in
*
)
addr2
)
->
sin_addr
,
4
)
==
0
)
{
{
return
true
;
return
true
;
}
}
break
;
break
;
case
AF_INET6
:
case
AF_INET6
:
if
(
std
::
memcmp
(
if
(
std
::
memcmp
(
&
((
struct
sockaddr_in6
*
)
addr1
)
->
sin6_addr
,
&
((
struct
sockaddr_in6
*
)
addr2
)
->
sin6_addr
,
16
)
==
0
)
&
((
struct
sockaddr_in6
*
)
addr1
)
->
sin6_addr
,
&
((
struct
sockaddr_in6
*
)
addr2
)
->
sin6_addr
,
16
)
==
0
)
{
{
return
true
;
return
true
;
}
}
...
...
worker/include/handles/TcpConnection.hpp
浏览文件 @
22900858
worker/src/Channel/Notifier.cpp
浏览文件 @
22900858
worker/src/Channel/UnixStreamSocket.cpp
浏览文件 @
22900858
...
@@ -266,8 +266,8 @@ namespace Channel
...
@@ -266,8 +266,8 @@ namespace Channel
// If here it means that jsonStart points to the beginning of a JSON string
// If here it means that jsonStart points to the beginning of a JSON string
// with jsonLen bytes length, so recalculate readLen.
// with jsonLen bytes length, so recalculate readLen.
readLen
=
reinterpret_cast
<
const
uint8_t
*>
(
jsonStart
)
-
(
this
->
buffer
+
this
->
msgStart
)
+
readLen
=
jsonLen
+
1
;
reinterpret_cast
<
const
uint8_t
*>
(
jsonStart
)
-
(
this
->
buffer
+
this
->
msgStart
)
+
jsonLen
+
1
;
Json
::
Value
json
;
Json
::
Value
json
;
std
::
string
jsonParseError
;
std
::
string
jsonParseError
;
...
...
worker/src/RTC/Consumer.cpp
浏览文件 @
22900858
worker/src/RTC/DtlsTransport.cpp
浏览文件 @
22900858
...
@@ -95,7 +95,8 @@ namespace RTC
...
@@ -95,7 +95,8 @@ namespace RTC
MS_TRACE
();
MS_TRACE
();
// Generate a X509 certificate and private key (unless PEM files are provided).
// Generate a X509 certificate and private key (unless PEM files are provided).
if
(
Settings
::
configuration
.
dtlsCertificateFile
.
empty
()
||
if
(
Settings
::
configuration
.
dtlsCertificateFile
.
empty
()
||
Settings
::
configuration
.
dtlsPrivateKeyFile
.
empty
())
Settings
::
configuration
.
dtlsPrivateKeyFile
.
empty
())
{
{
GenerateCertificateAndPrivateKey
();
GenerateCertificateAndPrivateKey
();
...
@@ -364,9 +365,7 @@ namespace RTC
...
@@ -364,9 +365,7 @@ namespace RTC
// Require certificate from peer.
// Require certificate from peer.
SSL_CTX_set_verify
(
SSL_CTX_set_verify
(
DtlsTransport
::
sslCtx
,
DtlsTransport
::
sslCtx
,
SSL_VERIFY_PEER
|
SSL_VERIFY_FAIL_IF_NO_PEER_CERT
,
onSslCertificateVerify
);
SSL_VERIFY_PEER
|
SSL_VERIFY_FAIL_IF_NO_PEER_CERT
,
onSslCertificateVerify
);
// Set SSL info callback.
// Set SSL info callback.
SSL_CTX_set_info_callback
(
DtlsTransport
::
sslCtx
,
onSslInfo
);
SSL_CTX_set_info_callback
(
DtlsTransport
::
sslCtx
,
onSslInfo
);
...
@@ -1013,8 +1012,7 @@ namespace RTC
...
@@ -1013,8 +1012,7 @@ namespace RTC
MS_TRACE
();
MS_TRACE
();
MS_ASSERT
(
MS_ASSERT
(
this
->
remoteFingerprint
.
algorithm
!=
FingerprintAlgorithm
::
NONE
,
this
->
remoteFingerprint
.
algorithm
!=
FingerprintAlgorithm
::
NONE
,
"remote fingerprint not set"
);
"remote fingerprint not set"
);
X509
*
certificate
;
X509
*
certificate
;
uint8_t
binaryFingerprint
[
EVP_MAX_MD_SIZE
];
uint8_t
binaryFingerprint
[
EVP_MAX_MD_SIZE
];
...
...
worker/src/RTC/IceCandidate.cpp
浏览文件 @
22900858
worker/src/RTC/IceServer.cpp
浏览文件 @
22900858
worker/src/RTC/NackGenerator.cpp
浏览文件 @
22900858
...
@@ -150,8 +150,7 @@ namespace RTC
...
@@ -150,8 +150,7 @@ namespace RTC
NackInfo
&
nackInfo
=
it
->
second
;
NackInfo
&
nackInfo
=
it
->
second
;
uint16_t
seq
=
nackInfo
.
seq32
%
(
1
<<
16
);
uint16_t
seq
=
nackInfo
.
seq32
%
(
1
<<
16
);
if
(
filter
==
NackFilter
::
SEQ
&&
nackInfo
.
sentAtTime
==
0
&&
if
(
filter
==
NackFilter
::
SEQ
&&
nackInfo
.
sentAtTime
==
0
&&
this
->
lastSeq32
>=
nackInfo
.
sendAtSeqNum
)
this
->
lastSeq32
>=
nackInfo
.
sendAtSeqNum
)
{
{
nackInfo
.
retries
++
;
nackInfo
.
retries
++
;
nackInfo
.
sentAtTime
=
now
;
nackInfo
.
sentAtTime
=
now
;
...
...
worker/src/RTC/Peer.cpp
浏览文件 @
22900858
worker/src/RTC/Producer.cpp
浏览文件 @
22900858
...
@@ -407,7 +407,8 @@ namespace RTC
...
@@ -407,7 +407,8 @@ namespace RTC
for
(
auto
&
exten
:
this
->
rtpParameters
.
headerExtensions
)
for
(
auto
&
exten
:
this
->
rtpParameters
.
headerExtensions
)
{
{
if
(
this
->
kind
==
RTC
::
Media
::
Kind
::
AUDIO
&&
(
ssrcAudioLevelId
==
0u
)
&&
if
(
this
->
kind
==
RTC
::
Media
::
Kind
::
AUDIO
&&
(
ssrcAudioLevelId
==
0u
)
&&
exten
.
type
==
RTC
::
RtpHeaderExtensionUri
::
Type
::
SSRC_AUDIO_LEVEL
)
exten
.
type
==
RTC
::
RtpHeaderExtensionUri
::
Type
::
SSRC_AUDIO_LEVEL
)
{
{
if
(
idMapping
.
find
(
exten
.
id
)
!=
idMapping
.
end
())
if
(
idMapping
.
find
(
exten
.
id
)
!=
idMapping
.
end
())
...
@@ -528,8 +529,7 @@ namespace RTC
...
@@ -528,8 +529,7 @@ namespace RTC
if
(
this
->
knownHeaderExtensions
.
ssrcAudioLevelId
)
if
(
this
->
knownHeaderExtensions
.
ssrcAudioLevelId
)
{
{
packet
->
AddExtensionMapping
(
packet
->
AddExtensionMapping
(
RtpHeaderExtensionUri
::
Type
::
SSRC_AUDIO_LEVEL
,
RtpHeaderExtensionUri
::
Type
::
SSRC_AUDIO_LEVEL
,
this
->
knownHeaderExtensions
.
ssrcAudioLevelId
);
this
->
knownHeaderExtensions
.
ssrcAudioLevelId
);
}
}
if
(
this
->
knownHeaderExtensions
.
absSendTimeId
)
if
(
this
->
knownHeaderExtensions
.
absSendTimeId
)
...
...
worker/src/RTC/RTCP/CompoundPacket.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/Feedback.cpp
浏览文件 @
22900858
...
@@ -177,9 +177,7 @@ namespace RTC
...
@@ -177,9 +177,7 @@ namespace RTC
default
:
default
:
MS_WARN_TAG
(
MS_WARN_TAG
(
rtcp
,
rtcp
,
"unknown RTCP PS Feedback message type [packetType:%"
PRIu8
"]"
,
commonHeader
->
count
);
"unknown RTCP PS Feedback message type [packetType:%"
PRIu8
"]"
,
commonHeader
->
count
);
}
}
return
packet
;
return
packet
;
...
...
worker/src/RTC/RTCP/FeedbackPs.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/FeedbackPsRemb.cpp
浏览文件 @
22900858
...
@@ -67,8 +67,7 @@ namespace RTC
...
@@ -67,8 +67,7 @@ namespace RTC
// Check length.
// Check length.
size_t
len
=
static_cast
<
size_t
>
(
ntohs
(
commonHeader
->
length
)
+
1
)
*
4
;
size_t
len
=
static_cast
<
size_t
>
(
ntohs
(
commonHeader
->
length
)
+
1
)
*
4
;
if
(
len
!=
sizeof
(
CommonHeader
)
+
sizeof
(
FeedbackPacket
::
Header
)
+
sizeof
(
Header
)
+
if
(
len
!=
sizeof
(
CommonHeader
)
+
sizeof
(
FeedbackPacket
::
Header
)
+
sizeof
(
Header
)
+
(
numSsrcs
*
sizeof
(
uint32_t
)))
(
numSsrcs
*
sizeof
(
uint32_t
)))
{
{
MS_WARN_TAG
(
MS_WARN_TAG
(
rtcp
,
"invalid payload size (%zu bytes) for the given number of ssrcs (%zu)"
,
len
,
numSsrcs
);
rtcp
,
"invalid payload size (%zu bytes) for the given number of ssrcs (%zu)"
,
len
,
numSsrcs
);
...
...
worker/src/RTC/RTCP/FeedbackPsRpsi.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/FeedbackPsTst.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/FeedbackPsVbcm.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/FeedbackRtp.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/FeedbackRtpTmmb.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/Packet.cpp
浏览文件 @
22900858
worker/src/RTC/RTCP/ReceiverReport.cpp
浏览文件 @
22900858
worker/src/RTC/RemoteBitrateEstimator/AimdRateControl.cpp
浏览文件 @
22900858
...
@@ -143,8 +143,7 @@ namespace RTC
...
@@ -143,8 +143,7 @@ namespace RTC
break
;
break
;
case
RC_INCREASE
:
case
RC_INCREASE
:
if
(
this
->
avgMaxBitrateKbps
>=
0
&&
if
(
this
->
avgMaxBitrateKbps
>=
0
&&
incomingBitrateKbps
>
this
->
avgMaxBitrateKbps
+
3
*
stdMaxBitRate
)
incomingBitrateKbps
>
this
->
avgMaxBitrateKbps
+
3
*
stdMaxBitRate
)
{
{
ChangeRegion
(
RC_MAX_UNKNOWN
);
ChangeRegion
(
RC_MAX_UNKNOWN
);
this
->
avgMaxBitrateKbps
=
-
1.0
;
this
->
avgMaxBitrateKbps
=
-
1.0
;
...
@@ -177,8 +176,8 @@ namespace RTC
...
@@ -177,8 +176,8 @@ namespace RTC
// Avoid increasing the rate when over-using.
// Avoid increasing the rate when over-using.
if
(
this
->
rateControlRegion
!=
RC_MAX_UNKNOWN
)
if
(
this
->
rateControlRegion
!=
RC_MAX_UNKNOWN
)
{
{
newBitrateBps
=
static_cast
<
uint32_t
>
(
newBitrateBps
=
std
::
lround
(
this
->
beta
*
this
->
avgMaxBitrateKbps
*
1000
+
0.5
f
));
static_cast
<
uint32_t
>
(
std
::
lround
(
this
->
beta
*
this
->
avgMaxBitrateKbps
*
1000
+
0.5
f
));
}
}
newBitrateBps
=
std
::
min
(
newBitrateBps
,
this
->
currentBitrateBps
);
newBitrateBps
=
std
::
min
(
newBitrateBps
,
this
->
currentBitrateBps
);
...
...
worker/src/RTC/RemoteBitrateEstimator/InterArrival.cpp
浏览文件 @
22900858
worker/src/RTC/RemoteBitrateEstimator/OveruseEstimator.cpp
浏览文件 @
22900858
...
@@ -42,7 +42,8 @@ namespace RTC
...
@@ -42,7 +42,8 @@ namespace RTC
this
->
e
[
0
][
0
]
+=
this
->
processNoise
[
0
];
this
->
e
[
0
][
0
]
+=
this
->
processNoise
[
0
];
this
->
e
[
1
][
1
]
+=
this
->
processNoise
[
1
];
this
->
e
[
1
][
1
]
+=
this
->
processNoise
[
1
];
if
((
currentHypothesis
==
BW_OVERUSING
&&
this
->
offset
<
this
->
prevOffset
)
||
if
(
(
currentHypothesis
==
BW_OVERUSING
&&
this
->
offset
<
this
->
prevOffset
)
||
(
currentHypothesis
==
BW_UNDERUSING
&&
this
->
offset
>
this
->
prevOffset
))
(
currentHypothesis
==
BW_UNDERUSING
&&
this
->
offset
>
this
->
prevOffset
))
{
{
this
->
e
[
1
][
1
]
+=
10
*
this
->
processNoise
[
1
];
this
->
e
[
1
][
1
]
+=
10
*
this
->
processNoise
[
1
];
...
@@ -135,8 +136,8 @@ namespace RTC
...
@@ -135,8 +136,8 @@ namespace RTC
const
double
beta
=
pow
(
1
-
alpha
,
tsDelta
*
30.0
/
1000.0
);
const
double
beta
=
pow
(
1
-
alpha
,
tsDelta
*
30.0
/
1000.0
);
this
->
avgNoise
=
beta
*
this
->
avgNoise
+
(
1
-
beta
)
*
residual
;
this
->
avgNoise
=
beta
*
this
->
avgNoise
+
(
1
-
beta
)
*
residual
;
this
->
varNoise
=
beta
*
this
->
varNoise
+
this
->
varNoise
=
(
1
-
beta
)
*
(
this
->
avgNoise
-
residual
)
*
(
this
->
avgNoise
-
residual
);
beta
*
this
->
varNoise
+
(
1
-
beta
)
*
(
this
->
avgNoise
-
residual
)
*
(
this
->
avgNoise
-
residual
);
if
(
this
->
varNoise
<
1
)
if
(
this
->
varNoise
<
1
)
this
->
varNoise
=
1
;
this
->
varNoise
=
1
;
}
}
...
...
worker/src/RTC/RemoteBitrateEstimator/RemoteBitrateEstimatorAbsSendTime.cpp
浏览文件 @
22900858
...
@@ -136,7 +136,8 @@ namespace RTC
...
@@ -136,7 +136,8 @@ namespace RTC
if
(
it
->
sendMeanMs
==
0
||
it
->
recvMeanMs
==
0
)
if
(
it
->
sendMeanMs
==
0
||
it
->
recvMeanMs
==
0
)
continue
;
continue
;
if
(
it
->
numAboveMinDelta
>
it
->
count
/
2
&&
if
(
it
->
numAboveMinDelta
>
it
->
count
/
2
&&
(
it
->
recvMeanMs
-
it
->
sendMeanMs
<=
2.0
f
&&
it
->
sendMeanMs
-
it
->
recvMeanMs
<=
5.0
f
))
(
it
->
recvMeanMs
-
it
->
sendMeanMs
<=
2.0
f
&&
it
->
sendMeanMs
-
it
->
recvMeanMs
<=
5.0
f
))
{
{
int
probeBitrateBps
=
std
::
min
(
it
->
GetSendBitrateBps
(),
it
->
GetRecvBitrateBps
());
int
probeBitrateBps
=
std
::
min
(
it
->
GetSendBitrateBps
(),
it
->
GetRecvBitrateBps
());
...
@@ -298,7 +299,8 @@ namespace RTC
...
@@ -298,7 +299,8 @@ namespace RTC
// the sender.
// the sender.
const
size_t
minProbePacketSize
{
200
};
const
size_t
minProbePacketSize
{
200
};
if
(
payloadSize
>
minProbePacketSize
&&
if
(
payloadSize
>
minProbePacketSize
&&
(
!
this
->
remoteRate
.
ValidEstimate
()
||
(
!
this
->
remoteRate
.
ValidEstimate
()
||
nowMs
-
this
->
firstPacketTimeMs
<
InitialProbingIntervalMs
))
nowMs
-
this
->
firstPacketTimeMs
<
InitialProbingIntervalMs
))
{
{
...
@@ -348,8 +350,7 @@ namespace RTC
...
@@ -348,8 +350,7 @@ namespace RTC
{
{
// Check if it's time for a periodic update or if we should update because
// Check if it's time for a periodic update or if we should update because
// of an over-use.
// of an over-use.
if
(
this
->
lastUpdateMs
==
-
1
||
if
(
this
->
lastUpdateMs
==
-
1
||
nowMs
-
this
->
lastUpdateMs
>
this
->
remoteRate
.
GetFeedbackInterval
())
nowMs
-
this
->
lastUpdateMs
>
this
->
remoteRate
.
GetFeedbackInterval
())
{
{
updateEstimate
=
true
;
updateEstimate
=
true
;
}
}
...
...
worker/src/RTC/RemoteBitrateEstimator/RemoteBitrateEstimatorSingleStream.cpp
浏览文件 @
22900858
...
@@ -96,7 +96,8 @@ namespace RTC
...
@@ -96,7 +96,8 @@ namespace RTC
{
{
uint32_t
incomingBitrateBps
=
this
->
incomingBitrate
.
GetRate
(
nowMs
);
uint32_t
incomingBitrateBps
=
this
->
incomingBitrate
.
GetRate
(
nowMs
);
if
((
incomingBitrateBps
!=
0u
)
&&
if
(
(
incomingBitrateBps
!=
0u
)
&&
(
priorState
!=
BW_OVERUSING
||
(
priorState
!=
BW_OVERUSING
||
GetRemoteRate
()
->
TimeToReduceFurther
(
nowMs
,
incomingBitrateBps
)))
GetRemoteRate
()
->
TimeToReduceFurther
(
nowMs
,
incomingBitrateBps
)))
{
{
...
...
worker/src/RTC/Router.cpp
浏览文件 @
22900858
worker/src/RTC/RtpDictionaries/Parameters.cpp
浏览文件 @
22900858
worker/src/RTC/RtpDictionaries/RtpParameters.cpp
浏览文件 @
22900858
...
@@ -184,8 +184,7 @@ namespace RTC
...
@@ -184,8 +184,7 @@ namespace RTC
{
{
auto
&
codec
=
*
it
;
auto
&
codec
=
*
it
;
if
(
codec
.
mime
.
IsFeatureCodec
()
&&
if
(
codec
.
mime
.
IsFeatureCodec
()
&&
codec
.
parameters
.
GetInteger
(
associatedPayloadType
)
==
payloadType
)
codec
.
parameters
.
GetInteger
(
associatedPayloadType
)
==
payloadType
)
{
{
return
codec
;
return
codec
;
}
}
...
...
worker/src/RTC/RtpListener.cpp
浏览文件 @
22900858
...
@@ -198,7 +198,8 @@ namespace RTC
...
@@ -198,7 +198,8 @@ namespace RTC
{
{
auto
&
encoding
=
*
it
;
auto
&
encoding
=
*
it
;
if
((
encoding
.
ssrc
==
0u
)
||
(
encoding
.
hasRtx
&&
(
encoding
.
rtx
.
ssrc
==
0u
))
||
if
(
(
encoding
.
ssrc
==
0u
)
||
(
encoding
.
hasRtx
&&
(
encoding
.
rtx
.
ssrc
==
0u
))
||
(
encoding
.
hasFec
&&
(
encoding
.
fec
.
ssrc
==
0u
)))
(
encoding
.
hasFec
&&
(
encoding
.
fec
.
ssrc
==
0u
)))
{
{
break
;
break
;
...
...
worker/src/RTC/RtpPacket.cpp
浏览文件 @
22900858
worker/src/RTC/RtpStream.cpp
浏览文件 @
22900858
worker/src/RTC/RtpStreamRecv.cpp
浏览文件 @
22900858
...
@@ -90,8 +90,7 @@ namespace RTC
...
@@ -90,8 +90,7 @@ namespace RTC
{
{
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
rtx
,
rtx
,
"ignoring empty RTX packet [ssrc: %"
PRIu32
" seq: %"
PRIu16
"ignoring empty RTX packet [ssrc: %"
PRIu32
" seq: %"
PRIu16
" payload type: %"
PRIu8
"]"
,
" payload type: %"
PRIu8
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
(),
packet
->
GetSequenceNumber
(),
packet
->
GetPayloadType
());
packet
->
GetPayloadType
());
...
@@ -101,8 +100,8 @@ namespace RTC
...
@@ -101,8 +100,8 @@ namespace RTC
MS_WARN_TAG
(
MS_WARN_TAG
(
rtx
,
rtx
,
"ignoring malformed RTX packet [ssrc: %"
PRIu32
" seq: %"
PRIu16
"ignoring malformed RTX packet [ssrc: %"
PRIu32
" seq: %"
PRIu16
" payload type: %"
PRIu8
" payload type: %"
PRIu8
"]"
,
"]"
,
packet
->
GetSsrc
(),
packet
->
GetSsrc
(),
packet
->
GetSequenceNumber
(),
packet
->
GetSequenceNumber
(),
packet
->
GetPayloadType
());
packet
->
GetPayloadType
());
...
@@ -112,8 +111,8 @@ namespace RTC
...
@@ -112,8 +111,8 @@ namespace RTC
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
rtx
,
rtx
,
"received RTX packet [ssrc: %"
PRIu32
" seq: %"
PRIu16
"received RTX packet [ssrc: %"
PRIu32
" seq: %"
PRIu16
"] recovering original [ssrc: %"
PRIu32
"] recovering original [ssrc: %"
PRIu32
" seq: %"
PRIu16
"]"
,
" seq: %"
PRIu16
"]"
,
this
->
rtxSsrc
,
this
->
rtxSsrc
,
rtxSeq
,
rtxSeq
,
packet
->
GetSsrc
(),
packet
->
GetSsrc
(),
...
...
worker/src/RTC/RtpStreamSend.cpp
浏览文件 @
22900858
worker/src/RTC/SrtpSession.cpp
浏览文件 @
22900858
worker/src/RTC/StunMessage.cpp
浏览文件 @
22900858
...
@@ -238,8 +238,8 @@ namespace RTC
...
@@ -238,8 +238,8 @@ namespace RTC
StunMessage
::
StunMessage
(
StunMessage
::
StunMessage
(
Class
klass
,
Method
method
,
const
uint8_t
*
transactionId
,
const
uint8_t
*
data
,
size_t
size
)
Class
klass
,
Method
method
,
const
uint8_t
*
transactionId
,
const
uint8_t
*
data
,
size_t
size
)
:
klass
(
klass
),
method
(
method
),
transactionId
(
transactionId
),
:
klass
(
klass
),
method
(
method
),
transactionId
(
transactionId
),
data
(
const_cast
<
uint8_t
*>
(
data
)
),
data
(
const_cast
<
uint8_t
*>
(
data
)),
size
(
size
)
size
(
size
)
{
{
MS_TRACE
();
MS_TRACE
();
}
}
...
@@ -346,8 +346,8 @@ namespace RTC
...
@@ -346,8 +346,8 @@ namespace RTC
// Check that USERNAME attribute begins with our local username plus ":".
// Check that USERNAME attribute begins with our local username plus ":".
size_t
localUsernameLen
=
localUsername
.
length
();
size_t
localUsernameLen
=
localUsername
.
length
();
if
(
this
->
username
.
length
()
<=
localUsernameLen
||
if
(
this
->
username
.
at
(
localUsernameLen
)
!=
':'
||
this
->
username
.
length
()
<=
localUsernameLen
||
this
->
username
.
at
(
localUsernameLen
)
!=
':'
||
(
this
->
username
.
compare
(
0
,
localUsernameLen
,
localUsername
)
!=
0
))
(
this
->
username
.
compare
(
0
,
localUsernameLen
,
localUsername
)
!=
0
))
return
Authentication
::
UNAUTHORIZED
;
return
Authentication
::
UNAUTHORIZED
;
...
...
worker/src/RTC/TcpConnection.cpp
浏览文件 @
22900858
worker/src/RTC/TcpServer.cpp
浏览文件 @
22900858
...
@@ -119,8 +119,7 @@ namespace RTC
...
@@ -119,8 +119,7 @@ namespace RTC
// Choose a random first port to start from.
// Choose a random first port to start from.
initialPort
=
static_cast
<
uint16_t
>
(
Utils
::
Crypto
::
GetRandomUInt
(
initialPort
=
static_cast
<
uint16_t
>
(
Utils
::
Crypto
::
GetRandomUInt
(
static_cast
<
uint32_t
>
(
RTC
::
TcpServer
::
minPort
),
static_cast
<
uint32_t
>
(
RTC
::
TcpServer
::
minPort
),
static_cast
<
uint32_t
>
(
RTC
::
TcpServer
::
maxPort
)));
static_cast
<
uint32_t
>
(
RTC
::
TcpServer
::
maxPort
)));
iteratingPort
=
initialPort
;
iteratingPort
=
initialPort
;
...
@@ -140,9 +139,7 @@ namespace RTC
...
@@ -140,9 +139,7 @@ namespace RTC
if
(
!
(
*
availablePorts
)[
iteratingPort
])
if
(
!
(
*
availablePorts
)[
iteratingPort
])
{
{
MS_DEBUG_DEV
(
MS_DEBUG_DEV
(
"port in use, trying again [port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
"port in use, trying again [port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
iteratingPort
,
attempt
);
iteratingPort
,
attempt
);
// If we have tried all the ports in the range raise an error.
// If we have tried all the ports in the range raise an error.
if
(
iteratingPort
==
initialPort
)
if
(
iteratingPort
==
initialPort
)
...
@@ -208,10 +205,7 @@ namespace RTC
...
@@ -208,10 +205,7 @@ namespace RTC
(
*
availablePorts
)[
iteratingPort
]
=
false
;
(
*
availablePorts
)[
iteratingPort
]
=
false
;
MS_DEBUG_DEV
(
MS_DEBUG_DEV
(
"bind success [ip:%s, port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
"bind success [ip:%s, port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
listenIp
,
iteratingPort
,
attempt
);
listenIp
,
iteratingPort
,
attempt
);
return
uvHandle
;
return
uvHandle
;
};
};
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
22900858
...
@@ -623,9 +623,7 @@ namespace RTC
...
@@ -623,9 +623,7 @@ namespace RTC
{
{
if
(
consumer
->
kind
==
RTC
::
Media
::
Kind
::
VIDEO
)
if
(
consumer
->
kind
==
RTC
::
Media
::
Kind
::
VIDEO
)
{
{
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
rtx
,
"requesting fullframe for new Consumer since Transport already connected"
);
rtx
,
"requesting fullframe for new Consumer since Transport already connected"
);
}
}
consumer
->
RequestFullFrame
();
consumer
->
RequestFullFrame
();
...
@@ -636,8 +634,7 @@ namespace RTC
...
@@ -636,8 +634,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
// If there is no selected tuple do nothing.
if
(
!
IsConnected
())
if
(
this
->
selectedTuple
==
nullptr
)
return
;
return
;
// Ensure there is sending SRTP session.
// Ensure there is sending SRTP session.
...
@@ -661,8 +658,7 @@ namespace RTC
...
@@ -661,8 +658,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
// If there is no selected tuple do nothing.
if
(
!
IsConnected
())
if
(
this
->
selectedTuple
==
nullptr
)
return
;
return
;
// Ensure there is sending SRTP session.
// Ensure there is sending SRTP session.
...
@@ -686,8 +682,7 @@ namespace RTC
...
@@ -686,8 +682,7 @@ namespace RTC
{
{
MS_TRACE
();
MS_TRACE
();
// If there is no selected tuple do nothing.
if
(
!
IsConnected
())
if
(
this
->
selectedTuple
==
nullptr
)
return
;
return
;
// Ensure there is sending SRTP session.
// Ensure there is sending SRTP session.
...
@@ -722,7 +717,8 @@ namespace RTC
...
@@ -722,7 +717,8 @@ namespace RTC
// If still 'auto' then transition to 'server' if ICE is 'connected' or
// If still 'auto' then transition to 'server' if ICE is 'connected' or
// 'completed'.
// 'completed'.
case
RTC
:
:
DtlsTransport
::
Role
::
AUTO
:
case
RTC
:
:
DtlsTransport
::
Role
::
AUTO
:
if
(
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
CONNECTED
||
if
(
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
CONNECTED
||
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
COMPLETED
)
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
COMPLETED
)
{
{
MS_DEBUG_TAG
(
MS_DEBUG_TAG
(
...
@@ -748,7 +744,8 @@ namespace RTC
...
@@ -748,7 +744,8 @@ namespace RTC
// If 'server' then run the DTLS transport if ICE is 'connected' (not yet
// If 'server' then run the DTLS transport if ICE is 'connected' (not yet
// USE-CANDIDATE) or 'completed'.
// USE-CANDIDATE) or 'completed'.
case
RTC
:
:
DtlsTransport
::
Role
::
SERVER
:
case
RTC
:
:
DtlsTransport
::
Role
::
SERVER
:
if
(
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
CONNECTED
||
if
(
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
CONNECTED
||
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
COMPLETED
)
this
->
iceServer
->
GetState
()
==
RTC
::
IceServer
::
IceState
::
COMPLETED
)
{
{
MS_DEBUG_TAG
(
dtls
,
"running DTLS transport in local role 'server'"
);
MS_DEBUG_TAG
(
dtls
,
"running DTLS transport in local role 'server'"
);
...
@@ -898,7 +895,8 @@ namespace RTC
...
@@ -898,7 +895,8 @@ namespace RTC
this
->
iceServer
->
ForceSelectedTuple
(
tuple
);
this
->
iceServer
->
ForceSelectedTuple
(
tuple
);
// Check that DTLS status is 'connecting' or 'connected'.
// Check that DTLS status is 'connecting' or 'connected'.
if
(
this
->
dtlsTransport
->
GetState
()
==
DtlsTransport
::
DtlsState
::
CONNECTING
||
if
(
this
->
dtlsTransport
->
GetState
()
==
DtlsTransport
::
DtlsState
::
CONNECTING
||
this
->
dtlsTransport
->
GetState
()
==
DtlsTransport
::
DtlsState
::
CONNECTED
)
this
->
dtlsTransport
->
GetState
()
==
DtlsTransport
::
DtlsState
::
CONNECTED
)
{
{
MS_DEBUG_DEV
(
"DTLS data received, passing it to the DTLS transport"
);
MS_DEBUG_DEV
(
"DTLS data received, passing it to the DTLS transport"
);
...
@@ -1335,6 +1333,8 @@ namespace RTC
...
@@ -1335,6 +1333,8 @@ namespace RTC
MS_TRACE
();
MS_TRACE
();
MS_DEBUG_TAG
(
dtls
,
"DTLS application data received [size:%zu]"
,
len
);
MS_DEBUG_TAG
(
dtls
,
"DTLS application data received [size:%zu]"
,
len
);
// NOTE: No DataChannel support, si just ignore it.
}
}
void
Transport
::
OnReceiveBitrateChanged
(
const
std
::
vector
<
uint32_t
>&
ssrcs
,
uint32_t
bitrate
)
void
Transport
::
OnReceiveBitrateChanged
(
const
std
::
vector
<
uint32_t
>&
ssrcs
,
uint32_t
bitrate
)
...
@@ -1379,7 +1379,8 @@ namespace RTC
...
@@ -1379,7 +1379,8 @@ namespace RTC
// has decreased abruptly.
// has decreased abruptly.
if
(
now
-
this
->
lastEffectiveMaxBitrateAt
>
EffectiveMaxBitrateCheckInterval
)
if
(
now
-
this
->
lastEffectiveMaxBitrateAt
>
EffectiveMaxBitrateCheckInterval
)
{
{
if
((
bitrate
!=
0u
)
&&
(
this
->
effectiveMaxBitrate
!=
0u
)
&&
if
(
(
bitrate
!=
0u
)
&&
(
this
->
effectiveMaxBitrate
!=
0u
)
&&
static_cast
<
double
>
(
effectiveBitrate
)
/
static_cast
<
double
>
(
this
->
effectiveMaxBitrate
)
<
static_cast
<
double
>
(
effectiveBitrate
)
/
static_cast
<
double
>
(
this
->
effectiveMaxBitrate
)
<
EffectiveMaxBitrateThresholdBeforeFullFrame
)
EffectiveMaxBitrateThresholdBeforeFullFrame
)
{
{
...
...
worker/src/RTC/TransportTuple.cpp
浏览文件 @
22900858
worker/src/RTC/UdpSocket.cpp
浏览文件 @
22900858
...
@@ -118,8 +118,7 @@ namespace RTC
...
@@ -118,8 +118,7 @@ namespace RTC
// Choose a random port to start from.
// Choose a random port to start from.
initialPort
=
static_cast
<
uint16_t
>
(
Utils
::
Crypto
::
GetRandomUInt
(
initialPort
=
static_cast
<
uint16_t
>
(
Utils
::
Crypto
::
GetRandomUInt
(
static_cast
<
uint32_t
>
(
RTC
::
UdpSocket
::
minPort
),
static_cast
<
uint32_t
>
(
RTC
::
UdpSocket
::
minPort
),
static_cast
<
uint32_t
>
(
RTC
::
UdpSocket
::
maxPort
)));
static_cast
<
uint32_t
>
(
RTC
::
UdpSocket
::
maxPort
)));
iteratingPort
=
initialPort
;
iteratingPort
=
initialPort
;
...
@@ -139,9 +138,7 @@ namespace RTC
...
@@ -139,9 +138,7 @@ namespace RTC
if
(
!
(
*
availablePorts
)[
iteratingPort
])
if
(
!
(
*
availablePorts
)[
iteratingPort
])
{
{
MS_DEBUG_DEV
(
MS_DEBUG_DEV
(
"port in use, trying again [port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
"port in use, trying again [port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
iteratingPort
,
attempt
);
iteratingPort
,
attempt
);
// If we have tried all the ports in the range raise an error.
// If we have tried all the ports in the range raise an error.
if
(
iteratingPort
==
initialPort
)
if
(
iteratingPort
==
initialPort
)
...
@@ -207,10 +204,7 @@ namespace RTC
...
@@ -207,10 +204,7 @@ namespace RTC
(
*
availablePorts
)[
iteratingPort
]
=
false
;
(
*
availablePorts
)[
iteratingPort
]
=
false
;
MS_DEBUG_DEV
(
MS_DEBUG_DEV
(
"bind success [ip:%s, port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
"bind success [ip:%s, port:%"
PRIu16
", attempt:%"
PRIu16
"]"
,
listenIp
,
iteratingPort
,
attempt
);
listenIp
,
iteratingPort
,
attempt
);
return
uvHandle
;
return
uvHandle
;
};
};
...
...
worker/src/Settings.cpp
浏览文件 @
22900858
...
@@ -506,7 +506,8 @@ void Settings::SetDtlsCertificateAndPrivateKeyFiles()
...
@@ -506,7 +506,8 @@ void Settings::SetDtlsCertificateAndPrivateKeyFiles()
{
{
MS_TRACE
();
MS_TRACE
();
if
(
Settings
::
configuration
.
dtlsCertificateFile
.
empty
()
||
if
(
Settings
::
configuration
.
dtlsCertificateFile
.
empty
()
||
Settings
::
configuration
.
dtlsPrivateKeyFile
.
empty
())
Settings
::
configuration
.
dtlsPrivateKeyFile
.
empty
())
{
{
Settings
::
configuration
.
dtlsCertificateFile
=
""
;
Settings
::
configuration
.
dtlsCertificateFile
=
""
;
...
@@ -622,9 +623,7 @@ bool isBindableIp(const std::string& ip, int family, int* bindErrno)
...
@@ -622,9 +623,7 @@ bool isBindableIp(const std::string& ip, int family, int* bindErrno)
MS_ABORT
(
"socket() failed: %s"
,
std
::
strerror
(
errno
));
MS_ABORT
(
"socket() failed: %s"
,
std
::
strerror
(
errno
));
err
=
bind
(
err
=
bind
(
bindSocket
,
bindSocket
,
reinterpret_cast
<
const
struct
sockaddr
*>
(
&
bindAddr
),
sizeof
(
struct
sockaddr_in6
));
reinterpret_cast
<
const
struct
sockaddr
*>
(
&
bindAddr
),
sizeof
(
struct
sockaddr_in6
));
break
;
break
;
default
:
default
:
...
...
worker/src/Utils/Crypto.cpp
浏览文件 @
22900858
...
@@ -94,10 +94,7 @@ namespace Utils
...
@@ -94,10 +94,7 @@ namespace Utils
ret
=
HMAC_Final
(
&
Crypto
::
hmacSha1Ctx
,
(
uint8_t
*
)
Crypto
::
hmacSha1Buffer
,
&
resultLen
);
ret
=
HMAC_Final
(
&
Crypto
::
hmacSha1Ctx
,
(
uint8_t
*
)
Crypto
::
hmacSha1Buffer
,
&
resultLen
);
MS_ASSERT
(
MS_ASSERT
(
ret
==
1
,
ret
==
1
,
"OpenSSL HMAC_Final() failed with key '%s' and data length %zu bytes"
,
key
.
c_str
(),
len
);
"OpenSSL HMAC_Final() failed with key '%s' and data length %zu bytes"
,
key
.
c_str
(),
len
);
MS_ASSERT
(
resultLen
==
20
,
"OpenSSL HMAC_Final() resultLen is %u instead of 20"
,
resultLen
);
MS_ASSERT
(
resultLen
==
20
,
"OpenSSL HMAC_Final() resultLen is %u instead of 20"
,
resultLen
);
return
Crypto
::
hmacSha1Buffer
;
return
Crypto
::
hmacSha1Buffer
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论