From cb95b5909c24b3f09f4d36f67c93d0e5c8fe02d0 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 19 May 2014 15:45:04 +0800 Subject: [PATCH] add http heartbeat framework --- trunk/configure | 2 +- trunk/src/app/srs_app_empty.cpp | 25 +++++++++++++++++++++ trunk/src/app/srs_app_empty.hpp | 32 +++++++++++++++++++++++++++ trunk/src/app/srs_app_heartbeat.cpp | 28 +++++++++++++++++++++++ trunk/src/app/srs_app_heartbeat.hpp | 32 +++++++++++++++++++++++++++ trunk/src/app/srs_app_http_client.cpp | 25 +++++++++++++++++++++ trunk/src/app/srs_app_http_client.hpp | 32 +++++++++++++++++++++++++++ trunk/src/core/srs_core.hpp | 2 +- trunk/src/srs/srs.upp | 6 +++++ 9 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 trunk/src/app/srs_app_empty.cpp create mode 100644 trunk/src/app/srs_app_empty.hpp create mode 100644 trunk/src/app/srs_app_heartbeat.cpp create mode 100644 trunk/src/app/srs_app_heartbeat.hpp create mode 100644 trunk/src/app/srs_app_http_client.cpp create mode 100644 trunk/src/app/srs_app_http_client.hpp diff --git a/trunk/configure b/trunk/configure index c0eb2e103..1d74c4811 100755 --- a/trunk/configure +++ b/trunk/configure @@ -468,7 +468,7 @@ MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_socke "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_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest" "srs_app_ffmpeg" "srs_app_utility" "srs_app_dvr" "srs_app_edge" - "srs_app_kbps") + "srs_app_kbps" "srs_app_heartbeat" "srs_app_empty" "srs_app_http_client") APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh APP_OBJS="${MODULE_OBJS[@]}" # diff --git a/trunk/src/app/srs_app_empty.cpp b/trunk/src/app/srs_app_empty.cpp new file mode 100644 index 000000000..12f8cb1b2 --- /dev/null +++ b/trunk/src/app/srs_app_empty.cpp @@ -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 + diff --git a/trunk/src/app/srs_app_empty.hpp b/trunk/src/app/srs_app_empty.hpp new file mode 100644 index 000000000..7db8e8006 --- /dev/null +++ b/trunk/src/app/srs_app_empty.hpp @@ -0,0 +1,32 @@ +/* +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_EMPYTY_HPP +#define SRS_APP_EMPYTY_HPP + +/* +#include +*/ +#include + +#endif diff --git a/trunk/src/app/srs_app_heartbeat.cpp b/trunk/src/app/srs_app_heartbeat.cpp new file mode 100644 index 000000000..544fd3ea5 --- /dev/null +++ b/trunk/src/app/srs_app_heartbeat.cpp @@ -0,0 +1,28 @@ +/* +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 + +#include +#include + diff --git a/trunk/src/app/srs_app_heartbeat.hpp b/trunk/src/app/srs_app_heartbeat.hpp new file mode 100644 index 000000000..c71e4f932 --- /dev/null +++ b/trunk/src/app/srs_app_heartbeat.hpp @@ -0,0 +1,32 @@ +/* +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_HEARTBEAT_HPP +#define SRS_APP_HEARTBEAT_HPP + +/* +#include +*/ +#include + +#endif diff --git a/trunk/src/app/srs_app_http_client.cpp b/trunk/src/app/srs_app_http_client.cpp new file mode 100644 index 000000000..d377b3454 --- /dev/null +++ b/trunk/src/app/srs_app_http_client.cpp @@ -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 + diff --git a/trunk/src/app/srs_app_http_client.hpp b/trunk/src/app/srs_app_http_client.hpp new file mode 100644 index 000000000..8a40aefa4 --- /dev/null +++ b/trunk/src/app/srs_app_http_client.hpp @@ -0,0 +1,32 @@ +/* +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_HTTP_CLIENT_HPP +#define SRS_APP_HTTP_CLIENT_HPP + +/* +#include +*/ +#include + +#endif diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index eb017d71c..7e5a0be10 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "105" +#define VERSION_REVISION "106" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/srs/srs.upp b/trunk/src/srs/srs.upp index ad4f57392..ab3b8aaa6 100755 --- a/trunk/src/srs/srs.upp +++ b/trunk/src/srs/srs.upp @@ -51,18 +51,24 @@ file ..\app\srs_app_dvr.cpp, ..\app\srs_app_edge.hpp, ..\app\srs_app_edge.cpp, + ..\app\srs_app_empty.hpp, + ..\app\srs_app_empty.cpp, ..\app\srs_app_encoder.hpp, ..\app\srs_app_encoder.cpp, ..\app\srs_app_ffmpeg.hpp, ..\app\srs_app_ffmpeg.cpp, ..\app\srs_app_forward.hpp, ..\app\srs_app_forward.cpp, + ..\app\srs_app_heartbeat.hpp, + ..\app\srs_app_heartbeat.cpp, ..\app\srs_app_hls.hpp, ..\app\srs_app_hls.cpp, ..\app\srs_app_http.hpp, ..\app\srs_app_http.cpp, ..\app\srs_app_http_api.hpp, ..\app\srs_app_http_api.cpp, + ..\app\srs_app_http_client.hpp, + ..\app\srs_app_http_client.cpp, ..\app\srs_app_http_conn.hpp, ..\app\srs_app_http_conn.cpp, ..\app\srs_app_http_hooks.hpp,