mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
merge from 2.0release. refine the thread, protocol, kbps code. 2.0.166
This commit is contained in:
commit
6b28dec8ec
23 changed files with 115 additions and 114 deletions
|
@ -566,6 +566,7 @@ Supported operating systems and hardware:
|
|||
|
||||
### SRS 2.0 history
|
||||
|
||||
* v2.0, 2015-05-23, refine the thread, protocol, kbps code. 2.0.166
|
||||
* v2.0, 2015-05-23, fix [#391](https://github.com/simple-rtmp-server/srs/issues/391) copy request for async call.
|
||||
* v2.0, 2015-05-22, fix [#397](https://github.com/simple-rtmp-server/srs/issues/397) the USER_HZ maybe not 100. 2.0.165
|
||||
* v2.0, 2015-05-22, for [#400](https://github.com/simple-rtmp-server/srs/issues/400), parse when got entire http header, by feilong. 2.0.164.
|
||||
|
|
16
trunk/configure
vendored
16
trunk/configure
vendored
|
@ -154,26 +154,26 @@ KERNEL_INCS="src/kernel"; MODULE_DIR=${KERNEL_INCS} . auto/modules.sh
|
|||
KERNEL_OBJS="${MODULE_OBJS[@]}"
|
||||
#
|
||||
#RTMP Protocol, depends on core/kernel, provides rtmp/htttp protocol features.
|
||||
MODULE_ID="RTMP"
|
||||
MODULE_ID="PROTOCOL"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL")
|
||||
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
|
||||
MODULE_FILES=("srs_rtmp_amf0" "srs_rtmp_io" "srs_rtmp_stack" "srs_rtmp_sdk"
|
||||
"srs_rtmp_handshake" "srs_rtmp_utility" "srs_rtmp_msg_array" "srs_rtmp_buffer"
|
||||
"srs_raw_avc" "srs_rtsp_stack" "srs_http_stack")
|
||||
"srs_rtmp_handshake" "srs_rtmp_utility" "srs_rtmp_msg_array" "srs_protocol_buffer"
|
||||
"srs_raw_avc" "srs_rtsp_stack" "srs_http_stack" "srs_protocol_kbps")
|
||||
RTMP_INCS="src/protocol"; MODULE_DIR=${RTMP_INCS} . auto/modules.sh
|
||||
RTMP_OBJS="${MODULE_OBJS[@]}"
|
||||
#
|
||||
#App Module
|
||||
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
|
||||
MODULE_ID="APP"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "RTMP")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
||||
ModuleLibIncs=(${LibSTRoot} ${LibHttpParserRoot} ${SRS_OBJS_DIR})
|
||||
MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_st_socket" "srs_app_source"
|
||||
"srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder"
|
||||
"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_heartbeat" "srs_app_empty" "srs_app_http_client"
|
||||
"srs_app_heartbeat" "srs_app_empty" "srs_app_http_client"
|
||||
"srs_app_recv_thread" "srs_app_security" "srs_app_statistic" "srs_app_hds"
|
||||
"srs_app_mpegts_udp" "srs_app_rtsp" "srs_app_listener" "srs_app_async_call"
|
||||
"srs_app_caster_flv")
|
||||
|
@ -190,7 +190,7 @@ fi
|
|||
#
|
||||
#LIBS Module, build libsrs.a for static link.
|
||||
MODULE_ID="LIBS"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "RTMP")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL")
|
||||
ModuleLibIncs=(${SRS_OBJS_DIR})
|
||||
MODULE_FILES=("srs_librtmp" "srs_lib_simple_socket" "srs_lib_bandwidth")
|
||||
LIBS_INCS="src/libs"; MODULE_DIR=${LIBS_INCS} . auto/modules.sh
|
||||
|
@ -199,7 +199,7 @@ LIBS_OBJS="${MODULE_OBJS[@]}"
|
|||
#Main Module
|
||||
if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
|
||||
MODULE_ID="MAIN"
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
|
||||
ModuleLibIncs=(${LibSTRoot} ${SRS_OBJS_DIR} ${LibGperfRoot} ${LibHttpParserRoot})
|
||||
MODULE_FILES=("srs_main_server" "srs_main_ingest_hls")
|
||||
# add each modules for main
|
||||
|
@ -257,7 +257,7 @@ if [ $SRS_UTEST = YES ]; then
|
|||
"srs_utest_reload")
|
||||
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibSSLRoot})
|
||||
ModuleLibFiles=(${LibSTfile} ${LibHttpParserfile} ${LibSSLfile})
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "RTMP" "APP")
|
||||
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP")
|
||||
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${APP_OBJS[@]}"
|
||||
LINK_OPTIONS="-lpthread ${SrsLinkOptions}" MODULE_DIR="src/utest" APP_NAME="srs_utest" . auto/utest.sh
|
||||
fi
|
||||
|
|
|
@ -48,12 +48,14 @@ file
|
|||
protocol readonly separator,
|
||||
../../src/protocol/srs_http_stack.hpp,
|
||||
../../src/protocol/srs_http_stack.cpp,
|
||||
../../src/protocol/srs_protocol_kbps.hpp,
|
||||
../../src/protocol/srs_protocol_kbps.cpp,
|
||||
../../src/protocol/srs_raw_avc.hpp,
|
||||
../../src/protocol/srs_raw_avc.cpp,
|
||||
../../src/protocol/srs_rtmp_amf0.hpp,
|
||||
../../src/protocol/srs_rtmp_amf0.cpp,
|
||||
../../src/protocol/srs_rtmp_buffer.hpp,
|
||||
../../src/protocol/srs_rtmp_buffer.cpp,
|
||||
../../src/protocol/srs_protocol_buffer.hpp,
|
||||
../../src/protocol/srs_protocol_buffer.cpp,
|
||||
../../src/protocol/srs_rtmp_handshake.hpp,
|
||||
../../src/protocol/srs_rtmp_handshake.cpp,
|
||||
../../src/protocol/srs_rtmp_io.hpp,
|
||||
|
@ -105,8 +107,6 @@ file
|
|||
../../src/app/srs_app_ingest.cpp,
|
||||
../../src/app/srs_app_json.hpp,
|
||||
../../src/app/srs_app_json.cpp,
|
||||
../../src/app/srs_app_kbps.hpp,
|
||||
../../src/app/srs_app_kbps.cpp,
|
||||
../../src/app/srs_app_listener.hpp,
|
||||
../../src/app/srs_app_listener.cpp,
|
||||
../../src/app/srs_app_log.hpp,
|
||||
|
|
|
@ -80,7 +80,6 @@
|
|||
<ClInclude Include="..\..\src\app\srs_app_http_hooks.hpp" />
|
||||
<ClInclude Include="..\..\src\app\srs_app_ingest.hpp" />
|
||||
<ClInclude Include="..\..\src\app\srs_app_json.hpp" />
|
||||
<ClInclude Include="..\..\src\app\srs_app_kbps.hpp" />
|
||||
<ClInclude Include="..\..\src\app\srs_app_listener.hpp" />
|
||||
<ClInclude Include="..\..\src\app\srs_app_log.hpp" />
|
||||
<ClInclude Include="..\..\src\app\srs_app_mpegts_udp.hpp" />
|
||||
|
@ -121,7 +120,7 @@
|
|||
<ClInclude Include="..\..\src\protocol\srs_http_stack.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_raw_avc.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_amf0.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_buffer.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_protocol_buffer.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_handshake.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_io.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_msg_array.hpp" />
|
||||
|
@ -129,6 +128,7 @@
|
|||
<ClInclude Include="..\..\src\protocol\srs_rtmp_stack.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_utility.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_rtsp_stack.hpp" />
|
||||
<ClInclude Include="..\..\src\protocol\srs_protocol_kbps.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\research\hls\ts_info.cc" />
|
||||
|
@ -161,7 +161,6 @@
|
|||
<ClCompile Include="..\..\src\app\srs_app_http_hooks.cpp" />
|
||||
<ClCompile Include="..\..\src\app\srs_app_ingest.cpp" />
|
||||
<ClCompile Include="..\..\src\app\srs_app_json.cpp" />
|
||||
<ClCompile Include="..\..\src\app\srs_app_kbps.cpp" />
|
||||
<ClCompile Include="..\..\src\app\srs_app_listener.cpp" />
|
||||
<ClCompile Include="..\..\src\app\srs_app_log.cpp" />
|
||||
<ClCompile Include="..\..\src\app\srs_app_mpegts_udp.cpp" />
|
||||
|
@ -203,7 +202,7 @@
|
|||
<ClCompile Include="..\..\src\protocol\srs_http_stack.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_raw_avc.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_amf0.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_buffer.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_protocol_buffer.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_handshake.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_io.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_msg_array.cpp" />
|
||||
|
@ -211,6 +210,7 @@
|
|||
<ClCompile Include="..\..\src\protocol\srs_rtmp_stack.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_utility.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_rtsp_stack.cpp" />
|
||||
<ClCompile Include="..\..\src\protocol\srs_protocol_kbps.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
3C068D6A1B10149F00AA722C /* srs_protocol_kbps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */; };
|
||||
3C068D6D1B10175500AA722C /* srs_protocol_buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */; };
|
||||
3C0E1B8D1B0F5ADF003ADEF7 /* srs_http_stack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */; };
|
||||
3C1231F61AAE652D00CE8F6C /* srs_core_autofree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1231F01AAE652C00CE8F6C /* srs_core_autofree.cpp */; };
|
||||
3C1231F71AAE652D00CE8F6C /* srs_core_performance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1231F21AAE652C00CE8F6C /* srs_core_performance.cpp */; };
|
||||
|
@ -26,7 +28,6 @@
|
|||
3C12322B1AAE814D00CE8F6C /* srs_kernel_utility.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12321E1AAE814D00CE8F6C /* srs_kernel_utility.cpp */; };
|
||||
3C1232411AAE81A400CE8F6C /* srs_raw_avc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12322D1AAE81A400CE8F6C /* srs_raw_avc.cpp */; };
|
||||
3C1232421AAE81A400CE8F6C /* srs_rtmp_amf0.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12322F1AAE81A400CE8F6C /* srs_rtmp_amf0.cpp */; };
|
||||
3C1232431AAE81A400CE8F6C /* srs_rtmp_buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232311AAE81A400CE8F6C /* srs_rtmp_buffer.cpp */; };
|
||||
3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232331AAE81A400CE8F6C /* srs_rtmp_handshake.cpp */; };
|
||||
3C1232451AAE81A400CE8F6C /* srs_rtmp_io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232351AAE81A400CE8F6C /* srs_rtmp_io.cpp */; };
|
||||
3C1232461AAE81A400CE8F6C /* srs_rtmp_msg_array.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232371AAE81A400CE8F6C /* srs_rtmp_msg_array.cpp */; };
|
||||
|
@ -51,7 +52,6 @@
|
|||
3C1232A21AAE81D900CE8F6C /* srs_app_http_hooks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232681AAE81D900CE8F6C /* srs_app_http_hooks.cpp */; };
|
||||
3C1232A41AAE81D900CE8F6C /* srs_app_ingest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12326C1AAE81D900CE8F6C /* srs_app_ingest.cpp */; };
|
||||
3C1232A51AAE81D900CE8F6C /* srs_app_json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C12326E1AAE81D900CE8F6C /* srs_app_json.cpp */; };
|
||||
3C1232A61AAE81D900CE8F6C /* srs_app_kbps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232701AAE81D900CE8F6C /* srs_app_kbps.cpp */; };
|
||||
3C1232A71AAE81D900CE8F6C /* srs_app_listener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232721AAE81D900CE8F6C /* srs_app_listener.cpp */; };
|
||||
3C1232A81AAE81D900CE8F6C /* srs_app_log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232741AAE81D900CE8F6C /* srs_app_log.cpp */; };
|
||||
3C1232A91AAE81D900CE8F6C /* srs_app_mpegts_udp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1232761AAE81D900CE8F6C /* srs_app_mpegts_udp.cpp */; };
|
||||
|
@ -122,6 +122,10 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_kbps.cpp; path = ../../../src/protocol/srs_protocol_kbps.cpp; sourceTree = "<group>"; };
|
||||
3C068D691B10149F00AA722C /* srs_protocol_kbps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_kbps.hpp; path = ../../../src/protocol/srs_protocol_kbps.hpp; sourceTree = "<group>"; };
|
||||
3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_buffer.cpp; path = ../../../src/protocol/srs_protocol_buffer.cpp; sourceTree = "<group>"; };
|
||||
3C068D6C1B10175500AA722C /* srs_protocol_buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_buffer.hpp; path = ../../../src/protocol/srs_protocol_buffer.hpp; sourceTree = "<group>"; };
|
||||
3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_http_stack.cpp; path = ../../../src/protocol/srs_http_stack.cpp; sourceTree = "<group>"; };
|
||||
3C0E1B8C1B0F5ADF003ADEF7 /* srs_http_stack.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_http_stack.hpp; path = ../../../src/protocol/srs_http_stack.hpp; sourceTree = "<group>"; };
|
||||
3C1231E51AAE64A400CE8F6C /* srs_xcode */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = srs_xcode; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
|
@ -161,8 +165,6 @@
|
|||
3C12322E1AAE81A400CE8F6C /* srs_raw_avc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_raw_avc.hpp; path = ../../../src/protocol/srs_raw_avc.hpp; sourceTree = "<group>"; };
|
||||
3C12322F1AAE81A400CE8F6C /* srs_rtmp_amf0.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_rtmp_amf0.cpp; path = ../../../src/protocol/srs_rtmp_amf0.cpp; sourceTree = "<group>"; };
|
||||
3C1232301AAE81A400CE8F6C /* srs_rtmp_amf0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_rtmp_amf0.hpp; path = ../../../src/protocol/srs_rtmp_amf0.hpp; sourceTree = "<group>"; };
|
||||
3C1232311AAE81A400CE8F6C /* srs_rtmp_buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_rtmp_buffer.cpp; path = ../../../src/protocol/srs_rtmp_buffer.cpp; sourceTree = "<group>"; };
|
||||
3C1232321AAE81A400CE8F6C /* srs_rtmp_buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_rtmp_buffer.hpp; path = ../../../src/protocol/srs_rtmp_buffer.hpp; sourceTree = "<group>"; };
|
||||
3C1232331AAE81A400CE8F6C /* srs_rtmp_handshake.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_rtmp_handshake.cpp; path = ../../../src/protocol/srs_rtmp_handshake.cpp; sourceTree = "<group>"; };
|
||||
3C1232341AAE81A400CE8F6C /* srs_rtmp_handshake.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_rtmp_handshake.hpp; path = ../../../src/protocol/srs_rtmp_handshake.hpp; sourceTree = "<group>"; };
|
||||
3C1232351AAE81A400CE8F6C /* srs_rtmp_io.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_rtmp_io.cpp; path = ../../../src/protocol/srs_rtmp_io.cpp; sourceTree = "<group>"; };
|
||||
|
@ -211,8 +213,6 @@
|
|||
3C12326D1AAE81D900CE8F6C /* srs_app_ingest.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_ingest.hpp; path = ../../../src/app/srs_app_ingest.hpp; sourceTree = "<group>"; };
|
||||
3C12326E1AAE81D900CE8F6C /* srs_app_json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_json.cpp; path = ../../../src/app/srs_app_json.cpp; sourceTree = "<group>"; };
|
||||
3C12326F1AAE81D900CE8F6C /* srs_app_json.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_json.hpp; path = ../../../src/app/srs_app_json.hpp; sourceTree = "<group>"; };
|
||||
3C1232701AAE81D900CE8F6C /* srs_app_kbps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_kbps.cpp; path = ../../../src/app/srs_app_kbps.cpp; sourceTree = "<group>"; };
|
||||
3C1232711AAE81D900CE8F6C /* srs_app_kbps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_kbps.hpp; path = ../../../src/app/srs_app_kbps.hpp; sourceTree = "<group>"; };
|
||||
3C1232721AAE81D900CE8F6C /* srs_app_listener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_listener.cpp; path = ../../../src/app/srs_app_listener.cpp; sourceTree = "<group>"; };
|
||||
3C1232731AAE81D900CE8F6C /* srs_app_listener.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_listener.hpp; path = ../../../src/app/srs_app_listener.hpp; sourceTree = "<group>"; };
|
||||
3C1232741AAE81D900CE8F6C /* srs_app_log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_app_log.cpp; path = ../../../src/app/srs_app_log.cpp; sourceTree = "<group>"; };
|
||||
|
@ -489,12 +489,14 @@
|
|||
children = (
|
||||
3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */,
|
||||
3C0E1B8C1B0F5ADF003ADEF7 /* srs_http_stack.hpp */,
|
||||
3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */,
|
||||
3C068D6C1B10175500AA722C /* srs_protocol_buffer.hpp */,
|
||||
3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */,
|
||||
3C068D691B10149F00AA722C /* srs_protocol_kbps.hpp */,
|
||||
3C12322D1AAE81A400CE8F6C /* srs_raw_avc.cpp */,
|
||||
3C12322E1AAE81A400CE8F6C /* srs_raw_avc.hpp */,
|
||||
3C12322F1AAE81A400CE8F6C /* srs_rtmp_amf0.cpp */,
|
||||
3C1232301AAE81A400CE8F6C /* srs_rtmp_amf0.hpp */,
|
||||
3C1232311AAE81A400CE8F6C /* srs_rtmp_buffer.cpp */,
|
||||
3C1232321AAE81A400CE8F6C /* srs_rtmp_buffer.hpp */,
|
||||
3C1232331AAE81A400CE8F6C /* srs_rtmp_handshake.cpp */,
|
||||
3C1232341AAE81A400CE8F6C /* srs_rtmp_handshake.hpp */,
|
||||
3C1232351AAE81A400CE8F6C /* srs_rtmp_io.cpp */,
|
||||
|
@ -556,8 +558,6 @@
|
|||
3C12326D1AAE81D900CE8F6C /* srs_app_ingest.hpp */,
|
||||
3C12326E1AAE81D900CE8F6C /* srs_app_json.cpp */,
|
||||
3C12326F1AAE81D900CE8F6C /* srs_app_json.hpp */,
|
||||
3C1232701AAE81D900CE8F6C /* srs_app_kbps.cpp */,
|
||||
3C1232711AAE81D900CE8F6C /* srs_app_kbps.hpp */,
|
||||
3C1232721AAE81D900CE8F6C /* srs_app_listener.cpp */,
|
||||
3C1232731AAE81D900CE8F6C /* srs_app_listener.hpp */,
|
||||
3C1232741AAE81D900CE8F6C /* srs_app_log.cpp */,
|
||||
|
@ -916,6 +916,7 @@
|
|||
3CE6CD311AE4AFB800706E07 /* srs_main_ingest_hls.cpp in Sources */,
|
||||
3C28EDDF1AF5C43F00A3AEAC /* srs_app_caster_flv.cpp in Sources */,
|
||||
3C1232241AAE814D00CE8F6C /* srs_kernel_error.cpp in Sources */,
|
||||
3C068D6D1B10175500AA722C /* srs_protocol_buffer.cpp in Sources */,
|
||||
3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */,
|
||||
3C1232291AAE814D00CE8F6C /* srs_kernel_stream.cpp in Sources */,
|
||||
3C663F181AB0155100286D8B /* srs_play.c in Sources */,
|
||||
|
@ -927,16 +928,15 @@
|
|||
3C663F161AB0155100286D8B /* srs_ingest_flv.c in Sources */,
|
||||
3C663F141AB0155100286D8B /* srs_flv_parser.c in Sources */,
|
||||
3C1232451AAE81A400CE8F6C /* srs_rtmp_io.cpp in Sources */,
|
||||
3C1232431AAE81A400CE8F6C /* srs_rtmp_buffer.cpp in Sources */,
|
||||
3C1232211AAE814D00CE8F6C /* srs_kernel_buffer.cpp in Sources */,
|
||||
3C1232471AAE81A400CE8F6C /* srs_rtmp_sdk.cpp in Sources */,
|
||||
3C36DB5B1ABD1CB90066CCAF /* srs_lib_bandwidth.cpp in Sources */,
|
||||
3C1232A61AAE81D900CE8F6C /* srs_app_kbps.cpp in Sources */,
|
||||
3C12329D1AAE81D900CE8F6C /* srs_app_heartbeat.cpp in Sources */,
|
||||
3C1232231AAE814D00CE8F6C /* srs_kernel_consts.cpp in Sources */,
|
||||
3C1232AF1AAE81D900CE8F6C /* srs_app_rtsp.cpp in Sources */,
|
||||
3CC52DDD1ACE4023006FEB01 /* srs_utest_reload.cpp in Sources */,
|
||||
3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */,
|
||||
3C068D6A1B10149F00AA722C /* srs_protocol_kbps.cpp in Sources */,
|
||||
3C12329A1AAE81D900CE8F6C /* srs_app_encoder.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
|
|
@ -35,7 +35,10 @@ using namespace std;
|
|||
#include <srs_core_autofree.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
#include <srs_app_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
#include <srs_app_st.hpp>
|
||||
|
||||
#define _SRS_BANDWIDTH_LIMIT_INTERVAL_MS 100
|
||||
|
||||
// default sample duration, in ms
|
||||
#define _SRS_BANDWIDTH_SAMPLE_DURATION_MS 3000
|
||||
|
@ -475,3 +478,40 @@ int SrsBandwidth::finial(SrsBandwidthSample& play_sample, SrsBandwidthSample& pu
|
|||
return ret;
|
||||
}
|
||||
|
||||
SrsKbpsLimit::SrsKbpsLimit(SrsKbps* kbps, int limit_kbps)
|
||||
{
|
||||
_kbps = kbps;
|
||||
_limit_kbps = limit_kbps;
|
||||
}
|
||||
|
||||
SrsKbpsLimit::~SrsKbpsLimit()
|
||||
{
|
||||
}
|
||||
|
||||
int SrsKbpsLimit::limit_kbps()
|
||||
{
|
||||
return _limit_kbps;
|
||||
}
|
||||
|
||||
void SrsKbpsLimit::recv_limit()
|
||||
{
|
||||
_kbps->sample();
|
||||
|
||||
while (_kbps->get_recv_kbps() > _limit_kbps) {
|
||||
_kbps->sample();
|
||||
|
||||
st_usleep(_SRS_BANDWIDTH_LIMIT_INTERVAL_MS * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
void SrsKbpsLimit::send_limit()
|
||||
{
|
||||
_kbps->sample();
|
||||
|
||||
while (_kbps->get_send_kbps() > _limit_kbps) {
|
||||
_kbps->sample();
|
||||
|
||||
st_usleep(_SRS_BANDWIDTH_LIMIT_INTERVAL_MS * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_app_st.hpp>
|
||||
|
||||
class SrsKbps;
|
||||
class SrsRequest;
|
||||
class SrsRtmpServer;
|
||||
class SrsKbpsLimit;
|
||||
|
@ -199,4 +200,30 @@ private:
|
|||
virtual int finial(SrsBandwidthSample& play_sample, SrsBandwidthSample& publish_sample, int64_t start_time, int64_t& end_time);
|
||||
};
|
||||
|
||||
/**
|
||||
* the kbps limit, if exceed the kbps, slow down.
|
||||
*/
|
||||
class SrsKbpsLimit
|
||||
{
|
||||
private:
|
||||
int _limit_kbps;
|
||||
SrsKbps* _kbps;
|
||||
public:
|
||||
SrsKbpsLimit(SrsKbps* kbps, int limit_kbps);
|
||||
virtual ~SrsKbpsLimit();
|
||||
public:
|
||||
/**
|
||||
* get the system limit kbps.
|
||||
*/
|
||||
virtual int limit_kbps();
|
||||
/**
|
||||
* limit the recv bandwidth.
|
||||
*/
|
||||
virtual void recv_limit();
|
||||
/**
|
||||
* limit the send bandwidth.
|
||||
*/
|
||||
virtual void send_limit();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_app_st.hpp>
|
||||
#include <srs_app_thread.hpp>
|
||||
#include <srs_app_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
|
||||
class SrsConnection;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ using namespace std;
|
|||
#include <srs_app_source.hpp>
|
||||
#include <srs_app_pithy_print.hpp>
|
||||
#include <srs_core_autofree.hpp>
|
||||
#include <srs_app_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
#include <srs_rtmp_msg_array.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
#include <srs_rtmp_amf0.hpp>
|
||||
|
|
|
@ -38,7 +38,7 @@ using namespace std;
|
|||
#include <srs_app_pithy_print.hpp>
|
||||
#include <srs_rtmp_sdk.hpp>
|
||||
#include <srs_rtmp_utility.hpp>
|
||||
#include <srs_app_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
#include <srs_rtmp_msg_array.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
#include <srs_rtmp_amf0.hpp>
|
||||
|
|
|
@ -51,7 +51,7 @@ using namespace std;
|
|||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_kernel_codec.hpp>
|
||||
#include <srs_kernel_file.hpp>
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
#include <srs_kernel_ts.hpp>
|
||||
#include <srs_app_utility.hpp>
|
||||
#include <srs_app_http_hooks.hpp>
|
||||
|
|
|
@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <sstream>
|
||||
using namespace std;
|
||||
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
#include <srs_rtmp_utility.hpp>
|
||||
#include <srs_kernel_log.hpp>
|
||||
#include <srs_kernel_error.hpp>
|
||||
|
|
|
@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_rtmp_sdk.hpp>
|
||||
#include <srs_rtmp_stack.hpp>
|
||||
#include <srs_app_rtmp_conn.hpp>
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_core_performance.hpp>
|
||||
#include <srs_app_config.hpp>
|
||||
|
|
|
@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <vector>
|
||||
|
||||
#include <srs_app_thread.hpp>
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
#include <srs_core_performance.hpp>
|
||||
#include <srs_app_reload.hpp>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ using namespace std;
|
|||
|
||||
#include <srs_rtmp_sdk.hpp>
|
||||
#include <srs_app_json.hpp>
|
||||
#include <srs_app_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
#include <srs_app_conn.hpp>
|
||||
#include <srs_app_config.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
|
|
|
@ -39,7 +39,7 @@ using namespace std;
|
|||
#include <srs_app_config.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_kernel_error.hpp>
|
||||
#include <srs_app_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
#include <srs_app_json.hpp>
|
||||
#include <srs_kernel_stream.hpp>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ 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_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#define SRS_PROTOCOL_BUFFER_HPP
|
||||
|
||||
/*
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
*/
|
||||
|
||||
#include <srs_core.hpp>
|
|
@ -21,12 +21,9 @@ 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_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_app_st.hpp>
|
||||
|
||||
#define _SRS_BANDWIDTH_LIMIT_INTERVAL_MS 100
|
||||
|
||||
SrsKbpsSample::SrsKbpsSample()
|
||||
{
|
||||
|
@ -253,41 +250,3 @@ void SrsKbps::sample()
|
|||
os.sample();
|
||||
}
|
||||
|
||||
SrsKbpsLimit::SrsKbpsLimit(SrsKbps* kbps, int limit_kbps)
|
||||
{
|
||||
_kbps = kbps;
|
||||
_limit_kbps = limit_kbps;
|
||||
}
|
||||
|
||||
SrsKbpsLimit::~SrsKbpsLimit()
|
||||
{
|
||||
}
|
||||
|
||||
int SrsKbpsLimit::limit_kbps()
|
||||
{
|
||||
return _limit_kbps;
|
||||
}
|
||||
|
||||
void SrsKbpsLimit::recv_limit()
|
||||
{
|
||||
_kbps->sample();
|
||||
|
||||
while (_kbps->get_recv_kbps() > _limit_kbps) {
|
||||
_kbps->sample();
|
||||
|
||||
st_usleep(_SRS_BANDWIDTH_LIMIT_INTERVAL_MS * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
void SrsKbpsLimit::send_limit()
|
||||
{
|
||||
_kbps->sample();
|
||||
|
||||
while (_kbps->get_send_kbps() > _limit_kbps) {
|
||||
_kbps->sample();
|
||||
|
||||
st_usleep(_SRS_BANDWIDTH_LIMIT_INTERVAL_MS * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -21,11 +21,11 @@ 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_KBPS_HPP
|
||||
#define SRS_APP_KBPS_HPP
|
||||
#ifndef SRS_PROTOCOL_KBPS_HPP
|
||||
#define SRS_PROTOCOL_KBPS_HPP
|
||||
|
||||
/*
|
||||
#include <srs_app_kbps.hpp>
|
||||
#include <srs_protocol_kbps.hpp>
|
||||
*/
|
||||
|
||||
#include <srs_core.hpp>
|
||||
|
@ -234,30 +234,4 @@ public:
|
|||
virtual void sample();
|
||||
};
|
||||
|
||||
/**
|
||||
* the kbps limit, if exceed the kbps, slow down.
|
||||
*/
|
||||
class SrsKbpsLimit
|
||||
{
|
||||
private:
|
||||
int _limit_kbps;
|
||||
SrsKbps* _kbps;
|
||||
public:
|
||||
SrsKbpsLimit(SrsKbps* kbps, int limit_kbps);
|
||||
virtual ~SrsKbpsLimit();
|
||||
public:
|
||||
/**
|
||||
* get the system limit kbps.
|
||||
*/
|
||||
virtual int limit_kbps();
|
||||
/**
|
||||
* limit the recv bandwidth.
|
||||
*/
|
||||
virtual void recv_limit();
|
||||
/**
|
||||
* limit the send bandwidth.
|
||||
*/
|
||||
virtual void send_limit();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_kernel_stream.hpp>
|
||||
#include <srs_core_autofree.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
#include <srs_rtmp_utility.hpp>
|
||||
|
||||
// for srs-librtmp, @see https://github.com/simple-rtmp-server/srs/issues/213
|
||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <string>
|
||||
#include <srs_kernel_file.hpp>
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
|
||||
class MockBufferReader: public ISrsBufferReader
|
||||
{
|
||||
|
|
|
@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_rtmp_sdk.hpp>
|
||||
#include <srs_rtmp_handshake.hpp>
|
||||
#include <srs_rtmp_buffer.hpp>
|
||||
#include <srs_protocol_buffer.hpp>
|
||||
|
||||
#ifdef SRS_AUTO_SSL
|
||||
using namespace _srs_internal;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue