From cf3becbc17be2c43066636daab88314e82540c24 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 17 Mar 2015 22:35:47 +0800 Subject: [PATCH] for #155, osx(darwin) enable http api and stat, rusage is ok. --- trunk/auto/depends.sh | 11 +---------- trunk/auto/options.sh | 4 ++-- trunk/src/app/srs_app_server.cpp | 2 ++ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index bbc738f04..5e87d55f0 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -266,17 +266,8 @@ function OSX_prepare() echo "OSX detected, must specifies the --osx" exit 1 fi - # TODO: FIXME: support following features. - if [ $SRS_HTTP_API = YES ]; then - echo "OSX does not support http-api, use --without-http-api" - exit 1 - fi - if [ $SRS_STAT = YES ]; then - echo "OSX does not support stat, use --without-stat" - exit 1 - fi fi - + brew --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then echo "install brew" echo "ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"" diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 6ef905054..d90f3f556 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -592,12 +592,12 @@ function apply_user_presets() { SRS_FFMPEG_TOOL=NO SRS_TRANSCODE=YES SRS_INGEST=YES - SRS_STAT=NO + SRS_STAT=YES SRS_HTTP_PARSER=YES SRS_HTTP_CALLBACK=YES SRS_HTTP_SERVER=YES SRS_STREAM_CASTER=NO - SRS_HTTP_API=NO + SRS_HTTP_API=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=NO diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 6aaf07539..acc193d3f 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -836,6 +836,7 @@ int SrsServer::do_cycle() srs_info("update resource info, rss."); srs_update_system_rusage(); } +#ifndef SRS_OSX if ((i % SRS_SYS_CPU_STAT_RESOLUTION_TIMES) == 0) { srs_info("update cpu info, cpu usage."); srs_update_proc_stat(); @@ -868,6 +869,7 @@ int SrsServer::do_cycle() } } #endif +#endif #endif srs_info("server main thread loop"); }