mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add hls config
This commit is contained in:
parent
e3e0db9bb1
commit
200a6a6975
6 changed files with 979 additions and 894 deletions
14
trunk/conf/srs.conf
Normal file → Executable file
14
trunk/conf/srs.conf
Normal file → Executable file
|
@ -9,6 +9,10 @@ chunk_size 65000;
|
|||
# vhost list, the __defaultVhost__ is the default vhost
|
||||
# for which cannot identify the required vhost.
|
||||
vhost __defaultVhost__ {
|
||||
enabled on;
|
||||
gop_cache on;
|
||||
hls on;
|
||||
hls_path ./hls;
|
||||
}
|
||||
# the vhost disabled.
|
||||
vhost removed.vhost.com {
|
||||
|
@ -17,6 +21,16 @@ vhost removed.vhost.com {
|
|||
# default: on
|
||||
enabled off;
|
||||
}
|
||||
# the vhost with hls specified.
|
||||
vhost no-hls.vhost.com {
|
||||
# whether the hls is enabled.
|
||||
# if off, donot write hls(ts and m3u8) when publish.
|
||||
# default: on
|
||||
hls on;
|
||||
# the hls output path.
|
||||
# default: ./hls
|
||||
hls_path /data/nginx/html/hls;
|
||||
}
|
||||
# the vhost with hls disabled.
|
||||
vhost no-hls.vhost.com {
|
||||
# whether the hls is enabled.
|
||||
|
|
11
trunk/src/core/srs_core_config.cpp
Normal file → Executable file
11
trunk/src/core/srs_core_config.cpp
Normal file → Executable file
|
@ -573,6 +573,17 @@ SrsConfDirective* SrsConfig::get_hls(std::string vhost)
|
|||
return conf->get("hls");
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_hls_path(std::string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
||||
if (!conf) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conf->get("hls_path");
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_refer(std::string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
|
1
trunk/src/core/srs_core_config.hpp
Normal file → Executable file
1
trunk/src/core/srs_core_config.hpp
Normal file → Executable file
|
@ -110,6 +110,7 @@ public:
|
|||
virtual SrsConfDirective* get_vhost(std::string vhost);
|
||||
virtual SrsConfDirective* get_gop_cache(std::string vhost);
|
||||
virtual SrsConfDirective* get_hls(std::string vhost);
|
||||
virtual SrsConfDirective* get_hls_path(std::string vhost);
|
||||
virtual SrsConfDirective* get_refer(std::string vhost);
|
||||
virtual SrsConfDirective* get_refer_play(std::string vhost);
|
||||
virtual SrsConfDirective* get_refer_publish(std::string vhost);
|
||||
|
|
25
trunk/src/core/srs_core_hls.cpp
Normal file
25
trunk/src/core/srs_core_hls.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 winlin
|
||||
|
||||
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
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <srs_core_hls.hpp>
|
||||
|
32
trunk/src/core/srs_core_hls.hpp
Normal file
32
trunk/src/core/srs_core_hls.hpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 winlin
|
||||
|
||||
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
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef SRS_CORE_HLS_HPP
|
||||
#define SRS_CORE_HLS_HPP
|
||||
|
||||
/*
|
||||
#include <srs_core_hls.hpp>
|
||||
*/
|
||||
#include <srs_core.hpp>
|
||||
|
||||
#endif
|
|
@ -22,6 +22,8 @@ file
|
|||
..\core\srs_core_client.cpp,
|
||||
..\core\srs_core_source.hpp,
|
||||
..\core\srs_core_source.cpp,
|
||||
..\core\srs_core_hls.hpp,
|
||||
..\core\srs_core_hls.cpp,
|
||||
..\core\srs_core_codec.hpp,
|
||||
..\core\srs_core_codec.cpp,
|
||||
..\core\srs_core_rtmp.hpp,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue