Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
b9847aea
提交
b9847aea
authored
1月 08, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Code cleanup.
上级
82752177
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
34 行增加
和
35 行删除
+34
-35
UnixStreamSocket.h
worker/include/Channel/UnixStreamSocket.h
+1
-1
MediaSoupError.h
worker/include/MediaSoupError.h
+1
-1
DtlsTransport.h
worker/include/RTC/DtlsTransport.h
+2
-2
RtpDictionaries.h
worker/include/RTC/RtpDictionaries.h
+1
-1
RtpStream.h
worker/include/RTC/RtpStream.h
+9
-9
TcpConnection.h
worker/include/RTC/TcpConnection.h
+1
-1
Utils.h
worker/include/Utils.h
+1
-1
common.h
worker/include/common.h
+8
-9
DepOpenSSL.cpp
worker/src/DepOpenSSL.cpp
+1
-1
DtlsTransport.cpp
worker/src/RTC/DtlsTransport.cpp
+4
-4
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+1
-1
StunMessage.cpp
worker/src/RTC/StunMessage.cpp
+1
-1
Transport.cpp
worker/src/RTC/Transport.cpp
+1
-1
Settings.cpp
worker/src/Settings.cpp
+1
-1
Crypto.cpp
worker/src/Utils/Crypto.cpp
+1
-1
没有找到文件。
worker/include/Channel/UnixStreamSocket.h
浏览文件 @
b9847aea
...
...
@@ -42,7 +42,7 @@ namespace Channel
// Others.
Json
::
CharReader
*
jsonReader
=
nullptr
;
Json
::
StreamWriter
*
jsonWriter
=
nullptr
;
size_t
msgStart
=
0
;
// Where the latest message starts.
size_t
msgStart
=
0
;
// Where the latest message starts.
bool
closed
=
false
;
};
}
...
...
worker/include/MediaSoupError.h
浏览文件 @
b9847aea
...
...
@@ -4,7 +4,7 @@
#include "Logger.h"
#include <stdexcept>
#include <string>
#include <cstdio>
// std::snprintf
#include <cstdio> // std::snprintf
class
MediaSoupError
:
public
std
::
runtime_error
...
...
worker/include/RTC/DtlsTransport.h
浏览文件 @
b9847aea
...
...
@@ -150,8 +150,8 @@ namespace RTC
Listener
*
listener
=
nullptr
;
// Allocated by this.
SSL
*
ssl
=
nullptr
;
BIO
*
sslBioFromNetwork
=
nullptr
;
// The BIO from which ssl reads.
BIO
*
sslBioToNetwork
=
nullptr
;
// The BIO in which ssl writes.
BIO
*
sslBioFromNetwork
=
nullptr
;
// The BIO from which ssl reads.
BIO
*
sslBioToNetwork
=
nullptr
;
// The BIO in which ssl writes.
Timer
*
timer
=
nullptr
;
// Others.
DtlsState
state
=
DtlsState
::
NEW
;
...
...
worker/include/RTC/RtpDictionaries.h
浏览文件 @
b9847aea
...
...
@@ -137,7 +137,7 @@ namespace RTC
class
RtpCodecParameters
{
public
:
RtpCodecParameters
()
{};
// TODO: yes?
RtpCodecParameters
()
{};
// TODO: yes?
RtpCodecParameters
(
Json
::
Value
&
data
,
RTC
::
Scope
scope
);
Json
::
Value
toJson
();
...
...
worker/include/RTC/RtpStream.h
浏览文件 @
b9847aea
...
...
@@ -38,18 +38,18 @@ namespace RTC
void
Dump
();
private
:
bool
started
=
false
;
// Whether at least a RTP packet has been received.
bool
started
=
false
;
// Whether at least a RTP packet has been received.
// https://tools.ietf.org/html/rfc3550#appendix-A.1 stuff.
uint16_t
max_seq
=
0
;
// Highest seq. number seen.
uint32_t
cycles
=
0
;
// Shifted count of seq. number cycles.
uint32_t
base_seq
=
0
;
// Base seq number.
uint32_t
bad_seq
=
0
;
// Last 'bad' seq number + 1.
uint32_t
probation
=
0
;
// Seq. packets till source is valid.
uint32_t
received
=
0
;
// Packets received.
uint16_t
max_seq
=
0
;
// Highest seq. number seen.
uint32_t
cycles
=
0
;
// Shifted count of seq. number cycles.
uint32_t
base_seq
=
0
;
// Base seq number.
uint32_t
bad_seq
=
0
;
// Last 'bad' seq number + 1.
uint32_t
probation
=
0
;
// Seq. packets till source is valid.
uint32_t
received
=
0
;
// Packets received.
uint32_t
expected_prior
=
0
;
// Packet expected at last interval.
uint32_t
received_prior
=
0
;
// Packet received at last interval.
uint32_t
transit
=
0
;
// Relative trans time for prev pkt.
uint32_t
jitter
=
0
;
// Estimated jitter.
uint32_t
transit
=
0
;
// Relative trans time for prev pkt.
uint32_t
jitter
=
0
;
// Estimated jitter.
// Others.
std
::
vector
<
StorageItem
>
storage
;
typedef
std
::
list
<
BufferItem
>
Buffer
;
...
...
worker/include/RTC/TcpConnection.h
浏览文件 @
b9847aea
...
...
@@ -30,7 +30,7 @@ namespace RTC
// Passed by argument.
Listener
*
listener
=
nullptr
;
// Others.
size_t
frameStart
=
0
;
// Where the latest frame starts.
size_t
frameStart
=
0
;
// Where the latest frame starts.
};
}
...
...
worker/include/Utils.h
浏览文件 @
b9847aea
...
...
@@ -3,7 +3,7 @@
#include "common.h"
#include <string>
#include <cstring>
// std::memcmp(), std::memcpy()
#include <cstring> // std::memcmp(), std::memcpy()
#include <openssl/hmac.h>
namespace
Utils
...
...
worker/include/common.h
浏览文件 @
b9847aea
#ifndef MS_COMMON_H
#define MS_COMMON_H
#include <memory>
// std::addressof()
#include <algorithm>
// std::transform(), std::find()
#include <cstddef>
// size_t
#include <cstdint>
// uint8_t, etc
#include <cinttypes>
// PRIu64, etc
#include <sys/socket.h>
// struct sockaddr, struct sockaddr_storage, AF_INET, AF_INET6
#include <netinet/in.h>
// sockaddr_in, sockaddr_in6
#include <arpa/inet.h>
// htonl(), htons(), ntohl(), ntohs()
#include <memory> // std::addressof()
#include <algorithm> // std::transform(), std::find()
#include <cstddef> // size_t
#include <cstdint> // uint8_t, etc
#include <cinttypes> // PRIu64, etc
#include <sys/socket.h> // struct sockaddr, struct sockaddr_storage, AF_INET, AF_INET6
#include <netinet/in.h> // sockaddr_in, sockaddr_in6
#include <arpa/inet.h> // htonl(), htons(), ntohl(), ntohs()
#define MS_APP_NAME "mediasoup"
#define MS_PROCESS_NAME "mediasoup-worker"
#endif
worker/src/DepOpenSSL.cpp
浏览文件 @
b9847aea
...
...
@@ -62,7 +62,7 @@ void DepOpenSSL::ClassDestroy()
// "Brutal" (thread-unsafe) Application-global cleanup functions.
ERR_free_strings
();
EVP_cleanup
();
// Removes all ciphers and digests.
EVP_cleanup
();
// Removes all ciphers and digests.
CRYPTO_cleanup_all_ex_data
();
// https://bugs.launchpad.net/percona-server/+bug/1341067.
...
...
worker/src/RTC/DtlsTransport.cpp
浏览文件 @
b9847aea
...
...
@@ -134,7 +134,7 @@ namespace RTC
goto
error
;
}
ret
=
BN_set_word
(
bne
,
RSA_F4
);
// RSA_F4 == 65537.
ret
=
BN_set_word
(
bne
,
RSA_F4
);
// RSA_F4 == 65537.
if
(
ret
==
0
)
{
LOG_OPENSSL_ERROR
(
"BN_set_word() failed"
);
...
...
@@ -189,8 +189,8 @@ namespace RTC
ASN1_INTEGER_set
(
X509_get_serialNumber
(
DtlsTransport
::
certificate
),
(
long
)
Utils
::
Crypto
::
GetRandomUInt
(
1000000
,
9999999
));
// Set valid period.
X509_gmtime_adj
(
X509_get_notBefore
(
DtlsTransport
::
certificate
),
-
1
*
60
*
60
*
24
*
365
*
10
);
// - 10 years.
X509_gmtime_adj
(
X509_get_notAfter
(
DtlsTransport
::
certificate
),
60
*
60
*
24
*
365
*
10
);
// 10 years.
X509_gmtime_adj
(
X509_get_notBefore
(
DtlsTransport
::
certificate
),
-
1
*
60
*
60
*
24
*
365
*
10
);
// - 10 years.
X509_gmtime_adj
(
X509_get_notAfter
(
DtlsTransport
::
certificate
),
60
*
60
*
24
*
365
*
10
);
// 10 years.
// Set the public key for the certificate using the key.
ret
=
X509_set_pubkey
(
DtlsTransport
::
certificate
,
DtlsTransport
::
privateKey
);
...
...
@@ -236,7 +236,7 @@ namespace RTC
if
(
rsa_key
&&
!
DtlsTransport
::
privateKey
)
RSA_free
(
rsa_key
);
if
(
DtlsTransport
::
privateKey
)
EVP_PKEY_free
(
DtlsTransport
::
privateKey
);
// NOTE: This also frees the RSA key.
EVP_PKEY_free
(
DtlsTransport
::
privateKey
);
// NOTE: This also frees the RSA key.
if
(
DtlsTransport
::
certificate
)
X509_free
(
DtlsTransport
::
certificate
);
...
...
worker/src/RTC/RtpPacket.cpp
浏览文件 @
b9847aea
...
...
@@ -4,7 +4,7 @@
#include "RTC/RtpPacket.h"
#include "Utils.h"
#include "Logger.h"
#include <cstring>
// std::memcmp(),
std::memcpy()
#include <cstring>
//
std::memcpy()
namespace
RTC
{
...
...
worker/src/RTC/StunMessage.cpp
浏览文件 @
b9847aea
...
...
@@ -11,7 +11,7 @@ namespace RTC
{
/* Class variables. */
const
uint8_t
StunMessage
::
magicCookie
[]
=
{
0x21
,
0x12
,
0xA4
,
0x42
};
const
uint8_t
StunMessage
::
magicCookie
[]
=
{
0x21
,
0x12
,
0xA4
,
0x42
};
/* Class methods. */
...
...
worker/src/RTC/Transport.cpp
浏览文件 @
b9847aea
...
...
@@ -399,7 +399,7 @@ namespace RTC
static
const
Json
::
StaticString
k_value
(
"value"
);
RTC
::
DtlsTransport
::
Fingerprint
remoteFingerprint
;
RTC
::
DtlsTransport
::
Role
remoteRole
=
RTC
::
DtlsTransport
::
Role
::
AUTO
;
// Default value if missing.
RTC
::
DtlsTransport
::
Role
remoteRole
=
RTC
::
DtlsTransport
::
Role
::
AUTO
;
// Default value if missing.
// Ensure this method is not called twice.
if
(
this
->
remoteDtlsParametersGiven
)
...
...
worker/src/Settings.cpp
浏览文件 @
b9847aea
...
...
@@ -71,7 +71,7 @@ void Settings::SetConfiguration(int argc, char* argv[])
/* Parse command line options. */
opterr
=
0
;
// Don't allow getopt to print error messages.
opterr
=
0
;
// Don't allow getopt to print error messages.
while
((
c
=
getopt_long_only
(
argc
,
argv
,
""
,
options
,
&
option_index
))
!=
-
1
)
{
if
(
!
optarg
)
...
...
worker/src/Utils/Crypto.cpp
浏览文件 @
b9847aea
...
...
@@ -11,7 +11,7 @@ namespace Utils
uint32_t
Crypto
::
seed
;
HMAC_CTX
Crypto
::
hmacSha1Ctx
;
uint8_t
Crypto
::
hmacSha1Buffer
[
20
];
// SHA-1 result is 20 bytes long.
uint8_t
Crypto
::
hmacSha1Buffer
[
20
];
// SHA-1 result is 20 bytes long.
const
uint32_t
Crypto
::
crc32Table
[]
=
{
0x00000000
,
0x77073096
,
0xee0e612c
,
0x990951ba
,
0x076dc419
,
0x706af48f
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论