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
2015-07-21 10:50:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
31d2de3f23871de583ba1bfc5dbec9d857872673
31d2de3f
1 parent
b54f9b0f
fix #435, add pageUrl for HTTP callback on_play.
显示空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
21 行增加
和
10 行删除
README.md
trunk/conf/full.conf
trunk/research/api-server/server.py
trunk/src/app/srs_app_http_hooks.cpp
trunk/src/app/srs_app_reload.hpp
trunk/src/app/srs_app_server.cpp
README.md
查看文件 @
31d2de3
...
...
@@ -344,6 +344,7 @@ Remark:
### 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-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
...
...
trunk/conf/full.conf
查看文件 @
31d2de3
...
...
@@ -434,7 +434,7 @@ vhost ingest.srs.com {
# vhost for http static and flv vod stream for each vhost.
vhost
http
.
static
.
srs
.
com
{
# http static vhost specified config
http
{
http
_static
{
# whether enabled the http static service for vhost.
# default: off
enabled
on
;
...
...
@@ -707,7 +707,8 @@ vhost hooks.callback.srs.com {
# {
# "action": "on_close",
# "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
# an int value specifies the error code(0 corresponding to success):
...
...
@@ -749,7 +750,8 @@ vhost hooks.callback.srs.com {
# "action": "on_play",
# "client_id": 1985,
# "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
# an int value specifies the error code(0 corresponding to success):
...
...
trunk/research/api-server/server.py
查看文件 @
31d2de3
...
...
@@ -96,7 +96,8 @@ class RESTClients(object):
{
"action": "on_close",
"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
an int value specifies the error code(0 corresponding to success):
...
...
@@ -145,8 +146,8 @@ class RESTClients(object):
def
__on_close
(
self
,
req
):
code
=
Error
.
success
trace
(
"srs
%
s: client id=
%
s, ip=
%
s, vhost=
%
s, app=
%
s"
%
(
req
[
"action"
],
req
[
"client_id"
],
req
[
"ip"
],
req
[
"vhost"
],
req
[
"app"
]
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
[
"send_bytes"
],
req
[
"recv_bytes"
]
))
# TODO: process the on_close event
...
...
@@ -450,7 +451,8 @@ class RESTSessions(object):
"action": "on_play",
"client_id": 1985,
"ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
"stream": "livestream"
"stream": "livestream",
"pageUrl": "http://www.test.com/live.html"
}
on_stop:
when client(encoder) stop publish to vhost/app/stream, call the hook,
...
...
@@ -497,8 +499,8 @@ class RESTSessions(object):
def
__on_play
(
self
,
req
):
code
=
Error
.
success
trace
(
"srs
%
s: client id=
%
s, ip=
%
s, vhost=
%
s, app=
%
s, stream=
%
s"
%
(
req
[
"action"
],
req
[
"client_id"
],
req
[
"ip"
],
req
[
"vhost"
],
req
[
"app"
],
req
[
"stream"
]
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
[
"pageUrl"
]
))
# TODO: process the on_play event
...
...
trunk/src/app/srs_app_http_hooks.cpp
查看文件 @
31d2de3
...
...
@@ -203,7 +203,8 @@ int SrsHttpHooks::on_play(string url, SrsRequest* req)
<<
SRS_JFIELD_STR
(
"ip"
,
req
->
ip
)
<<
SRS_JFIELD_CONT
<<
SRS_JFIELD_STR
(
"vhost"
,
req
->
vhost
)
<<
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
;
std
::
string
data
=
ss
.
str
();
...
...
trunk/src/app/srs_app_reload.hpp
查看文件 @
31d2de3
...
...
@@ -57,6 +57,7 @@ public:
virtual
int
on_reload_http_stream_disabled
();
virtual
int
on_reload_http_stream_updated
();
public
:
// TODO: FIXME: should rename to http_static
virtual
int
on_reload_vhost_http_updated
();
virtual
int
on_reload_vhost_http_remux_updated
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_added
(
std
::
string
vhost
);
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
31d2de3
...
...
@@ -1270,6 +1270,7 @@ int SrsServer::on_reload_vhost_added(std::string vhost)
return
ret
;
}
// TODO: FIXME: should handle the event in SrsHttpStaticServer
if
((
ret
=
on_reload_vhost_http_updated
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
@@ -1283,6 +1284,7 @@ int SrsServer::on_reload_vhost_removed(std::string /*vhost*/)
int
ret
=
ERROR_SUCCESS
;
#ifdef SRS_AUTO_HTTP_SERVER
// TODO: FIXME: should handle the event in SrsHttpStaticServer
if
((
ret
=
on_reload_vhost_http_updated
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
@@ -1335,6 +1337,7 @@ int SrsServer::on_reload_http_stream_disabled()
return
ret
;
}
// TODO: FIXME: rename to http_remux
int
SrsServer
::
on_reload_http_stream_updated
()
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1344,6 +1347,7 @@ int SrsServer::on_reload_http_stream_updated()
return
ret
;
}
// TODO: FIXME: should handle the event in SrsHttpStaticServer
if
((
ret
=
on_reload_vhost_http_updated
())
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
请
注册
或
登录
后发表评论