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
2013-12-22 12:23:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
725ff8e5a5f654204c9280c888b885c3d2805906
725ff8e5
1 parent
309322fd
merge from wenjie: support set chunk size at vhost level
显示空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
37 行增加
和
4 行删除
trunk/conf/srs.conf
trunk/src/core/srs_core_client.cpp
trunk/src/core/srs_core_config.cpp
trunk/src/core/srs_core_config.hpp
trunk/conf/srs.conf
查看文件 @
725ff8e
...
...
@@ -26,6 +26,7 @@ vhost __defaultVhost__ {
# for which cannot identify the required vhost.
# for default demo.
vhost
demo
.
srs
.
com
{
chunk_size
4096
;
enabled
on
;
gop_cache
on
;
queue_length
30
;
...
...
@@ -138,6 +139,7 @@ vhost players_pub {
hls_window
30
;
}
}
# for development
vhost
dev
{
enabled
on
;
...
...
@@ -198,6 +200,15 @@ vhost dev {
}
}
# set the chunk size of vhost.
vhost
chunksize
.
vhost
.
com
{
# the default chunk size is 128, max is 65536,
# some client does not support chunk size change,
# vhost chunk size will override the global value.
# default: global chunk size.
chunk_size
128
;
}
# the http hook callback vhost, srs will invoke the hooks for specified events.
vhost
hooks
.
callback
.
vhost
.
com
{
http_hooks
{
...
...
@@ -289,6 +300,7 @@ vhost hooks.callback.vhost.com {
on_stop
http
://
127
.
0
.
0
.
1
:
8085
/
api
/
v1
/
sessions
http
://
localhost
:
8085
/
api
/
v1
/
sessions
;
}
}
# the mirror filter of ffmpeg, @see: http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction
vhost
mirror
.
transcode
.
vhost
.
com
{
transcode
{
...
...
@@ -668,6 +680,7 @@ vhost stream.transcode.vhost.com {
}
}
}
# the vhost which forward publish streams.
vhost
same
.
vhost
.
forward
.
vhost
.
com
{
# forward all publish stream to the specified server.
...
...
@@ -683,6 +696,7 @@ vhost same.vhost.forward.vhost.com {
vhost
change
.
vhost
.
forward
.
vhost
.
com
{
forward
127
.
0
.
0
.
1
:
1936
?
vhost
=
forward2
.
vhost
.
com
127
.
0
.
0
.
1
:
1937
?
vhost
=
forward3
.
vhost
.
com
;
}
# the vhost disabled.
vhost
removed
.
vhost
.
com
{
# whether the vhost is enabled.
...
...
@@ -690,6 +704,7 @@ vhost removed.vhost.com {
# default: on
enabled
off
;
}
# the vhost with hls specified.
vhost
with
-
hls
.
vhost
.
com
{
hls
{
...
...
@@ -726,6 +741,7 @@ vhost no-hls.vhost.com {
enabled
off
;
}
}
# the vhost for min delay, donot cache any stream.
vhost
min
.
delay
.
com
{
# whether cache the last gop.
...
...
@@ -743,6 +759,7 @@ vhost min.delay.com {
# default: 30
queue_length
10
;
}
# the vhost for antisuck.
vhost
refer
.
anti_suck
.
com
{
# the common refer for play and publish.
...
...
@@ -761,6 +778,7 @@ vhost refer.anti_suck.com {
# default: not specified.
refer_play
github
.
com
github
.
io
;
}
# config for the pithy print,
# which always print constant message specified by interval,
# whatever the clients in concurrency.
...
...
trunk/src/core/srs_core_client.cpp
查看文件 @
725ff8e
...
...
@@ -173,7 +173,7 @@ int SrsClient::service_cycle()
req
->
strip
();
srs_trace
(
"identify client success. type=%d, stream_name=%s"
,
type
,
req
->
stream
.
c_str
());
int
chunk_size
=
config
->
get_chunk_size
(
);
int
chunk_size
=
config
->
get_chunk_size
(
req
->
vhost
);
if
((
ret
=
rtmp
->
set_chunk_size
(
chunk_size
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"set chunk_size=%d failed. ret=%d"
,
chunk_size
,
ret
);
return
ret
;
...
...
trunk/src/core/srs_core_config.cpp
查看文件 @
725ff8e
...
...
@@ -2,6 +2,7 @@
The MIT License (MIT)
Copyright (c) 2013 winlin
Copyright (c) 2013 wenjiegit
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
...
...
@@ -1442,14 +1443,27 @@ SrsConfDirective* SrsConfig::get_listen()
return
root
->
get
(
"listen"
);
}
int
SrsConfig
::
get_chunk_size
()
int
SrsConfig
::
get_chunk_size
(
const
std
::
string
&
vhost
)
{
SrsConfDirective
*
conf
=
root
->
get
(
"chunk_size"
);
SrsConfDirective
*
conf
=
get_vhost
(
vhost
);
if
(
!
conf
)
{
return
SRS_CONF_DEFAULT_CHUNK_SIZE
;
}
conf
=
conf
->
get
(
"chunk_size"
);
if
(
!
conf
)
{
// vhost does not specify the chunk size,
// use the global instead.
conf
=
root
->
get
(
"chunk_size"
);
if
(
!
conf
)
{
return
SRS_CONF_DEFAULT_CHUNK_SIZE
;
}
return
::
atoi
(
conf
->
arg0
().
c_str
());
}
return
::
atoi
(
conf
->
arg0
().
c_str
());
}
int
SrsConfig
::
get_pithy_print_publish
()
...
...
trunk/src/core/srs_core_config.hpp
查看文件 @
725ff8e
...
...
@@ -2,6 +2,7 @@
The MIT License (MIT)
Copyright (c) 2013 winlin
Copyright (c) 2013 wenjiegit
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
...
...
@@ -162,7 +163,7 @@ public:
virtual
SrsConfDirective
*
get_refer_play
(
std
::
string
vhost
);
virtual
SrsConfDirective
*
get_refer_publish
(
std
::
string
vhost
);
virtual
SrsConfDirective
*
get_listen
();
virtual
int
get_chunk_size
(
);
virtual
int
get_chunk_size
(
const
std
::
string
&
vhost
);
virtual
int
get_pithy_print_publish
();
virtual
int
get_pithy_print_forwarder
();
virtual
int
get_pithy_print_encoder
();
...
...
请
注册
或
登录
后发表评论