winlin

add hls config

... ... @@ -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.
... ...
... ... @@ -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);
... ...
... ... @@ -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);
... ...
/*
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>
... ...
/*
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
\ No newline at end of file
... ...
... ... @@ -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,
... ...