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-08-30 07:36:06 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bc24c0407b640ce213e05b831b3108fec748bfc1
bc24c040
1 parent
f7c893d9
for #319, move smi and rsh to play
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
43 行增加
和
63 行删除
trunk/conf/full.conf
trunk/conf/full.one.vhost.conf
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_reload.cpp
trunk/src/app/srs_app_reload.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_rtmp_conn.hpp
trunk/conf/full.conf
查看文件 @
bc24c04
...
...
@@ -437,6 +437,21 @@ vhost play.srs.com {
# the value recomment is [300, 1800]
# default: 350
mw_latency
350
;
# the minimal packets send interval in ms,
# used to control the ndiff of stream by srs_rtmp_dump,
# for example, some device can only accept some stream which
# delivery packets in constant interval(not cbr).
# @remark 0 to disable the minimal interval.
# @remark >0 to make the srs to send message one by one.
# @remark user can get the right packets interval in ms by srs_rtmp_dump.
# default: 0
send_min_interval
10
.
0
;
# whether reduce the sequence header,
# for some client which cannot got duplicated sequence header,
# while the sequence header is not changed yet.
# default: off
reduce_sequence_header
on
;
}
}
...
...
@@ -501,25 +516,12 @@ vhost stream.control.com {
# @see scope.vhost.srs.com
tcp_nodelay
on
;
# the minimal packets send interval in ms,
# used to control the ndiff of stream by srs_rtmp_dump,
# for example, some device can only accept some stream which
# delivery packets in constant interval(not cbr).
# @remark 0 to disable the minimal interval.
# @remark >0 to make the srs to send message one by one.
# @remark user can get the right packets interval in ms by srs_rtmp_dump.
# default: 0
send_min_interval
10
.
0
;
# whether reduce the sequence header,
# for some client which cannot got duplicated sequence header,
# while the sequence header is not changed yet.
# default: off
reduce_sequence_header
on
;
# @see play.srs.com
play
{
mw_latency
100
;
queue_length
10
;
send_min_interval
10
.
0
;
reduce_sequence_header
on
;
}
# @see publish.srs.com
...
...
trunk/conf/full.one.vhost.conf
查看文件 @
bc24c04
...
...
@@ -79,7 +79,6 @@ vhost vhost.srs.com {
gop_cache
off
;
queue_length
10
;
# TODO
send_min_interval
10
.
0
;
reduce_sequence_header
on
;
}
...
...
trunk/src/app/srs_app_config.cpp
查看文件 @
bc24c04
...
...
@@ -817,18 +817,6 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root)
srs_trace
(
"vhost %s reload publish success."
,
vhost
.
c_str
());
}
// smi(send_min_interval), only one per vhost
if
(
!
srs_directive_equals
(
new_vhost
->
get
(
"send_min_interval"
),
old_vhost
->
get
(
"send_min_interval"
)))
{
for
(
it
=
subscribes
.
begin
();
it
!=
subscribes
.
end
();
++
it
)
{
ISrsReloadHandler
*
subscribe
=
*
it
;
if
((
ret
=
subscribe
->
on_reload_vhost_smi
(
vhost
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"vhost %s notify subscribes smi failed. ret=%d"
,
vhost
.
c_str
(),
ret
);
return
ret
;
}
}
srs_trace
(
"vhost %s reload smi success."
,
vhost
.
c_str
());
}
// http_static, only one per vhost.
if
(
!
srs_directive_equals
(
new_vhost
->
get
(
"http_static"
),
old_vhost
->
get
(
"http_static"
)))
{
for
(
it
=
subscribes
.
begin
();
it
!=
subscribes
.
end
();
++
it
)
{
...
...
@@ -1699,14 +1687,6 @@ int SrsConfig::vhost_to_json(SrsConfDirective* vhost, SrsAmf0Object* obj)
obj
->
set
(
"debug_srs_upnode"
,
dir
->
dumps_arg0_to_boolean
());
}
// stream control
if
((
dir
=
vhost
->
get
(
"send_min_interval"
))
!=
NULL
)
{
obj
->
set
(
"send_min_interval"
,
dir
->
dumps_arg0_to_number
());
}
if
((
dir
=
vhost
->
get
(
"reduce_sequence_header"
))
!=
NULL
)
{
obj
->
set
(
"reduce_sequence_header"
,
dir
->
dumps_arg0_to_boolean
());
}
// play
if
((
dir
=
vhost
->
get
(
"play"
))
!=
NULL
)
{
SrsAmf0Object
*
play
=
SrsAmf0Any
::
object
();
...
...
@@ -1729,6 +1709,10 @@ int SrsConfig::vhost_to_json(SrsConfDirective* vhost, SrsAmf0Object* obj)
play
->
set
(
"gop_cache"
,
sdir
->
dumps_arg0_to_boolean
());
}
else
if
(
sdir
->
name
==
"queue_length"
)
{
play
->
set
(
"queue_length"
,
sdir
->
dumps_arg0_to_number
());
}
else
if
(
sdir
->
name
==
"reduce_sequence_header"
)
{
play
->
set
(
"reduce_sequence_header"
,
sdir
->
dumps_arg0_to_boolean
());
}
else
if
(
sdir
->
name
==
"send_min_interval"
)
{
play
->
set
(
"send_min_interval"
,
sdir
->
dumps_arg0_to_number
());
}
}
}
...
...
@@ -2611,7 +2595,6 @@ int SrsConfig::check_config()
&&
n
!=
"dvr"
&&
n
!=
"ingest"
&&
n
!=
"hls"
&&
n
!=
"http_hooks"
&&
n
!=
"refer"
&&
n
!=
"forward"
&&
n
!=
"transcode"
&&
n
!=
"bandcheck"
&&
n
!=
"debug_srs_upnode"
&&
n
!=
"play"
&&
n
!=
"publish"
&&
n
!=
"send_min_interval"
&&
n
!=
"reduce_sequence_header"
&&
n
!=
"security"
&&
n
!=
"http_remux"
&&
n
!=
"http_static"
&&
n
!=
"hds"
&&
n
!=
"exec"
)
{
...
...
@@ -2652,8 +2635,8 @@ int SrsConfig::check_config()
}
else
if
(
n
==
"play"
)
{
for
(
int
j
=
0
;
j
<
(
int
)
conf
->
directives
.
size
();
j
++
)
{
string
m
=
conf
->
at
(
j
)
->
name
.
c_str
();
if
(
m
!=
"time_jitter"
&&
m
!=
"mix_correct"
&&
m
!=
"atc"
&&
m
!=
"atc_auto"
&&
m
!=
"mw_latency"
&&
m
!=
"gop_cache"
&&
m
!=
"queue_length"
if
(
m
!=
"time_jitter"
&&
m
!=
"mix_correct"
&&
m
!=
"atc"
&&
m
!=
"atc_auto"
&&
m
!=
"mw_latency"
&&
m
!=
"gop_cache"
&&
m
!=
"queue_length"
&&
m
!=
"send_min_interval"
&&
m
!=
"reduce_sequence_header"
)
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
srs_error
(
"unsupported vhost play directive %s, ret=%d"
,
m
.
c_str
(),
ret
);
...
...
@@ -3505,6 +3488,11 @@ double SrsConfig::get_send_min_interval(string vhost)
return
DEFAULT
;
}
conf
=
conf
->
get
(
"play"
);
if
(
!
conf
||
conf
->
arg0
().
empty
())
{
return
DEFAULT
;
}
conf
=
conf
->
get
(
"send_min_interval"
);
if
(
!
conf
||
conf
->
arg0
().
empty
())
{
return
DEFAULT
;
...
...
@@ -3522,6 +3510,11 @@ bool SrsConfig::get_reduce_sequence_header(string vhost)
return
DEFAULT
;
}
conf
=
conf
->
get
(
"play"
);
if
(
!
conf
||
conf
->
arg0
().
empty
())
{
return
DEFAULT
;
}
conf
=
conf
->
get
(
"reduce_sequence_header"
);
if
(
!
conf
||
conf
->
arg0
().
empty
())
{
return
DEFAULT
;
...
...
@@ -5768,7 +5761,8 @@ int srs_config_transform_vhost(SrsConfDirective* root)
// SRS3+:
// vhost { play { shadow; } }
if
(
n
==
"time_jitter"
||
n
==
"mix_correct"
||
n
==
"atc"
||
n
==
"atc_auto"
||
n
==
"mw_latency"
||
n
==
"gop_cache"
||
n
==
"queue_length"
||
n
==
"mw_latency"
||
n
==
"gop_cache"
||
n
==
"queue_length"
||
n
==
"send_min_interval"
||
n
==
"reduce_sequence_header"
)
{
it
=
dir
->
directives
.
erase
(
it
);
...
...
trunk/src/app/srs_app_reload.cpp
查看文件 @
bc24c04
...
...
@@ -155,11 +155,6 @@ int ISrsReloadHandler::on_reload_vhost_publish(string /*vhost*/)
return
ERROR_SUCCESS
;
}
int
ISrsReloadHandler
::
on_reload_vhost_smi
(
string
/*vhost*/
)
{
return
ERROR_SUCCESS
;
}
int
ISrsReloadHandler
::
on_reload_vhost_tcp_nodelay
(
string
/*vhost*/
)
{
return
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_reload.hpp
查看文件 @
bc24c04
...
...
@@ -70,7 +70,6 @@ public:
virtual
int
on_reload_vhost_hds
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_dvr
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_publish
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_smi
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_tcp_nodelay
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_realtime
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_chunk_size
(
std
::
string
vhost
);
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
bc24c04
...
...
@@ -238,24 +238,16 @@ int SrsRtmpConn::on_reload_vhost_play(string vhost)
if
(
req
->
vhost
!=
vhost
)
{
return
ret
;
}
return
ret
;
}
int
SrsRtmpConn
::
on_reload_vhost_smi
(
string
vhost
)
{
int
ret
=
ERROR_SUCCESS
;
if
(
req
->
vhost
!=
vhost
)
{
return
ret
;
}
double
smi
=
_srs_config
->
get_send_min_interval
(
vhost
);
if
(
smi
!=
send_min_interval
)
{
srs_trace
(
"apply smi %.2f=>%.2f"
,
send_min_interval
,
smi
);
send_min_interval
=
smi
;
// send_min_interval
if
(
true
)
{
double
v
=
_srs_config
->
get_send_min_interval
(
vhost
);
if
(
v
!=
send_min_interval
)
{
srs_trace
(
"apply smi %.2f=>%.2f"
,
send_min_interval
,
v
);
send_min_interval
=
v
;
}
}
return
ret
;
}
...
...
trunk/src/app/srs_app_rtmp_conn.hpp
查看文件 @
bc24c04
...
...
@@ -104,7 +104,6 @@ protected:
public:
virtual
int
on_reload_vhost_removed
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_play
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_smi
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_tcp_nodelay
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_realtime
(
std
::
string
vhost
);
virtual
int
on_reload_vhost_publish
(
std
::
string
vhost
);
...
...
请
注册
或
登录
后发表评论