diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index f2d3e378c..8fd54333c 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -84,15 +84,6 @@ function Ubuntu_prepare() echo "The unzip is installed." fi - if [[ $SRS_NASM == YES ]]; then - nasm -v >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then - echo "Installing nasm." - require_sudoer "sudo apt-get install -y --force-yes nasm" - sudo apt-get install -y --force-yes nasm; ret=$?; if [[ 0 -ne $ret ]]; then return $ret; fi - echo "The nasm is installed." - fi - fi - if [[ $SRS_VALGRIND == YES ]]; then valgrind --help >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then echo "Installing valgrind." @@ -281,6 +272,10 @@ function OSX_prepare() echo "install unzip success" fi + pkg-config --version >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then + echo "Please install pkg-config"; exit -1; + fi + echo "OSX install tools success" return 0 } @@ -614,9 +609,16 @@ fi ##################################################################################### if [[ $SRS_EXPORT_LIBRTMP_PROJECT == NO && $SRS_RTC == YES ]]; then FFMPEG_OPTIONS="" + + # If disable nasm, disable all ASMs. if [[ $SRS_NASM == NO ]]; then FFMPEG_OPTIONS="--disable-asm --disable-x86asm --disable-inline-asm" fi + # If no nasm, we disable the x86asm. + nasm -v >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then + FFMPEG_OPTIONS="--disable-x86asm" + fi + if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg/lib/libavcodec.a ]]; then echo "The ffmpeg-4.2-fit is ok."; else diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 69293fce3..f2b0cb7e6 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -569,6 +569,7 @@ function apply_user_detail_options() { # Detect whether has sendmmsg. # @see http://man7.org/linux/man-pages/man2/sendmmsg.2.html + mkdir -p ${SRS_OBJS} && echo "#include " > ${SRS_OBJS}/_tmp_sendmmsg_detect.c echo "int main(int argc, char** argv) {" >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c echo " struct mmsghdr hdr;" >> ${SRS_OBJS}/_tmp_sendmmsg_detect.c diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp index 6a83f7a8c..fdfbf8747 100644 --- a/trunk/src/app/srs_app_http_api.cpp +++ b/trunk/src/app/srs_app_http_api.cpp @@ -1615,14 +1615,22 @@ srs_error_t SrsGoApiPerf::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* SrsStatistic* stat = SrsStatistic::instance(); string target = r->query_get("target"); - srs_trace("query target=%s", target.c_str()); + string reset = r->query_get("reset"); + srs_trace("query target=%s, reset=%s", target.c_str(), reset.c_str()); if (true) { SrsJsonObject* p = SrsJsonAny::object(); data->set("query", p); p->set("target", SrsJsonAny::str(target.c_str())); + p->set("reset", SrsJsonAny::str(reset.c_str())); p->set("help", SrsJsonAny::str("?target=avframes|rtc|rtp|gso|writev_iovs|sendmmsg")); + p->set("help2", SrsJsonAny::str("?reset=all")); + } + + if (!reset.empty()) { + stat->reset_perf(); + return srs_api_response(w, r, obj->dumps()); } if (target.empty() || target == "avframes") { diff --git a/trunk/src/app/srs_app_statistic.hpp b/trunk/src/app/srs_app_statistic.hpp index 0d9905f75..c0344989f 100644 --- a/trunk/src/app/srs_app_statistic.hpp +++ b/trunk/src/app/srs_app_statistic.hpp @@ -262,6 +262,9 @@ public: virtual void perf_sendmmsg_on_packets(int nb_packets); // Dumps the perf statistic data for UDP sendmmsg, for performance analysis. virtual srs_error_t dumps_perf_sendmmsg(SrsJsonObject* obj); +public: + // Reset all perf stat data. + virtual void reset_perf(); private: virtual void perf_on_packets(SrsStatisticCategory* p, int nb_msgs); virtual srs_error_t dumps_perf(SrsStatisticCategory* p, SrsJsonObject* obj);