mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add srs app edge
This commit is contained in:
parent
d6948d613f
commit
a63a3812e3
7 changed files with 76 additions and 1 deletions
2
trunk/configure
vendored
2
trunk/configure
vendored
|
@ -448,7 +448,7 @@ MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_socke
|
||||||
"srs_app_http" "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log"
|
"srs_app_http" "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log"
|
||||||
"srs_app_config" "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api"
|
"srs_app_config" "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api"
|
||||||
"srs_app_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest"
|
"srs_app_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest"
|
||||||
"srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr")
|
"srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge")
|
||||||
APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh
|
APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh
|
||||||
APP_OBJS="${MODULE_OBJS[@]}"
|
APP_OBJS="${MODULE_OBJS[@]}"
|
||||||
#
|
#
|
||||||
|
|
25
trunk/src/app/srs_app_edge.cpp
Normal file
25
trunk/src/app/srs_app_edge.cpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013-2014 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_app_edge.hpp>
|
||||||
|
|
33
trunk/src/app/srs_app_edge.hpp
Normal file
33
trunk/src/app/srs_app_edge.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2013-2014 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_APP_EDGE_HPP
|
||||||
|
#define SRS_APP_EDGE_HPP
|
||||||
|
|
||||||
|
/*
|
||||||
|
#include <srs_app_edge.hpp>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <srs_core.hpp>
|
||||||
|
|
||||||
|
#endif
|
|
@ -296,6 +296,13 @@ int SrsRtmpConn::stream_service_cycle()
|
||||||
case SrsRtmpConnPlay: {
|
case SrsRtmpConnPlay: {
|
||||||
srs_verbose("start to play stream %s.", req->stream.c_str());
|
srs_verbose("start to play stream %s.", req->stream.c_str());
|
||||||
|
|
||||||
|
if (vhost_is_edge) {
|
||||||
|
if ((ret = source->on_edge_play_stream()) != ERROR_SUCCESS) {
|
||||||
|
srs_error("notice edge play stream failed. ret=%d", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = rtmp->start_play(res->stream_id)) != ERROR_SUCCESS) {
|
if ((ret = rtmp->start_play(res->stream_id)) != ERROR_SUCCESS) {
|
||||||
srs_error("start to play stream failed. ret=%d", ret);
|
srs_error("start to play stream failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -1175,6 +1175,12 @@ bool SrsSource::is_atc()
|
||||||
return atc;
|
return atc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SrsSource::on_edge_play_stream()
|
||||||
|
{
|
||||||
|
int ret = ERROR_SUCCESS;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int SrsSource::create_forwarders()
|
int SrsSource::create_forwarders()
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
|
@ -309,6 +309,8 @@ public:
|
||||||
public:
|
public:
|
||||||
// for consumer, atc feature.
|
// for consumer, atc feature.
|
||||||
virtual bool is_atc();
|
virtual bool is_atc();
|
||||||
|
// for edge, when play edge stream, check the state
|
||||||
|
virtual int on_edge_play_stream();
|
||||||
private:
|
private:
|
||||||
virtual int create_forwarders();
|
virtual int create_forwarders();
|
||||||
virtual void destroy_forwarders();
|
virtual void destroy_forwarders();
|
||||||
|
|
|
@ -49,6 +49,8 @@ file
|
||||||
..\app\srs_app_config.cpp,
|
..\app\srs_app_config.cpp,
|
||||||
..\app\srs_app_dvr.hpp,
|
..\app\srs_app_dvr.hpp,
|
||||||
..\app\srs_app_dvr.cpp,
|
..\app\srs_app_dvr.cpp,
|
||||||
|
..\app\srs_app_edge.hpp,
|
||||||
|
..\app\srs_app_edge.cpp,
|
||||||
..\app\srs_app_encoder.hpp,
|
..\app\srs_app_encoder.hpp,
|
||||||
..\app\srs_app_encoder.cpp,
|
..\app\srs_app_encoder.cpp,
|
||||||
..\app\srs_app_ffmpeg.hpp,
|
..\app\srs_app_ffmpeg.hpp,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue