Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
d065ad7a
提交
d065ad7a
authored
1月 13, 2017
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into test-rtp
上级
5962937e
563efeaf
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
32 行增加
和
34 行删除
+32
-34
Logger.h
worker/include/Logger.h
+2
-2
Settings.h
worker/include/Settings.h
+17
-18
Settings.cpp
worker/src/Settings.cpp
+13
-14
没有找到文件。
worker/include/Logger.h
浏览文件 @
d065ad7a
...
@@ -66,8 +66,8 @@
...
@@ -66,8 +66,8 @@
#include <cstdlib> // std::abort()
#include <cstdlib> // std::abort()
#define MS_LOGGER_BUFFER_SIZE 10000
#define MS_LOGGER_BUFFER_SIZE 10000
#define _MS_TAG_ENABLED(tag) Settings::logTags.tag
#define _MS_TAG_ENABLED(tag) Settings::
configuration.
logTags.tag
#define _MS_TAG_ENABLED_2(tag1, tag2) (Settings::
logTags.tag1 || Settings::
logTags.tag2)
#define _MS_TAG_ENABLED_2(tag1, tag2) (Settings::
configuration.logTags.tag1 || Settings::configuration.
logTags.tag2)
#ifdef MS_LOG_DEV
#ifdef MS_LOG_DEV
#define _MS_LOG_DEV_ENABLED true
#define _MS_LOG_DEV_ENABLED true
#else
#else
...
...
worker/include/Settings.h
浏览文件 @
d065ad7a
...
@@ -11,23 +11,6 @@
...
@@ -11,23 +11,6 @@
class
Settings
class
Settings
{
{
public
:
public
:
// Struct holding the configuration.
struct
Configuration
{
LogLevel
logLevel
{
LogLevel
::
LOG_DEBUG
};
std
::
string
rtcListenIPv4
;
std
::
string
rtcListenIPv6
;
uint16_t
rtcMinPort
{
10000
};
uint16_t
rtcMaxPort
{
59999
};
std
::
string
dtlsCertificateFile
;
std
::
string
dtlsPrivateKeyFile
;
// Private fields.
bool
hasIPv4
{
false
};
bool
hasIPv6
{
false
};
};
public
:
// Log tags.
struct
LogTags
struct
LogTags
{
{
bool
info
{
false
};
bool
info
{
false
};
...
@@ -39,6 +22,23 @@ public:
...
@@ -39,6 +22,23 @@ public:
// TODO: Add more tags (here and in Settings.cpp).
// TODO: Add more tags (here and in Settings.cpp).
};
};
public
:
// Struct holding the configuration.
struct
Configuration
{
LogLevel
logLevel
{
LogLevel
::
LOG_DEBUG
};
struct
LogTags
logTags
;
std
::
string
rtcListenIPv4
;
std
::
string
rtcListenIPv6
;
uint16_t
rtcMinPort
{
10000
};
uint16_t
rtcMaxPort
{
59999
};
std
::
string
dtlsCertificateFile
;
std
::
string
dtlsPrivateKeyFile
;
// Private fields.
bool
hasIPv4
{
false
};
bool
hasIPv6
{
false
};
};
public
:
public
:
static
void
SetConfiguration
(
int
argc
,
char
*
argv
[]);
static
void
SetConfiguration
(
int
argc
,
char
*
argv
[]);
static
void
PrintConfiguration
();
static
void
PrintConfiguration
();
...
@@ -56,7 +56,6 @@ private:
...
@@ -56,7 +56,6 @@ private:
public
:
public
:
static
struct
Configuration
configuration
;
static
struct
Configuration
configuration
;
static
struct
LogTags
logTags
;
private
:
private
:
static
std
::
map
<
std
::
string
,
LogLevel
>
string2LogLevel
;
static
std
::
map
<
std
::
string
,
LogLevel
>
string2LogLevel
;
...
...
worker/src/Settings.cpp
浏览文件 @
d065ad7a
...
@@ -22,7 +22,6 @@ bool IsBindableIP(const std::string &ip, int family, int* _bind_err);
...
@@ -22,7 +22,6 @@ bool IsBindableIP(const std::string &ip, int family, int* _bind_err);
/* Class variables. */
/* Class variables. */
struct
Settings
::
Configuration
Settings
::
configuration
;
struct
Settings
::
Configuration
Settings
::
configuration
;
struct
Settings
::
LogTags
Settings
::
logTags
;
std
::
map
<
std
::
string
,
LogLevel
>
Settings
::
string2LogLevel
=
std
::
map
<
std
::
string
,
LogLevel
>
Settings
::
string2LogLevel
=
{
{
{
"debug"
,
LogLevel
::
LOG_DEBUG
},
{
"debug"
,
LogLevel
::
LOG_DEBUG
},
...
@@ -157,17 +156,17 @@ void Settings::PrintConfiguration()
...
@@ -157,17 +156,17 @@ void Settings::PrintConfiguration()
std
::
vector
<
std
::
string
>
log_tags
;
std
::
vector
<
std
::
string
>
log_tags
;
if
(
Settings
::
logTags
.
info
)
if
(
Settings
::
configuration
.
logTags
.
info
)
log_tags
.
push_back
(
"info"
);
log_tags
.
push_back
(
"info"
);
if
(
Settings
::
logTags
.
ice
)
if
(
Settings
::
configuration
.
logTags
.
ice
)
log_tags
.
push_back
(
"ice"
);
log_tags
.
push_back
(
"ice"
);
if
(
Settings
::
logTags
.
dtls
)
if
(
Settings
::
configuration
.
logTags
.
dtls
)
log_tags
.
push_back
(
"dtls"
);
log_tags
.
push_back
(
"dtls"
);
if
(
Settings
::
logTags
.
rtp
)
if
(
Settings
::
configuration
.
logTags
.
rtp
)
log_tags
.
push_back
(
"rtp"
);
log_tags
.
push_back
(
"rtp"
);
if
(
Settings
::
logTags
.
srtp
)
if
(
Settings
::
configuration
.
logTags
.
srtp
)
log_tags
.
push_back
(
"srtp"
);
log_tags
.
push_back
(
"srtp"
);
if
(
Settings
::
logTags
.
rtcp
)
if
(
Settings
::
configuration
.
logTags
.
rtcp
)
log_tags
.
push_back
(
"rtcp"
);
log_tags
.
push_back
(
"rtcp"
);
MS_DEBUG_TAG
(
info
,
"<configuration>"
);
MS_DEBUG_TAG
(
info
,
"<configuration>"
);
...
@@ -472,22 +471,22 @@ void Settings::SetLogTags(std::vector<std::string>& tags)
...
@@ -472,22 +471,22 @@ void Settings::SetLogTags(std::vector<std::string>& tags)
// Reset logTags.
// Reset logTags.
struct
LogTags
newLogTags
;
struct
LogTags
newLogTags
;
Settings
::
logTags
=
newLogTags
;
Settings
::
configuration
.
logTags
=
newLogTags
;
for
(
auto
&
tag
:
tags
)
for
(
auto
&
tag
:
tags
)
{
{
if
(
tag
==
"info"
)
if
(
tag
==
"info"
)
Settings
::
logTags
.
info
=
true
;
Settings
::
configuration
.
logTags
.
info
=
true
;
else
if
(
tag
==
"ice"
)
else
if
(
tag
==
"ice"
)
Settings
::
logTags
.
ice
=
true
;
Settings
::
configuration
.
logTags
.
ice
=
true
;
else
if
(
tag
==
"dtls"
)
else
if
(
tag
==
"dtls"
)
Settings
::
logTags
.
dtls
=
true
;
Settings
::
configuration
.
logTags
.
dtls
=
true
;
else
if
(
tag
==
"rtp"
)
else
if
(
tag
==
"rtp"
)
Settings
::
logTags
.
rtp
=
true
;
Settings
::
configuration
.
logTags
.
rtp
=
true
;
else
if
(
tag
==
"srtp"
)
else
if
(
tag
==
"srtp"
)
Settings
::
logTags
.
srtp
=
true
;
Settings
::
configuration
.
logTags
.
srtp
=
true
;
else
if
(
tag
==
"rtcp"
)
else
if
(
tag
==
"rtcp"
)
Settings
::
logTags
.
rtcp
=
true
;
Settings
::
configuration
.
logTags
.
rtcp
=
true
;
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论