Merge branch '2.0release' into develop

pull/499/head
winlin 10 years ago
commit 48c040c92b

@ -119,9 +119,9 @@ cd srs/trunk
* Usage: How to delivery RTMP Cluster?([CN][v1_CN_SampleRTMPCluster], [EN][v1_EN_SampleRTMPCluster]) * Usage: How to delivery RTMP Cluster?([CN][v1_CN_SampleRTMPCluster], [EN][v1_EN_SampleRTMPCluster])
* Usage: How to delivery HTTP FLV Live Streaming?([CN][v2_CN_SampleHttpFlv], [EN][v2_EN_SampleHttpFlv]) * Usage: How to delivery HTTP FLV Live Streaming?([CN][v2_CN_SampleHttpFlv], [EN][v2_EN_SampleHttpFlv])
* Usage: How to delivery HTTP FLV Live Streaming Cluster?([CN][v2_CN_SampleHttpFlvCluster], [EN][v2_EN_SampleHttpFlvCluster]) * Usage: How to delivery HTTP FLV Live Streaming Cluster?([CN][v2_CN_SampleHttpFlvCluster], [EN][v2_EN_SampleHttpFlvCluster])
* Usage: How to delivery HLS?([CN][v1_CN_SampleHLS], [EN][v1_EN_SampleHLS]) * Usage: How to delivery HLS?([CN][v2_CN_SampleHLS], [EN][v2_EN_SampleHLS])
* Usage: How to delivery HLS for other codec?([CN][v1_CN_SampleTranscode2HLS], [EN][v1_EN_SampleTranscode2HLS]) * Usage: How to delivery HLS for other codec?([CN][v2_CN_SampleTranscode2HLS], [EN][v2_EN_SampleTranscode2HLS])
* Usage: How to transode RTMP stream by SRS?([CN][v1_CN_SampleFFMPEG], [EN][v1_EN_SampleFFMPEG]) * Usage: How to transode RTMP stream by SRS?([CN][v2_CN_SampleFFMPEG], [EN][v2_EN_SampleFFMPEG])
* Usage: How to forward stream to other server?([CN][v1_CN_SampleForward], [EN][v1_EN_SampleForward]) * Usage: How to forward stream to other server?([CN][v1_CN_SampleForward], [EN][v1_EN_SampleForward])
* Usage: How to deploy low lantency application?([CN][v2_CN_SampleRealtime], [EN][v2_EN_SampleRealtime]) * Usage: How to deploy low lantency application?([CN][v2_CN_SampleRealtime], [EN][v2_EN_SampleRealtime])
* Usage: How to deploy SRS on ARM?([CN][v1_CN_SampleARM], [EN][v1_EN_SampleARM]) * Usage: How to deploy SRS on ARM?([CN][v1_CN_SampleARM], [EN][v1_EN_SampleARM])
@ -348,6 +348,7 @@ Remark:
### SRS 2.0 history ### SRS 2.0 history
* v2.0, 2015-07-21, fix [#435](https://github.com/simple-rtmp-server/srs/issues/435) add pageUrl for HTTP callback on_play.
* v2.0, 2015-07-20, refine the hls, ignore packet when no sequence header. 2.0.179 * v2.0, 2015-07-20, refine the hls, ignore packet when no sequence header. 2.0.179
* v2.0, 2015-07-16, for [#441](https://github.com/simple-rtmp-server/srs/issues/441) use 30s timeout for first msg. 2.0.178 * v2.0, 2015-07-16, for [#441](https://github.com/simple-rtmp-server/srs/issues/441) use 30s timeout for first msg. 2.0.178
* v2.0, 2015-07-14, refine hls disable the time jitter, support not mix monotonically increase. 2.0.177 * v2.0, 2015-07-14, refine hls disable the time jitter, support not mix monotonically increase. 2.0.177
@ -907,12 +908,12 @@ Winlin
[v1_EN_SampleRTMP]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMP [v1_EN_SampleRTMP]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMP
[v1_CN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleRTMPCluster [v1_CN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleRTMPCluster
[v1_EN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMPCluster [v1_EN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMPCluster
[v1_CN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleHLS [v2_CN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleHLS
[v1_EN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleHLS [v2_EN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_EN_SampleHLS
[v1_CN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleTranscode2HLS [v2_CN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleTranscode2HLS
[v1_EN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleTranscode2HLS [v2_EN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_EN_SampleTranscode2HLS
[v1_CN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleFFMPEG [v2_CN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleFFMPEG
[v1_EN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleFFMPEG [v2_EN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v2_EN_SampleFFMPEG
[v1_CN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleForward [v1_CN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleForward
[v1_EN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleForward [v1_EN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleForward
[v2_CN_SampleRealtime]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleRealtime [v2_CN_SampleRealtime]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleRealtime

@ -434,7 +434,7 @@ vhost ingest.srs.com {
# vhost for http static and flv vod stream for each vhost. # vhost for http static and flv vod stream for each vhost.
vhost http.static.srs.com { vhost http.static.srs.com {
# http static vhost specified config # http static vhost specified config
http { http_static {
# whether enabled the http static service for vhost. # whether enabled the http static service for vhost.
# default: off # default: off
enabled on; enabled on;
@ -707,7 +707,8 @@ vhost hooks.callback.srs.com {
# { # {
# "action": "on_close", # "action": "on_close",
# "client_id": 1985, # "client_id": 1985,
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live" # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
# "send_bytes": 10240, "recv_bytes": 10240
# } # }
# if valid, the hook must return HTTP code 200(Stauts OK) and response # if valid, the hook must return HTTP code 200(Stauts OK) and response
# an int value specifies the error code(0 corresponding to success): # an int value specifies the error code(0 corresponding to success):
@ -749,7 +750,8 @@ vhost hooks.callback.srs.com {
# "action": "on_play", # "action": "on_play",
# "client_id": 1985, # "client_id": 1985,
# "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
# "stream": "livestream" # "stream": "livestream",
# "pageUrl": "http://www.test.com/live.html"
# } # }
# if valid, the hook must return HTTP code 200(Stauts OK) and response # if valid, the hook must return HTTP code 200(Stauts OK) and response
# an int value specifies the error code(0 corresponding to success): # an int value specifies the error code(0 corresponding to success):

@ -96,7 +96,8 @@ class RESTClients(object):
{ {
"action": "on_close", "action": "on_close",
"client_id": 1985, "client_id": 1985,
"ip": "192.168.1.10", "vhost": "video.test.com", "app": "live" "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
"send_bytes": 10240, "recv_bytes": 10240
} }
if valid, the hook must return HTTP code 200(Stauts OK) and response if valid, the hook must return HTTP code 200(Stauts OK) and response
an int value specifies the error code(0 corresponding to success): an int value specifies the error code(0 corresponding to success):
@ -145,8 +146,8 @@ class RESTClients(object):
def __on_close(self, req): def __on_close(self, req):
code = Error.success code = Error.success
trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s"%( trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, send_bytes=%s, recv_bytes=%s"%(
req["action"], req["client_id"], req["ip"], req["vhost"], req["app"] req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["send_bytes"], req["recv_bytes"]
)) ))
# TODO: process the on_close event # TODO: process the on_close event
@ -450,7 +451,8 @@ class RESTSessions(object):
"action": "on_play", "action": "on_play",
"client_id": 1985, "client_id": 1985,
"ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
"stream": "livestream" "stream": "livestream",
"pageUrl": "http://www.test.com/live.html"
} }
on_stop: on_stop:
when client(encoder) stop publish to vhost/app/stream, call the hook, when client(encoder) stop publish to vhost/app/stream, call the hook,
@ -497,8 +499,8 @@ class RESTSessions(object):
def __on_play(self, req): def __on_play(self, req):
code = Error.success code = Error.success
trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, stream=%s"%( trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, stream=%s, pageUrl=%s"%(
req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["stream"] req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["stream"], req["pageUrl"]
)) ))
# TODO: process the on_play event # TODO: process the on_play event

@ -203,7 +203,8 @@ int SrsHttpHooks::on_play(string url, SrsRequest* req)
<< SRS_JFIELD_STR("ip", req->ip) << SRS_JFIELD_CONT << SRS_JFIELD_STR("ip", req->ip) << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("vhost", req->vhost) << SRS_JFIELD_CONT << SRS_JFIELD_STR("vhost", req->vhost) << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("app", req->app) << SRS_JFIELD_CONT << SRS_JFIELD_STR("app", req->app) << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("stream", req->stream) << SRS_JFIELD_STR("stream", req->stream) << SRS_JFIELD_CONT
<< SRS_JFIELD_STR("pageUrl", req->pageUrl)
<< SRS_JOBJECT_END; << SRS_JOBJECT_END;
std::string data = ss.str(); std::string data = ss.str();

@ -57,6 +57,7 @@ public:
virtual int on_reload_http_stream_disabled(); virtual int on_reload_http_stream_disabled();
virtual int on_reload_http_stream_updated(); virtual int on_reload_http_stream_updated();
public: public:
// TODO: FIXME: should rename to http_static
virtual int on_reload_vhost_http_updated(); virtual int on_reload_vhost_http_updated();
virtual int on_reload_vhost_http_remux_updated(std::string vhost); virtual int on_reload_vhost_http_remux_updated(std::string vhost);
virtual int on_reload_vhost_added(std::string vhost); virtual int on_reload_vhost_added(std::string vhost);

@ -1270,6 +1270,7 @@ int SrsServer::on_reload_vhost_added(std::string vhost)
return ret; return ret;
} }
// TODO: FIXME: should handle the event in SrsHttpStaticServer
if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) {
return ret; return ret;
} }
@ -1283,6 +1284,7 @@ int SrsServer::on_reload_vhost_removed(std::string /*vhost*/)
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_AUTO_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
// TODO: FIXME: should handle the event in SrsHttpStaticServer
if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) {
return ret; return ret;
} }
@ -1335,6 +1337,7 @@ int SrsServer::on_reload_http_stream_disabled()
return ret; return ret;
} }
// TODO: FIXME: rename to http_remux
int SrsServer::on_reload_http_stream_updated() int SrsServer::on_reload_http_stream_updated()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
@ -1344,6 +1347,7 @@ int SrsServer::on_reload_http_stream_updated()
return ret; return ret;
} }
// TODO: FIXME: should handle the event in SrsHttpStaticServer
if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) {
return ret; return ret;
} }

Loading…
Cancel
Save