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
2017-01-05 09:08:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f2efa96015ceca382ad5ff49999d572293da9c01
f2efa960
1 parent
b4a81564
for #324, always enable hstrs. 3.0.10
显示空白字符变更
内嵌
并排对比
正在显示
14 个修改的文件
包含
18 行增加
和
71 行删除
README.md
trunk/conf/full.conf
trunk/conf/full.one.vhost.conf
trunk/conf/http.aac.live.conf
trunk/conf/http.flv.live.conf
trunk/conf/http.flv.live.edge1.conf
trunk/conf/http.flv.live.edge2.conf
trunk/conf/http.mp3.live.conf
trunk/conf/http.ts.live.conf
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_http_stream.cpp
trunk/src/app/srs_app_http_stream.hpp
trunk/src/core/srs_core.hpp
README.md
查看文件 @
f2efa96
...
...
@@ -132,6 +132,7 @@ Please select your language:
### V3 changes
*
v3.0, 2017-01-05, for
[
#324
][
bug #324
]
, always enable hstrs. 3.0.10
*
v3.0, 2016-12-15, fix
[
#717
][
bug #717
]
,
[
#691
][
bug #691
]
, http api/static/stream support cors. 3.0.9
*
v3.0, 2016-12-08, support log rotate signal SIGUSR1. 3.0.8
*
v3.0, 2016-12-07, fix typo and refine grammar. 3.0.7
...
...
trunk/conf/full.conf
查看文件 @
f2efa96
...
...
@@ -767,11 +767,6 @@ vhost http.remux.srs.com {
# @remark the port of http is specified by http_server section.
# default: [vhost]/[app]/[stream].flv
mount
[
vhost
]/[
app
]/[
stream
].
flv
;
# whether http stream trigger rtmp stream source when no stream available,
# for example, when encoder has not publish stream yet,
# user can play the http flv stream and wait for stream.
# default: off
hstrs
off
;
}
}
...
...
trunk/conf/full.one.vhost.conf
查看文件 @
f2efa96
...
...
@@ -105,7 +105,6 @@ vhost vhost.srs.com {
enabled
off
;
fast_cache
30
;
mount
[
vhost
]/[
app
]/[
stream
].
flv
;
hstrs
on
;
}
http_hooks
{
enabled
off
;
...
...
trunk/conf/http.aac.live.conf
查看文件 @
f2efa96
...
...
@@ -14,7 +14,5 @@ vhost __defaultVhost__ {
enabled
on
;
fast_cache
30
;
mount
[
vhost
]/[
app
]/[
stream
].
aac
;
hstrs
on
;
}
}
...
...
trunk/conf/http.flv.live.conf
查看文件 @
f2efa96
...
...
@@ -13,6 +13,5 @@ vhost __defaultVhost__ {
http_remux
{
enabled
on
;
mount
[
vhost
]/[
app
]/[
stream
].
flv
;
hstrs
on
;
}
}
...
...
trunk/conf/http.flv.live.edge1.conf
查看文件 @
f2efa96
...
...
@@ -19,6 +19,5 @@ vhost __defaultVhost__ {
http_remux
{
enabled
on
;
mount
[
vhost
]/[
app
]/[
stream
].
flv
;
hstrs
on
;
}
}
...
...
trunk/conf/http.flv.live.edge2.conf
查看文件 @
f2efa96
...
...
@@ -19,6 +19,5 @@ vhost __defaultVhost__ {
http_remux
{
enabled
on
;
mount
[
vhost
]/[
app
]/[
stream
].
flv
;
hstrs
on
;
}
}
...
...
trunk/conf/http.mp3.live.conf
查看文件 @
f2efa96
...
...
@@ -14,7 +14,5 @@ vhost __defaultVhost__ {
enabled
on
;
fast_cache
30
;
mount
[
vhost
]/[
app
]/[
stream
].
mp3
;
hstrs
on
;
}
}
...
...
trunk/conf/http.ts.live.conf
查看文件 @
f2efa96
...
...
@@ -13,6 +13,5 @@ vhost __defaultVhost__ {
http_remux
{
enabled
on
;
mount
[
vhost
]/[
app
]/[
stream
].
ts
;
hstrs
on
;
}
}
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
f2efa96
...
...
@@ -367,6 +367,15 @@ int srs_config_transform_vhost(SrsConfDirective* root)
continue
;
}
// SRS3.0, ignore hstrs, always on.
// SRS1/2:
// vhost { http_remux { hstrs; } }
if
(
n
==
"http_remux"
)
{
SrsConfDirective
*
hstrs
=
conf
->
get
(
"hstrs"
);
conf
->
remove
(
hstrs
);
srs_freep
(
hstrs
);
}
// SRS3.0, change the refer style
// SRS1/2:
// vhost { refer; refer_play; refer_publish; }
...
...
@@ -2553,8 +2562,6 @@ int SrsConfig::vhost_to_json(SrsConfDirective* vhost, SrsJsonObject* obj)
http_remux
->
set
(
"fast_cache"
,
sdir
->
dumps_arg0_to_integer
());
}
else
if
(
sdir
->
name
==
"mount"
)
{
http_remux
->
set
(
"mount"
,
sdir
->
dumps_arg0_to_str
());
}
else
if
(
sdir
->
name
==
"hstrs"
)
{
http_remux
->
set
(
"hstrs"
,
sdir
->
dumps_arg0_to_boolean
());
}
}
}
...
...
@@ -3903,7 +3910,7 @@ int SrsConfig::check_config()
}
else
if
(
n
==
"http_remux"
)
{
for
(
int
j
=
0
;
j
<
(
int
)
conf
->
directives
.
size
();
j
++
)
{
string
m
=
conf
->
at
(
j
)
->
name
.
c_str
();
if
(
m
!=
"enabled"
&&
m
!=
"mount"
&&
m
!=
"fast_cache"
&&
m
!=
"hstrs"
)
{
if
(
m
!=
"enabled"
&&
m
!=
"mount"
&&
m
!=
"fast_cache"
)
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
srs_error
(
"unsupported vhost http_remux directive %s, ret=%d"
,
m
.
c_str
(),
ret
);
return
ret
;
...
...
@@ -6751,29 +6758,6 @@ string SrsConfig::get_vhost_http_remux_mount(string vhost)
return
conf
->
arg0
();
}
bool
SrsConfig
::
get_vhost_http_remux_hstrs
(
string
vhost
)
{
// the HSTRS must default to false for origin.
static
bool
DEFAULT
=
false
;
SrsConfDirective
*
conf
=
get_vhost
(
vhost
);
if
(
!
conf
)
{
return
DEFAULT
;
}
conf
=
conf
->
get
(
"http_remux"
);
if
(
!
conf
)
{
return
DEFAULT
;
}
conf
=
conf
->
get
(
"hstrs"
);
if
(
!
conf
||
conf
->
arg0
().
empty
())
{
return
DEFAULT
;
}
return
SRS_CONF_PERFER_TRUE
(
conf
->
arg0
());
}
SrsConfDirective
*
SrsConfig
::
get_heartbeart
()
{
return
root
->
get
(
"heartbeat"
);
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
f2efa96
...
...
@@ -1358,10 +1358,6 @@ public:
* used to generate the flv stream mount path.
*/
virtual
std
::
string
get_vhost_http_remux_mount
(
std
::
string
vhost
);
/**
* get whether the hstrs(http stream trigger rtmp source) enabled.
*/
virtual
bool
get_vhost_http_remux_hstrs
(
std
::
string
vhost
);
// http heartbeart section
private:
/**
...
...
trunk/src/app/srs_app_http_stream.cpp
查看文件 @
f2efa96
...
...
@@ -622,10 +622,9 @@ int SrsLiveStream::streaming_send_messages(ISrsBufferEncoder* enc, SrsSharedPtrM
return
ret
;
}
SrsLiveEntry
::
SrsLiveEntry
(
std
::
string
m
,
bool
h
)
SrsLiveEntry
::
SrsLiveEntry
(
std
::
string
m
)
{
mount
=
m
;
hstrs
=
h
;
stream
=
NULL
;
cache
=
NULL
;
...
...
@@ -640,11 +639,6 @@ SrsLiveEntry::SrsLiveEntry(std::string m, bool h)
_is_aac
=
(
ext
==
".aac"
);
}
void
SrsLiveEntry
::
reset_hstrs
(
bool
h
)
{
hstrs
=
h
;
}
bool
SrsLiveEntry
::
is_flv
()
{
return
_is_flv
;
...
...
@@ -806,7 +800,7 @@ int SrsHttpStreamServer::http_mount(SrsSource* s, SrsRequest* r)
// remove the default vhost mount
mount
=
srs_string_replace
(
mount
,
SRS_CONSTS_RTMP_DEFAULT_VHOST
"/"
,
"/"
);
entry
=
new
SrsLiveEntry
(
mount
,
tmpl
->
hstrs
);
entry
=
new
SrsLiveEntry
(
mount
);
entry
->
cache
=
new
SrsBufferCache
(
s
,
r
);
entry
->
stream
=
new
SrsLiveStream
(
s
,
r
,
entry
->
cache
);
...
...
@@ -906,9 +900,6 @@ int SrsHttpStreamServer::on_reload_vhost_http_remux_updated(string vhost)
string
old_tmpl_mount
=
tmpl
->
mount
;
string
new_tmpl_mount
=
_srs_config
->
get_vhost_http_remux_mount
(
vhost
);
bool
hstrs
=
_srs_config
->
get_vhost_http_remux_hstrs
(
vhost
);
tmpl
->
reset_hstrs
(
hstrs
);
/**
* TODO: not support to reload different mount url for the time being.
...
...
@@ -921,10 +912,6 @@ int SrsHttpStreamServer::on_reload_vhost_http_remux_updated(string vhost)
if
(
req
)
{
std
::
string
sid
=
req
->
get_stream_url
();
if
(
sflvs
.
find
(
sid
)
!=
sflvs
.
end
())
{
SrsLiveEntry
*
stream
=
sflvs
[
sid
];
stream
->
reset_hstrs
(
hstrs
);
}
// remount stream.
if
((
ret
=
http_mount
(
source
,
req
))
!=
ERROR_SUCCESS
)
{
srs_trace
(
"vhost %s http_remux reload failed"
,
vhost
.
c_str
());
...
...
@@ -971,15 +958,12 @@ int SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph)
return
ret
;
}
// hstrs
not enabled, ignore
.
// hstrs
always enabled
.
// for origin, the http stream will be mount already when publish,
// so it must never enter this line for stream already mounted.
// for edge, the http stream is trigger by hstrs and mount by it,
// so we only hijack when only edge and hstrs is on.
entry
=
it
->
second
;
if
(
!
entry
->
hstrs
)
{
return
ret
;
}
// check entry and request extension.
if
(
entry
->
is_flv
())
{
...
...
@@ -1048,7 +1032,7 @@ int SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandler** ph)
// trigger edge to fetch from origin.
bool
vhost_is_edge
=
_srs_config
->
get_vhost_is_edge
(
r
->
vhost
);
srs_trace
(
"
hstrs
: source url=%s, is_edge=%d, source_id=%d[%d]"
,
srs_trace
(
"
flv
: source url=%s, is_edge=%d, source_id=%d[%d]"
,
r
->
get_stream_url
().
c_str
(),
vhost_is_edge
,
s
->
source_id
(),
s
->
source_id
());
return
ret
;
...
...
@@ -1083,8 +1067,7 @@ int SrsHttpStreamServer::initialize_flv_entry(std::string vhost)
}
SrsLiveEntry
*
entry
=
new
SrsLiveEntry
(
_srs_config
->
get_vhost_http_remux_mount
(
vhost
),
_srs_config
->
get_vhost_http_remux_hstrs
(
vhost
)
_srs_config
->
get_vhost_http_remux_mount
(
vhost
)
);
tflvs
[
vhost
]
=
entry
;
...
...
trunk/src/app/srs_app_http_stream.hpp
查看文件 @
f2efa96
...
...
@@ -252,14 +252,11 @@ public:
// for template, the mount contains variables.
// for concrete stream, the mount is url to access.
std
::
string
mount
;
// whether hstrs(http stream trigger rtmp source)
bool
hstrs
;
SrsLiveStream
*
stream
;
SrsBufferCache
*
cache
;
SrsLiveEntry
(
std
::
string
m
,
bool
h
);
void
reset_hstrs
(
bool
h
);
SrsLiveEntry
(
std
::
string
m
);
bool
is_flv
();
bool
is_ts
();
...
...
trunk/src/core/srs_core.hpp
查看文件 @
f2efa96
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION
9
#define VERSION_REVISION
10
// generated by configure, only macros.
#include <srs_auto_headers.hpp>
...
...
请
注册
或
登录
后发表评论