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-04-25 15:27:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d6948d613f528aefaa6c1dbeffbd424e2293c107
d6948d61
1 parent
f3b441ba
add author byteman for h264 to flv.
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
48 行增加
和
2 行删除
AUTHORS.txt
trunk/conf/full.conf
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
AUTHORS.txt
查看文件 @
d6948d6
...
...
@@ -5,3 +5,4 @@ Authors ordered by first contribution.
* xiangcheng.liu<liuxc0116@foxmail.com>
* naijia.liu<youngcow@youngcow.net>
* alcoholyi<alcoholyi@qq.com>
* byteman<wangchen2011@gmail.com>
...
...
trunk/conf/full.conf
查看文件 @
d6948d6
...
...
@@ -91,6 +91,30 @@ http_stream {
vhost
__
defaultVhost__
{
}
# vhost for edge, edge and origin is the same vhost
vhost
same
.
edge
.
srs
.
com
{
# the mode of vhost, local or remote.
# local: vhost is origin vhost, which provides stream source.
# remote: vhost is edge vhost, which pull/push to origin.
# default: local
mode
remote
;
# for edge(remote mode), user must specifies the origin server
# format as: <server_name|ip>[:port]
# @remark user can specifies multiple origin for error backup, by space,
# for example, 192.168.1.100:1935 192.168.1.101:1935 192.168.1.102:1935
origin
127
.
0
.
0
.
1
:
1935
localhost
:
1935
;
}
# vhost for edge, chnage vhost.
vhost
change
.
edge
.
srs
.
com
{
mode
remote
;
origin
127
.
0
.
0
.
1
:
1935
localhost
:
1935
{
# specify the vhost to override the vhost in client request.
vhost
edge2
.
srs
.
com
;
# specify the refer(pageUrl) to override the refer in client request.
refer
http
://
srs
/
index
.
html
;
}
}
# vhost for dvr
vhost
dvr
.
srs
.
com
{
# dvr RTMP stream to file,
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
d6948d6
...
...
@@ -1805,6 +1805,22 @@ int SrsConfig::get_bw_check_limit_kbps(const string &vhost)
return
::
atoi
(
conf
->
arg0
().
c_str
());
}
bool
SrsConfig
::
get_vhost_is_edge
(
std
::
string
vhost
)
{
SrsConfDirective
*
conf
=
get_vhost
(
vhost
);
if
(
!
conf
)
{
return
false
;
}
conf
=
conf
->
get
(
"mode"
);
if
(
!
conf
||
conf
->
arg0
()
!=
"remote"
)
{
return
false
;
}
return
true
;
}
SrsConfDirective
*
SrsConfig
::
get_transcode
(
string
vhost
,
string
scope
)
{
SrsConfDirective
*
conf
=
get_vhost
(
vhost
);
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
d6948d6
...
...
@@ -163,7 +163,7 @@ public:
virtual
int
get_pithy_print_ingester
();
virtual
int
get_pithy_print_hls
();
virtual
int
get_pithy_print_play
();
// vhost section
// vhost s
pecified s
ection
public:
virtual
SrsConfDirective
*
get_vhost
(
std
::
string
vhost
);
virtual
void
get_vhosts
(
std
::
vector
<
SrsConfDirective
*>&
vhosts
);
...
...
@@ -190,6 +190,9 @@ public:
virtual
std
::
string
get_bw_check_key
(
const
std
::
string
&
vhost
);
virtual
int
get_bw_check_interval_ms
(
const
std
::
string
&
vhost
);
virtual
int
get_bw_check_limit_kbps
(
const
std
::
string
&
vhost
);
// vhost edge section
public:
virtual
bool
get_vhost_is_edge
(
std
::
string
vhost
);
// vhost transcode section
public:
virtual
SrsConfDirective
*
get_transcode
(
std
::
string
vhost
,
std
::
string
scope
);
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
d6948d6
...
...
@@ -286,8 +286,10 @@ int SrsRtmpConn::stream_service_cycle()
return
ret
;
}
bool
vhost_is_edge
=
_srs_config
->
get_vhost_is_edge
(
req
->
vhost
);
bool
enabled_cache
=
_srs_config
->
get_gop_cache
(
req
->
vhost
);
srs_trace
(
"source found, url=%s, enabled_cache=%d"
,
req
->
get_stream_url
().
c_str
(),
enabled_cache
);
srs_trace
(
"source found, url=%s, enabled_cache=%d, edge=%d"
,
req
->
get_stream_url
().
c_str
(),
enabled_cache
,
vhost_is_edge
);
source
->
set_cache
(
enabled_cache
);
switch
(
type
)
{
...
...
请
注册
或
登录
后发表评论