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-05-19 15:27:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7c804277b21fa786ed1d0305d0c332fcf68bd837
7c804277
1 parent
98b564ce
add heatbeat url, add stream for api-server
显示空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
39 行增加
和
3 行删除
trunk/conf/full.conf
trunk/research/api-server/server.py
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/conf/full.conf
查看文件 @
7c80427
...
...
@@ -41,6 +41,14 @@ max_connections 1000;
# @remark: donot support reload.
# default: on
daemon
on
;
# heartbeat to api server
# when startup, srs will heartbeat to this api.
# @remark: must be a restful http api url, where SRS will POST with following data:
# {
# "device_id": "my-srs-device",
# "ip": "192.168.1.100"
# }
heartbeat
http
://
127
.
0
.
0
.
1
:
8085
/
api
/
v1
/
servers
;
#############################################################################################
# HTTP sections
...
...
trunk/research/api-server/server.py
查看文件 @
7c80427
...
...
@@ -428,8 +428,8 @@ class RESTServers(object):
return
None
def
__refresh_nodes
(
self
):
has_dead_node
=
False
while
len
(
self
.
__nodes
)
>
0
:
has_dead_node
=
False
for
node
in
self
.
__nodes
:
if
node
.
dead
():
self
.
__nodes
.
remove
(
node
)
...
...
@@ -639,6 +639,22 @@ class RESTServers(object):
"stream6"
:
"http://demo.chnvideo.com:8085/api/v1/servers?id=ingest&action=hls&device_id=chnvideo-meiyi-cubieboard-bk&stream=live/stream6"
,
"stream7"
:
"http://demo.chnvideo.com:8085/api/v1/servers?id=ingest&action=hls&device_id=chnvideo-meiyi-cubieboard-bk&stream=live/stream7"
}
},
"meiyi-dev1"
:
{
"rtmp"
:
{
"livesteam"
:
"http://demo.chnvideo.com:8085/api/v1/servers?id=ingest&action=rtmp&device_id=chnvideo-meiyi-cubieboard-dev1&stream=live/livestream"
},
"hls"
:
{
"livesteam"
:
"http://demo.chnvideo.com:8085/api/v1/servers?id=ingest&action=hls&device_id=chnvideo-meiyi-cubieboard-dev1&stream=live/livestream"
}
},
"meiyi-dev2"
:
{
"rtmp"
:
{
"livesteam"
:
"http://demo.chnvideo.com:8085/api/v1/servers?id=ingest&action=rtmp&device_id=chnvideo-meiyi-cubieboard-dev2&stream=live/livestream"
},
"hls"
:
{
"livesteam"
:
"http://demo.chnvideo.com:8085/api/v1/servers?id=ingest&action=hls&device_id=chnvideo-meiyi-cubieboard-dev2&stream=live/livestream"
}
}
}
}
...
...
@@ -732,8 +748,8 @@ class RESTNodes(object):
return
None
def
__refresh_nodes
(
self
):
has_dead_node
=
False
while
len
(
self
.
__nodes
)
>
0
:
has_dead_node
=
False
for
node
in
self
.
__nodes
:
if
node
.
dead
():
self
.
__nodes
.
remove
(
node
)
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
7c80427
...
...
@@ -509,7 +509,7 @@ int SrsConfig::reload()
//
// always support reload without additional code:
// chunk_size, ff_log_dir, max_connections,
// bandcheck, http_hooks
// bandcheck, http_hooks
, heartbeat
// merge config: listen
if
(
!
srs_directive_equals
(
root
->
get
(
"listen"
),
old_root
->
get
(
"listen"
)))
{
...
...
@@ -1422,6 +1422,17 @@ string SrsConfig::get_pid_file()
return
conf
->
arg0
();
}
string
SrsConfig
::
get_heartbeat_url
()
{
SrsConfDirective
*
conf
=
root
->
get
(
"heartbeat"
);
if
(
!
conf
)
{
return
""
;
}
return
conf
->
arg0
();
}
int
SrsConfig
::
get_pithy_print_publish
()
{
SrsConfDirective
*
pithy
=
root
->
get
(
"pithy_print"
);
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
7c80427
...
...
@@ -173,6 +173,7 @@ public:
virtual
int
get_max_connections
();
virtual
SrsConfDirective
*
get_listen
();
virtual
std
::
string
get_pid_file
();
virtual
std
::
string
get_heartbeat_url
();
virtual
int
get_pithy_print_publish
();
virtual
int
get_pithy_print_forwarder
();
virtual
int
get_pithy_print_encoder
();
...
...
请
注册
或
登录
后发表评论