正在显示
6 个修改的文件
包含
30 行增加
和
19 行删除
| @@ -119,9 +119,9 @@ cd srs/trunk | @@ -119,9 +119,9 @@ cd srs/trunk | ||
| 119 | * Usage: How to delivery RTMP Cluster?([CN][v1_CN_SampleRTMPCluster], [EN][v1_EN_SampleRTMPCluster]) | 119 | * Usage: How to delivery RTMP Cluster?([CN][v1_CN_SampleRTMPCluster], [EN][v1_EN_SampleRTMPCluster]) |
| 120 | * Usage: How to delivery HTTP FLV Live Streaming?([CN][v2_CN_SampleHttpFlv], [EN][v2_EN_SampleHttpFlv]) | 120 | * Usage: How to delivery HTTP FLV Live Streaming?([CN][v2_CN_SampleHttpFlv], [EN][v2_EN_SampleHttpFlv]) |
| 121 | * Usage: How to delivery HTTP FLV Live Streaming Cluster?([CN][v2_CN_SampleHttpFlvCluster], [EN][v2_EN_SampleHttpFlvCluster]) | 121 | * Usage: How to delivery HTTP FLV Live Streaming Cluster?([CN][v2_CN_SampleHttpFlvCluster], [EN][v2_EN_SampleHttpFlvCluster]) |
| 122 | -* Usage: How to delivery HLS?([CN][v1_CN_SampleHLS], [EN][v1_EN_SampleHLS]) | ||
| 123 | -* Usage: How to delivery HLS for other codec?([CN][v1_CN_SampleTranscode2HLS], [EN][v1_EN_SampleTranscode2HLS]) | ||
| 124 | -* Usage: How to transode RTMP stream by SRS?([CN][v1_CN_SampleFFMPEG], [EN][v1_EN_SampleFFMPEG]) | 122 | +* Usage: How to delivery HLS?([CN][v2_CN_SampleHLS], [EN][v2_EN_SampleHLS]) |
| 123 | +* Usage: How to delivery HLS for other codec?([CN][v2_CN_SampleTranscode2HLS], [EN][v2_EN_SampleTranscode2HLS]) | ||
| 124 | +* Usage: How to transode RTMP stream by SRS?([CN][v2_CN_SampleFFMPEG], [EN][v2_EN_SampleFFMPEG]) | ||
| 125 | * Usage: How to forward stream to other server?([CN][v1_CN_SampleForward], [EN][v1_EN_SampleForward]) | 125 | * Usage: How to forward stream to other server?([CN][v1_CN_SampleForward], [EN][v1_EN_SampleForward]) |
| 126 | * Usage: How to deploy low lantency application?([CN][v2_CN_SampleRealtime], [EN][v2_EN_SampleRealtime]) | 126 | * Usage: How to deploy low lantency application?([CN][v2_CN_SampleRealtime], [EN][v2_EN_SampleRealtime]) |
| 127 | * Usage: How to deploy SRS on ARM?([CN][v1_CN_SampleARM], [EN][v1_EN_SampleARM]) | 127 | * Usage: How to deploy SRS on ARM?([CN][v1_CN_SampleARM], [EN][v1_EN_SampleARM]) |
| @@ -348,6 +348,7 @@ Remark: | @@ -348,6 +348,7 @@ Remark: | ||
| 348 | 348 | ||
| 349 | ### SRS 2.0 history | 349 | ### SRS 2.0 history |
| 350 | 350 | ||
| 351 | +* v2.0, 2015-07-21, fix [#435](https://github.com/simple-rtmp-server/srs/issues/435) add pageUrl for HTTP callback on_play. | ||
| 351 | * v2.0, 2015-07-20, refine the hls, ignore packet when no sequence header. 2.0.179 | 352 | * v2.0, 2015-07-20, refine the hls, ignore packet when no sequence header. 2.0.179 |
| 352 | * 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 | 353 | * 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 |
| 353 | * v2.0, 2015-07-14, refine hls disable the time jitter, support not mix monotonically increase. 2.0.177 | 354 | * v2.0, 2015-07-14, refine hls disable the time jitter, support not mix monotonically increase. 2.0.177 |
| @@ -907,12 +908,12 @@ Winlin | @@ -907,12 +908,12 @@ Winlin | ||
| 907 | [v1_EN_SampleRTMP]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMP | 908 | [v1_EN_SampleRTMP]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMP |
| 908 | [v1_CN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleRTMPCluster | 909 | [v1_CN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleRTMPCluster |
| 909 | [v1_EN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMPCluster | 910 | [v1_EN_SampleRTMPCluster]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleRTMPCluster |
| 910 | -[v1_CN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleHLS | ||
| 911 | -[v1_EN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleHLS | ||
| 912 | -[v1_CN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleTranscode2HLS | ||
| 913 | -[v1_EN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleTranscode2HLS | ||
| 914 | -[v1_CN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleFFMPEG | ||
| 915 | -[v1_EN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleFFMPEG | 911 | +[v2_CN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleHLS |
| 912 | +[v2_EN_SampleHLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_EN_SampleHLS | ||
| 913 | +[v2_CN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleTranscode2HLS | ||
| 914 | +[v2_EN_SampleTranscode2HLS]: https://github.com/simple-rtmp-server/srs/wiki/v2_EN_SampleTranscode2HLS | ||
| 915 | +[v2_CN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleFFMPEG | ||
| 916 | +[v2_EN_SampleFFMPEG]: https://github.com/simple-rtmp-server/srs/wiki/v2_EN_SampleFFMPEG | ||
| 916 | [v1_CN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleForward | 917 | [v1_CN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_CN_SampleForward |
| 917 | [v1_EN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleForward | 918 | [v1_EN_SampleForward]: https://github.com/simple-rtmp-server/srs/wiki/v1_EN_SampleForward |
| 918 | [v2_CN_SampleRealtime]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleRealtime | 919 | [v2_CN_SampleRealtime]: https://github.com/simple-rtmp-server/srs/wiki/v2_CN_SampleRealtime |
| @@ -434,7 +434,7 @@ vhost ingest.srs.com { | @@ -434,7 +434,7 @@ vhost ingest.srs.com { | ||
| 434 | # vhost for http static and flv vod stream for each vhost. | 434 | # vhost for http static and flv vod stream for each vhost. |
| 435 | vhost http.static.srs.com { | 435 | vhost http.static.srs.com { |
| 436 | # http static vhost specified config | 436 | # http static vhost specified config |
| 437 | - http { | 437 | + http_static { |
| 438 | # whether enabled the http static service for vhost. | 438 | # whether enabled the http static service for vhost. |
| 439 | # default: off | 439 | # default: off |
| 440 | enabled on; | 440 | enabled on; |
| @@ -707,7 +707,8 @@ vhost hooks.callback.srs.com { | @@ -707,7 +707,8 @@ vhost hooks.callback.srs.com { | ||
| 707 | # { | 707 | # { |
| 708 | # "action": "on_close", | 708 | # "action": "on_close", |
| 709 | # "client_id": 1985, | 709 | # "client_id": 1985, |
| 710 | - # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live" | 710 | + # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", |
| 711 | + # "send_bytes": 10240, "recv_bytes": 10240 | ||
| 711 | # } | 712 | # } |
| 712 | # if valid, the hook must return HTTP code 200(Stauts OK) and response | 713 | # if valid, the hook must return HTTP code 200(Stauts OK) and response |
| 713 | # an int value specifies the error code(0 corresponding to success): | 714 | # an int value specifies the error code(0 corresponding to success): |
| @@ -749,7 +750,8 @@ vhost hooks.callback.srs.com { | @@ -749,7 +750,8 @@ vhost hooks.callback.srs.com { | ||
| 749 | # "action": "on_play", | 750 | # "action": "on_play", |
| 750 | # "client_id": 1985, | 751 | # "client_id": 1985, |
| 751 | # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", | 752 | # "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", |
| 752 | - # "stream": "livestream" | 753 | + # "stream": "livestream", |
| 754 | + # "pageUrl": "http://www.test.com/live.html" | ||
| 753 | # } | 755 | # } |
| 754 | # if valid, the hook must return HTTP code 200(Stauts OK) and response | 756 | # if valid, the hook must return HTTP code 200(Stauts OK) and response |
| 755 | # an int value specifies the error code(0 corresponding to success): | 757 | # an int value specifies the error code(0 corresponding to success): |
| @@ -96,7 +96,8 @@ class RESTClients(object): | @@ -96,7 +96,8 @@ class RESTClients(object): | ||
| 96 | { | 96 | { |
| 97 | "action": "on_close", | 97 | "action": "on_close", |
| 98 | "client_id": 1985, | 98 | "client_id": 1985, |
| 99 | - "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live" | 99 | + "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", |
| 100 | + "send_bytes": 10240, "recv_bytes": 10240 | ||
| 100 | } | 101 | } |
| 101 | if valid, the hook must return HTTP code 200(Stauts OK) and response | 102 | if valid, the hook must return HTTP code 200(Stauts OK) and response |
| 102 | an int value specifies the error code(0 corresponding to success): | 103 | an int value specifies the error code(0 corresponding to success): |
| @@ -145,8 +146,8 @@ class RESTClients(object): | @@ -145,8 +146,8 @@ class RESTClients(object): | ||
| 145 | def __on_close(self, req): | 146 | def __on_close(self, req): |
| 146 | code = Error.success | 147 | code = Error.success |
| 147 | 148 | ||
| 148 | - trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s"%( | ||
| 149 | - req["action"], req["client_id"], req["ip"], req["vhost"], req["app"] | 149 | + trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, send_bytes=%s, recv_bytes=%s"%( |
| 150 | + req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["send_bytes"], req["recv_bytes"] | ||
| 150 | )) | 151 | )) |
| 151 | 152 | ||
| 152 | # TODO: process the on_close event | 153 | # TODO: process the on_close event |
| @@ -450,7 +451,8 @@ class RESTSessions(object): | @@ -450,7 +451,8 @@ class RESTSessions(object): | ||
| 450 | "action": "on_play", | 451 | "action": "on_play", |
| 451 | "client_id": 1985, | 452 | "client_id": 1985, |
| 452 | "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", | 453 | "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live", |
| 453 | - "stream": "livestream" | 454 | + "stream": "livestream", |
| 455 | + "pageUrl": "http://www.test.com/live.html" | ||
| 454 | } | 456 | } |
| 455 | on_stop: | 457 | on_stop: |
| 456 | when client(encoder) stop publish to vhost/app/stream, call the hook, | 458 | when client(encoder) stop publish to vhost/app/stream, call the hook, |
| @@ -497,8 +499,8 @@ class RESTSessions(object): | @@ -497,8 +499,8 @@ class RESTSessions(object): | ||
| 497 | def __on_play(self, req): | 499 | def __on_play(self, req): |
| 498 | code = Error.success | 500 | code = Error.success |
| 499 | 501 | ||
| 500 | - trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, stream=%s"%( | ||
| 501 | - req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["stream"] | 502 | + trace("srs %s: client id=%s, ip=%s, vhost=%s, app=%s, stream=%s, pageUrl=%s"%( |
| 503 | + req["action"], req["client_id"], req["ip"], req["vhost"], req["app"], req["stream"], req["pageUrl"] | ||
| 502 | )) | 504 | )) |
| 503 | 505 | ||
| 504 | # TODO: process the on_play event | 506 | # TODO: process the on_play event |
| @@ -203,7 +203,8 @@ int SrsHttpHooks::on_play(string url, SrsRequest* req) | @@ -203,7 +203,8 @@ int SrsHttpHooks::on_play(string url, SrsRequest* req) | ||
| 203 | << SRS_JFIELD_STR("ip", req->ip) << SRS_JFIELD_CONT | 203 | << SRS_JFIELD_STR("ip", req->ip) << SRS_JFIELD_CONT |
| 204 | << SRS_JFIELD_STR("vhost", req->vhost) << SRS_JFIELD_CONT | 204 | << SRS_JFIELD_STR("vhost", req->vhost) << SRS_JFIELD_CONT |
| 205 | << SRS_JFIELD_STR("app", req->app) << SRS_JFIELD_CONT | 205 | << SRS_JFIELD_STR("app", req->app) << SRS_JFIELD_CONT |
| 206 | - << SRS_JFIELD_STR("stream", req->stream) | 206 | + << SRS_JFIELD_STR("stream", req->stream) << SRS_JFIELD_CONT |
| 207 | + << SRS_JFIELD_STR("pageUrl", req->pageUrl) | ||
| 207 | << SRS_JOBJECT_END; | 208 | << SRS_JOBJECT_END; |
| 208 | 209 | ||
| 209 | std::string data = ss.str(); | 210 | std::string data = ss.str(); |
| @@ -57,6 +57,7 @@ public: | @@ -57,6 +57,7 @@ public: | ||
| 57 | virtual int on_reload_http_stream_disabled(); | 57 | virtual int on_reload_http_stream_disabled(); |
| 58 | virtual int on_reload_http_stream_updated(); | 58 | virtual int on_reload_http_stream_updated(); |
| 59 | public: | 59 | public: |
| 60 | + // TODO: FIXME: should rename to http_static | ||
| 60 | virtual int on_reload_vhost_http_updated(); | 61 | virtual int on_reload_vhost_http_updated(); |
| 61 | virtual int on_reload_vhost_http_remux_updated(std::string vhost); | 62 | virtual int on_reload_vhost_http_remux_updated(std::string vhost); |
| 62 | virtual int on_reload_vhost_added(std::string vhost); | 63 | virtual int on_reload_vhost_added(std::string vhost); |
| @@ -1270,6 +1270,7 @@ int SrsServer::on_reload_vhost_added(std::string vhost) | @@ -1270,6 +1270,7 @@ int SrsServer::on_reload_vhost_added(std::string vhost) | ||
| 1270 | return ret; | 1270 | return ret; |
| 1271 | } | 1271 | } |
| 1272 | 1272 | ||
| 1273 | + // TODO: FIXME: should handle the event in SrsHttpStaticServer | ||
| 1273 | if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { | 1274 | if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { |
| 1274 | return ret; | 1275 | return ret; |
| 1275 | } | 1276 | } |
| @@ -1283,6 +1284,7 @@ int SrsServer::on_reload_vhost_removed(std::string /*vhost*/) | @@ -1283,6 +1284,7 @@ int SrsServer::on_reload_vhost_removed(std::string /*vhost*/) | ||
| 1283 | int ret = ERROR_SUCCESS; | 1284 | int ret = ERROR_SUCCESS; |
| 1284 | 1285 | ||
| 1285 | #ifdef SRS_AUTO_HTTP_SERVER | 1286 | #ifdef SRS_AUTO_HTTP_SERVER |
| 1287 | + // TODO: FIXME: should handle the event in SrsHttpStaticServer | ||
| 1286 | if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { | 1288 | if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { |
| 1287 | return ret; | 1289 | return ret; |
| 1288 | } | 1290 | } |
| @@ -1335,6 +1337,7 @@ int SrsServer::on_reload_http_stream_disabled() | @@ -1335,6 +1337,7 @@ int SrsServer::on_reload_http_stream_disabled() | ||
| 1335 | return ret; | 1337 | return ret; |
| 1336 | } | 1338 | } |
| 1337 | 1339 | ||
| 1340 | +// TODO: FIXME: rename to http_remux | ||
| 1338 | int SrsServer::on_reload_http_stream_updated() | 1341 | int SrsServer::on_reload_http_stream_updated() |
| 1339 | { | 1342 | { |
| 1340 | int ret = ERROR_SUCCESS; | 1343 | int ret = ERROR_SUCCESS; |
| @@ -1344,6 +1347,7 @@ int SrsServer::on_reload_http_stream_updated() | @@ -1344,6 +1347,7 @@ int SrsServer::on_reload_http_stream_updated() | ||
| 1344 | return ret; | 1347 | return ret; |
| 1345 | } | 1348 | } |
| 1346 | 1349 | ||
| 1350 | + // TODO: FIXME: should handle the event in SrsHttpStaticServer | ||
| 1347 | if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { | 1351 | if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { |
| 1348 | return ret; | 1352 | return ret; |
| 1349 | } | 1353 | } |
-
请 注册 或 登录 后发表评论