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 11:15:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b4e2d70390b57590df0ed2545b7b78dba020be01
b4e2d703
1 parent
22937007
refine config comments, return the engines of transcode.
显示空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
43 行增加
和
20 行删除
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_encoder.cpp
trunk/src/app/srs_app_ingest.cpp
trunk/src/app/srs_app_config.cpp
查看文件 @
b4e2d70
...
...
@@ -1932,10 +1932,12 @@ string SrsConfig::get_transcode_ffmpeg(SrsConfDirective* transcode)
return
conf
->
arg0
();
}
v
oid
SrsConfig
::
get_transcode_engines
(
SrsConfDirective
*
transcode
,
vector
<
SrsConfDirective
*>&
engines
)
v
ector
<
SrsConfDirective
*>
SrsConfig
::
get_transcode_engines
(
SrsConfDirective
*
transcode
)
{
vector
<
SrsConfDirective
*>
engines
;
if
(
!
transcode
)
{
return
;
return
engines
;
}
for
(
int
i
=
0
;
i
<
(
int
)
transcode
->
directives
.
size
();
i
++
)
{
...
...
@@ -1946,7 +1948,7 @@ void SrsConfig::get_transcode_engines(SrsConfDirective* transcode, vector<SrsCon
}
}
return
;
return
engines
;
}
bool
SrsConfig
::
get_engine_enabled
(
SrsConfDirective
*
engine
)
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
b4e2d70
...
...
@@ -526,57 +526,80 @@ public:
// bwct(bandwidth check tool) section
public:
/**
*
* whether bw check enabled for vhost.
* if enabled, serve all clients with bandwidth check services.
* oterwise, serve all cleints with stream.
*/
virtual
bool
get_bw_check_enabled
(
std
::
string
vhost
);
/**
*
*
the key of server, if client key mot match, reject.
*/
virtual
std
::
string
get_bw_check_key
(
std
::
string
vhost
);
/**
*
* the check interval, in ms.
* if the client request check in very short time(in the interval),
* SRS will reject client.
* @remark this is used to prevent the bandwidth check attack.
*/
virtual
int
get_bw_check_interval_ms
(
std
::
string
vhost
);
/**
*
* the max kbps that user can test,
* if exceed the kbps, server will slowdown the send-recv.
* @remark this is used to protect the service bandwidth.
*/
virtual
int
get_bw_check_limit_kbps
(
std
::
string
vhost
);
// vhost edge section
public:
/**
*
* whether vhost is edge mode.
* for edge, publish client will be proxyed to upnode,
* for edge, play client will share a connection to get stream from upnode.
*/
virtual
bool
get_vhost_is_edge
(
std
::
string
vhost
);
/**
*
* whether vhost is edge mode.
* for edge, publish client will be proxyed to upnode,
* for edge, play client will share a connection to get stream from upnode.
*/
virtual
bool
get_vhost_is_edge
(
SrsConfDirective
*
vhost
);
/**
*
* get the origin config of edge,
* specifies the origin ip address, port.
*/
virtual
SrsConfDirective
*
get_vhost_edge_origin
(
std
::
string
vhost
);
/**
*
* whether edge token tranverse is enabled,
* if true, edge will send connect origin to verfy the token of client.
* for example, we verify all clients on the origin FMS by server-side as,
* all clients connected to edge must be tranverse to origin to verify.
*/
virtual
bool
get_vhost_edge_token_traverse
(
std
::
string
vhost
);
// vhost transcode section
public:
/**
*
* get the transcode directive of vhost in specified scope.
* @param vhost, the vhost name to get the transcode directive.
* @param scope, the scope, empty to get all. for example, user can transcode
* the app scope stream, by config with app:
* transcode live {...}
* when the scope is "live", this directive is matched.
* the scope can be: empty for all, app, app/stream.
* @remark, please see the samples of full.conf, the app.transcode.srs.com
* and stream.transcode.srs.com.
*/
virtual
SrsConfDirective
*
get_transcode
(
std
::
string
vhost
,
std
::
string
scope
);
/**
*
*
whether the transcode directive is enabled.
*/
virtual
bool
get_transcode_enabled
(
SrsConfDirective
*
transcode
);
/**
*
*
get the ffmpeg tool path of transcode.
*/
virtual
std
::
string
get_transcode_ffmpeg
(
SrsConfDirective
*
transcode
);
/**
*
*
get the engines of transcode.
*/
virtual
void
get_transcode_engines
(
SrsConfDirective
*
transcode
,
std
::
vector
<
SrsConfDirective
*>&
engines
);
virtual
std
::
vector
<
SrsConfDirective
*>
get_transcode_engines
(
SrsConfDirective
*
transcode
);
/**
*
*/
...
...
trunk/src/app/srs_app_encoder.cpp
查看文件 @
b4e2d70
...
...
@@ -224,8 +224,7 @@ int SrsEncoder::parse_ffmpeg(SrsRequest* req, SrsConfDirective* conf)
}
// get all engines.
std
::
vector
<
SrsConfDirective
*>
engines
;
_srs_config
->
get_transcode_engines
(
conf
,
engines
);
std
::
vector
<
SrsConfDirective
*>
engines
=
_srs_config
->
get_transcode_engines
(
conf
);
if
(
engines
.
empty
())
{
srs_trace
(
"ignore the empty transcode engine: %s"
,
conf
->
arg0
().
c_str
());
...
...
trunk/src/app/srs_app_ingest.cpp
查看文件 @
b4e2d70
...
...
@@ -123,8 +123,7 @@ int SrsIngester::parse_engines(SrsConfDirective* vhost, SrsConfDirective* ingest
}
// get all engines.
std
::
vector
<
SrsConfDirective
*>
engines
;
_srs_config
->
get_transcode_engines
(
ingest
,
engines
);
std
::
vector
<
SrsConfDirective
*>
engines
=
_srs_config
->
get_transcode_engines
(
ingest
);
if
(
engines
.
empty
())
{
SrsFFMPEG
*
ffmpeg
=
new
SrsFFMPEG
(
ffmpeg_bin
);
if
((
ret
=
initialize_ffmpeg
(
ffmpeg
,
vhost
,
ingest
,
NULL
))
!=
ERROR_SUCCESS
)
{
...
...
请
注册
或
登录
后发表评论