for #319, api raw update global.listen

pull/556/head
winlin 10 years ago
parent 364460f2ab
commit a62c82bd46

@ -44,87 +44,69 @@ stream_caster {
rtp_port_min 57200; rtp_port_min 57200;
rtp_port_max 57300; rtp_port_max 57300;
} }
vhost __defaultVhost__ { vhost __defaultVhost__;
}
vhost vhost.srs.com { vhost vhost.srs.com {
enabled off; enabled off;
chunk_size 128; chunk_size 128;
tcp_nodelay on; tcp_nodelay on;
min_latency on; min_latency on;
cluster { cluster {
mode remote; mode remote;
origin 127.0.0.1:1935 localhost:1935; origin 127.0.0.1:1935 localhost:1935;
token_traverse off; token_traverse off;
vhost same.edge.srs.com; vhost same.edge.srs.com;
debug_srs_upnode off; debug_srs_upnode off;
} }
forward { forward {
enabled off; enabled off;
destination 127.0.0.1:1936 127.0.0.1:1937; destination 127.0.0.1:1936 127.0.0.1:1937;
} }
play { play {
time_jitter full; time_jitter full;
mix_correct off; mix_correct off;
atc off; atc off;
atc_auto off; atc_auto off;
mw_latency 100; mw_latency 100;
gop_cache off; gop_cache off;
queue_length 10; queue_length 10;
send_min_interval 10.0; send_min_interval 10.0;
reduce_sequence_header on; reduce_sequence_header on;
} }
publish { publish {
mr off; mr off;
mr_latency 350; mr_latency 350;
firstpkt_timeout 20000; firstpkt_timeout 20000;
normal_timeout 7000; normal_timeout 7000;
} }
refer { refer {
enabled off; enabled off;
all github.com github.io; all github.com github.io;
publish github.com github.io; publish github.com github.io;
play github.com github.io; play github.com github.io;
} }
bandcheck { bandcheck {
enabled off; enabled off;
key 35c9b402c12a7246868752e2878f7e0e; key 35c9b402c12a7246868752e2878f7e0e;
interval 30; interval 30;
limit_kbps 4000; limit_kbps 4000;
} }
security { security {
enabled off; enabled off;
allow play all; allow play all;
allow publish all; allow publish all;
deny publish all; deny publish all;
} }
http_static { http_static {
enabled off; enabled off;
mount [vhost]/hls; mount [vhost]/hls;
dir ./objs/nginx/html/hls; dir ./objs/nginx/html/hls;
} }
http_remux { http_remux {
enabled off; enabled off;
fast_cache 30; fast_cache 30;
mount [vhost]/[app]/[stream].flv; mount [vhost]/[app]/[stream].flv;
hstrs on; hstrs on;
} }
http_hooks { http_hooks {
enabled off; enabled off;
on_connect http://127.0.0.1:8085/api/v1/clients http://localhost:8085/api/v1/clients; on_connect http://127.0.0.1:8085/api/v1/clients http://localhost:8085/api/v1/clients;
@ -137,12 +119,10 @@ vhost vhost.srs.com {
on_hls http://127.0.0.1:8085/api/v1/hls http://localhost:8085/api/v1/hls; on_hls http://127.0.0.1:8085/api/v1/hls http://localhost:8085/api/v1/hls;
on_hls_notify http://127.0.0.1:8085/api/v1/hls/[app]/[stream][ts_url]; on_hls_notify http://127.0.0.1:8085/api/v1/hls/[app]/[stream][ts_url];
} }
exec { exec {
enabled off; enabled off;
publish ./objs/ffmpeg/bin/ffmpeg -f flv -i [url] -c copy -y ./[stream].flv; publish ./objs/ffmpeg/bin/ffmpeg -f flv -i [url] -c copy -y ./[stream].flv;
} }
hls { hls {
enabled off; enabled off;
hls_fragment 10; hls_fragment 10;
@ -164,14 +144,12 @@ vhost vhost.srs.com {
hls_nb_notify 64; hls_nb_notify 64;
hls_wait_keyframe on; hls_wait_keyframe on;
} }
hds { hds {
enabled off; enabled off;
hds_fragment 10; hds_fragment 10;
hds_window 60; hds_window 60;
hds_path ./objs/nginx/html; hds_path ./objs/nginx/html;
} }
dvr { dvr {
enabled off; enabled off;
dvr_plan session; dvr_plan session;
@ -180,7 +158,6 @@ vhost vhost.srs.com {
dvr_wait_keyframe on; dvr_wait_keyframe on;
time_jitter full; time_jitter full;
} }
ingest livestream { ingest livestream {
enabled off; enabled off;
input { input {
@ -221,7 +198,6 @@ vhost vhost.srs.com {
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]; output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream];
} }
} }
transcode live { transcode live {
enabled off; enabled off;
ffmpeg ./objs/ffmpeg/bin/ffmpeg; ffmpeg ./objs/ffmpeg/bin/ffmpeg;
@ -258,7 +234,6 @@ vhost vhost.srs.com {
output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine]; output rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
} }
} }
transcode { transcode {
enabled off; enabled off;
ffmpeg ./objs/ffmpeg/bin/ffmpeg; ffmpeg ./objs/ffmpeg/bin/ffmpeg;

@ -2182,6 +2182,17 @@ int SrsConfig::raw_set_listen(const vector<string>& eps)
SrsConfDirective* listen = root->get("listen"); SrsConfDirective* listen = root->get("listen");
listen->args = eps; listen->args = eps;
// force to reload the memory server.
vector<ISrsReloadHandler*>::iterator it;
for (it = subscribes.begin(); it != subscribes.end(); ++it) {
ISrsReloadHandler* subscribe = *it;
if ((ret = subscribe->on_reload_listen()) != ERROR_SUCCESS) {
srs_error("notify subscribes reload listen failed. ret=%d", ret);
return ret;
}
}
srs_trace("reload listen success.");
return ret; return ret;
} }

@ -1016,7 +1016,6 @@ int SrsGoApiRaw::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
} }
} }
server->on_signal(SRS_SIGNAL_RELOAD);
server->on_signal(SRS_SIGNAL_PERSISTENCE_CONFIG); server->on_signal(SRS_SIGNAL_PERSISTENCE_CONFIG);
srs_trace("raw api update %s=%s ok.", scope.c_str(), value.c_str()); srs_trace("raw api update %s=%s ok.", scope.c_str(), value.c_str());

Loading…
Cancel
Save