mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix build script
This commit is contained in:
parent
c143c80fd6
commit
6e9e0d6ce3
4 changed files with 24 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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 <sys/socket.h>" > ${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
|
||||
|
|
|
@ -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") {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue