正在显示
6 个修改的文件
包含
21 行增加
和
10 行删除
@@ -344,6 +344,7 @@ Remark: | @@ -344,6 +344,7 @@ Remark: | ||
344 | 344 | ||
345 | ### SRS 2.0 history | 345 | ### SRS 2.0 history |
346 | 346 | ||
347 | +* v2.0, 2015-07-21, fix [#435](https://github.com/simple-rtmp-server/srs/issues/435) add pageUrl for HTTP callback on_play. | ||
347 | * v2.0, 2015-07-20, refine the hls, ignore packet when no sequence header. 2.0.179 | 348 | * v2.0, 2015-07-20, refine the hls, ignore packet when no sequence header. 2.0.179 |
348 | * 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 | 349 | * 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 |
349 | * v2.0, 2015-07-14, refine hls disable the time jitter, support not mix monotonically increase. 2.0.177 | 350 | * v2.0, 2015-07-14, refine hls disable the time jitter, support not mix monotonically increase. 2.0.177 |
@@ -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 | } |
-
请 注册 或 登录 后发表评论