Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-07-18 10:35:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f572531eca7dee35c34e782ed5b8cc23e172ead6
f572531e
1 parent
96e0e699
refine config, return the vhosts vector.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
33 行增加
和
13 行删除
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_ingest.cpp
trunk/src/app/srs_app_config.cpp
查看文件 @
f572531
...
...
@@ -1412,10 +1412,12 @@ SrsConfDirective* SrsConfig::get_vhost(string vhost)
return
NULL
;
}
v
oid
SrsConfig
::
get_vhosts
(
std
::
vector
<
SrsConfDirective
*>&
vhosts
)
v
ector
<
SrsConfDirective
*>
SrsConfig
::
get_vhosts
(
)
{
srs_assert
(
root
);
std
::
vector
<
SrsConfDirective
*>
vhosts
;
for
(
int
i
=
0
;
i
<
(
int
)
root
->
directives
.
size
();
i
++
)
{
SrsConfDirective
*
conf
=
root
->
at
(
i
);
...
...
@@ -1425,6 +1427,8 @@ void SrsConfig::get_vhosts(std::vector<SrsConfDirective*>& vhosts)
vhosts
.
push_back
(
conf
);
}
return
vhosts
;
}
SrsConfDirective
*
SrsConfig
::
get_vhost_on_connect
(
string
vhost
)
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
f572531
...
...
@@ -366,44 +366,61 @@ public:
*/
virtual
std
::
vector
<
std
::
string
>
get_listen
();
/**
*
* get the pid file path.
* the pid file is used to save the pid of SRS,
* use file lock to prevent multiple SRS starting.
* @remark, if user need to run multiple SRS instance,
* for example, to start multiple SRS for multiple CPUs,
* user can use different pid file for each process.
*/
virtual
std
::
string
get_pid_file
();
/**
*
* get the pithy print interval for publish, in ms,
* the publish(flash/FMLE) message print.
*/
virtual
int
get_pithy_print_publish
();
/**
*
* get the pithy print interval for forwarder, in ms,
* the forwarder message print, for SRS forward stream to other servers.
*/
virtual
int
get_pithy_print_forwarder
();
/**
*
* get the pithy print interval for encoder, in ms,
* the encoder message print, for FFMPEG transcoder.
*/
virtual
int
get_pithy_print_encoder
();
/**
*
* get the pithy print interval for ingester, in ms,
* the ingest used FFMPEG, or your tools, to read and transcode other stream
* to RTMP to SRS.
*/
virtual
int
get_pithy_print_ingester
();
/**
*
* get the pithy print interval for HLS, in ms,
* the HLS used for IOS/android/PC, SRS will mux RTMP to HLS.
*/
virtual
int
get_pithy_print_hls
();
/**
*
* get the pithy print interval for Play, in ms,
* the play is client or edge playing RTMP stream
*/
virtual
int
get_pithy_print_play
();
/**
*
* get the pithy print interval for edge, in ms,
* the edge will get stream from upnode.
*/
virtual
int
get_pithy_print_edge
();
// vhost specified section
public:
/**
* get the vhost directive by vhost name.
* @param vhost, the name of vhost to get.
*/
virtual
SrsConfDirective
*
get_vhost
(
std
::
string
vhost
);
/**
*
*
get all vhosts in config file.
*/
virtual
void
get_vhosts
(
std
::
vector
<
SrsConfDirective
*>&
vhosts
);
virtual
std
::
vector
<
SrsConfDirective
*>
get_vhosts
(
);
/**
*
*/
...
...
trunk/src/app/srs_app_ingest.cpp
查看文件 @
f572531
...
...
@@ -215,8 +215,7 @@ int SrsIngester::parse()
int
ret
=
ERROR_SUCCESS
;
// parse ingesters
std
::
vector
<
SrsConfDirective
*>
vhosts
;
_srs_config
->
get_vhosts
(
vhosts
);
std
::
vector
<
SrsConfDirective
*>
vhosts
=
_srs_config
->
get_vhosts
();
for
(
int
i
=
0
;
i
<
(
int
)
vhosts
.
size
();
i
++
)
{
SrsConfDirective
*
vhost
=
vhosts
[
i
];
...
...
请
注册
或
登录
后发表评论