winlin

add option bwtc, to enable or disable the bandwidth test tool

@@ -16,6 +16,7 @@ SRS_SSL=RESERVED @@ -16,6 +16,7 @@ SRS_SSL=RESERVED
16 SRS_FFMPEG=RESERVED 16 SRS_FFMPEG=RESERVED
17 SRS_HTTP=RESERVED 17 SRS_HTTP=RESERVED
18 SRS_LIBRTMP=RESERVED # srs-librtmp 18 SRS_LIBRTMP=RESERVED # srs-librtmp
  19 +SRS_BWTC=RESERVED # srs-bandwidth-test client
19 SRS_RESEARCH=RESERVED 20 SRS_RESEARCH=RESERVED
20 SRS_UTEST=RESERVED 21 SRS_UTEST=RESERVED
21 SRS_GPERF=RESERVED # tcmalloc 22 SRS_GPERF=RESERVED # tcmalloc
@@ -32,6 +33,7 @@ SRS_SSL=YES @@ -32,6 +33,7 @@ SRS_SSL=YES
32 SRS_FFMPEG=YES 33 SRS_FFMPEG=YES
33 SRS_HTTP=YES 34 SRS_HTTP=YES
34 SRS_LIBRTMP=YES 35 SRS_LIBRTMP=YES
  36 +SRS_BWTC=YES
35 SRS_RESEARCH=NO 37 SRS_RESEARCH=NO
36 SRS_UTEST=YES 38 SRS_UTEST=YES
37 SRS_GPERF=NO 39 SRS_GPERF=NO
@@ -65,6 +67,7 @@ do @@ -65,6 +67,7 @@ do
65 --with-ffmpeg) SRS_FFMPEG=YES ;; 67 --with-ffmpeg) SRS_FFMPEG=YES ;;
66 --with-http) SRS_HTTP=YES ;; 68 --with-http) SRS_HTTP=YES ;;
67 --with-librtmp) SRS_LIBRTMP=YES ;; 69 --with-librtmp) SRS_LIBRTMP=YES ;;
  70 + --with-bwtc) SRS_BWTC=YES ;;
68 --with-research) SRS_RESEARCH=YES ;; 71 --with-research) SRS_RESEARCH=YES ;;
69 --with-utest) SRS_UTEST=YES ;; 72 --with-utest) SRS_UTEST=YES ;;
70 --with-gperf) SRS_GPERF=YES ;; 73 --with-gperf) SRS_GPERF=YES ;;
@@ -78,6 +81,7 @@ do @@ -78,6 +81,7 @@ do
78 --without-ffmpeg) SRS_FFMPEG=NO ;; 81 --without-ffmpeg) SRS_FFMPEG=NO ;;
79 --without-http) SRS_HTTP=NO ;; 82 --without-http) SRS_HTTP=NO ;;
80 --without-librtmp) SRS_LIBRTMP=NO ;; 83 --without-librtmp) SRS_LIBRTMP=NO ;;
  84 + --without-bwtc) SRS_BWTC=NO ;;
81 --without-research) SRS_RESEARCH=NO ;; 85 --without-research) SRS_RESEARCH=NO ;;
82 --without-utest) SRS_UTEST=NO ;; 86 --without-utest) SRS_UTEST=NO ;;
83 --without-gperf) SRS_GPERF=NO ;; 87 --without-gperf) SRS_GPERF=NO ;;
@@ -120,6 +124,7 @@ if [ $help = yes ]; then @@ -120,6 +124,7 @@ if [ $help = yes ]; then
120 srs will call the http hooks, such as: on_connect. 124 srs will call the http hooks, such as: on_connect.
121 --with-ffmpeg enable transcoding with ffmpeg. 125 --with-ffmpeg enable transcoding with ffmpeg.
122 --with-librtmp enable srs-librtmp, library for client. 126 --with-librtmp enable srs-librtmp, library for client.
  127 + --with-bwtc enable srs bandwidth test client tool.
123 --with-research build the research tools. 128 --with-research build the research tools.
124 --with-utest build the utest for srs. 129 --with-utest build the utest for srs.
125 --with-gperf build srs with gperf tools(no gmc/gmp/gcp, with tcmalloc only). 130 --with-gperf build srs with gperf tools(no gmc/gmp/gcp, with tcmalloc only).
@@ -133,6 +138,7 @@ if [ $help = yes ]; then @@ -133,6 +138,7 @@ if [ $help = yes ]; then
133 --without-http disable http, http hooks callback. 138 --without-http disable http, http hooks callback.
134 --without-ffmpeg disable the ffmpeg transcoding feature. 139 --without-ffmpeg disable the ffmpeg transcoding feature.
135 --without-librtmp disable srs-librtmp, library for client. 140 --without-librtmp disable srs-librtmp, library for client.
  141 + --without-bwtc disable srs bandwidth test client tool.
136 --without-research do not build the research tools. 142 --without-research do not build the research tools.
137 --without-utest do not build the utest for srs. 143 --without-utest do not build the utest for srs.
138 --without-gperf do not build srs with gperf tools(without tcmalloc and gmc/gmp/gcp). 144 --without-gperf do not build srs with gperf tools(without tcmalloc and gmc/gmp/gcp).
@@ -240,6 +246,10 @@ if [ $SRS_LIBRTMP = RESERVED ]; then @@ -240,6 +246,10 @@ if [ $SRS_LIBRTMP = RESERVED ]; then
240 echo "you must specifies the librtmp, see: ./configure --help"; 246 echo "you must specifies the librtmp, see: ./configure --help";
241 __check_ok=NO 247 __check_ok=NO
242 fi 248 fi
  249 +if [ $SRS_BWTC = RESERVED ]; then
  250 + echo "you must specifies the bwtc, see: ./configure --help";
  251 + __check_ok=NO
  252 +fi
243 if [ $__check_ok = NO ]; then 253 if [ $__check_ok = NO ]; then
244 exit 1; 254 exit 1;
245 fi 255 fi
@@ -64,6 +64,7 @@ SrsFfmpegSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_FFMPEG = YES ]; then Sr @@ -64,6 +64,7 @@ SrsFfmpegSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_FFMPEG = YES ]; then Sr
64 SrsHttpSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_HTTP = YES ]; then SrsHttpSummaryColor="\$(GREEN)"; fi 64 SrsHttpSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_HTTP = YES ]; then SrsHttpSummaryColor="\$(GREEN)"; fi
65 SrsLibrtmpSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_LIBRTMP = YES ]; then SrsLibrtmpSummaryColor="\$(GREEN)"; fi 65 SrsLibrtmpSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_LIBRTMP = YES ]; then SrsLibrtmpSummaryColor="\$(GREEN)"; fi
66 SrsLibrtmpSSLSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_SSL = YES ]; then SrsLibrtmpSSLSummaryColor="\$(GREEN)"; fi fi 66 SrsLibrtmpSSLSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_SSL = YES ]; then SrsLibrtmpSSLSummaryColor="\$(GREEN)"; fi fi
  67 +SrsBWTCSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_BWTC = YES ]; then SrsBWTCSummaryColor="\$(GREEN)"; fi
67 SrsResearchSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\$(GREEN)"; fi 68 SrsResearchSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\$(GREEN)"; fi
68 SrsUtestSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\$(GREEN)"; fi 69 SrsUtestSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\$(GREEN)"; fi
69 SrsGperfSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi 70 SrsGperfSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi
@@ -113,7 +114,7 @@ default: bandwidth librtmp-sample utest @@ -113,7 +114,7 @@ default: bandwidth librtmp-sample utest
113 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)" 114 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
114 @echo -e " |${SrsUtestSummaryColor}utest: ./objs/srs_utest, the utest for srs\$(BLACK)" 115 @echo -e " |${SrsUtestSummaryColor}utest: ./objs/srs_utest, the utest for srs\$(BLACK)"
115 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)" 116 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
116 - @echo -e " |\$(GREEN)bandwidth: ./objs/bandwidth, the bandwidth test client\$(BLACK)" 117 + @echo -e " |${SrsBWTCSummaryColor}bandwidth: ./objs/bandwidth, the bandwidth test client\$(BLACK)"
117 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)" 118 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
118 @echo -e " |${SrsLibrtmpSummaryColor}librtmp @see: https://github.com/winlinvip/simple-rtmp-server/wiki/SrsLibrtmp\$(BLACK)" 119 @echo -e " |${SrsLibrtmpSummaryColor}librtmp @see: https://github.com/winlinvip/simple-rtmp-server/wiki/SrsLibrtmp\$(BLACK)"
119 @echo -e " |${SrsLibrtmpSummaryColor}librtmp: ./objs/include, ./objs/lib, the srs-librtmp library\$(BLACK)" 120 @echo -e " |${SrsLibrtmpSummaryColor}librtmp: ./objs/include, ./objs/lib, the srs-librtmp library\$(BLACK)"
@@ -153,11 +154,22 @@ server: _prepare_dir @@ -153,11 +154,22 @@ server: _prepare_dir
153 @echo "build the srs(simple rtmp server) over st(state-threads)" 154 @echo "build the srs(simple rtmp server) over st(state-threads)"
154 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} srs 155 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} srs
155 156
  157 +END
  158 +
  159 +if [ $SRS_BWTC = YES ]; then
  160 + cat << END >> ${SRS_MAKEFILE}
156 bandwidth: server 161 bandwidth: server
157 @echo "build the bandwidth test client tool" 162 @echo "build the bandwidth test client tool"
158 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} bandwidth 163 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} bandwidth
159 164
160 END 165 END
  166 +else
  167 + cat << END >> ${SRS_MAKEFILE}
  168 +bandwidth: server
  169 + @echo "bandwidth test client tool is disabled, ignore."
  170 +
  171 +END
  172 +fi
161 173
162 if [ $SRS_LIBRTMP = YES ]; then 174 if [ $SRS_LIBRTMP = YES ]; then
163 cat << END >> ${SRS_MAKEFILE} 175 cat << END >> ${SRS_MAKEFILE}
@@ -324,9 +336,10 @@ LINK_OPTIONS="-ldl${SrsGprofLink}${SrsGperfLink}" @@ -324,9 +336,10 @@ LINK_OPTIONS="-ldl${SrsGprofLink}${SrsGperfLink}"
324 # srs(simple rtmp server) over st(state-threads) 336 # srs(simple rtmp server) over st(state-threads)
325 BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh 337 BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh
326 # 338 #
327 -# bandwidth  
328 -# bandwidth test tool, to test the bandwidth to server  
329 -BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" . auto/apps.sh 339 +if [ $SRS_BWTC = YES ]; then
  340 + # bandwidth test tool, to test the bandwidth to server
  341 + BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" . auto/apps.sh
  342 +fi
330 # 343 #
331 if [ $SRS_LIBRTMP = YES ]; then 344 if [ $SRS_LIBRTMP = YES ]; then
332 # srs librtmp 345 # srs librtmp
@@ -381,6 +394,11 @@ if [ $SRS_LIBRTMP = YES ]; then @@ -381,6 +394,11 @@ if [ $SRS_LIBRTMP = YES ]; then
381 else 394 else
382 echo -e "${YELLOW}note: srs-librtmp for client is disabled${BLACK}" 395 echo -e "${YELLOW}note: srs-librtmp for client is disabled${BLACK}"
383 fi 396 fi
  397 +if [ $SRS_BWTC = YES ]; then
  398 + echo -e "${GREEN}srs bandwidth test client is enabled${BLACK}"
  399 +else
  400 + echo -e "${YELLOW}note: srs bandwidth test client is disabled${BLACK}"
  401 +fi
384 if [ $SRS_RESEARCH = YES ]; then 402 if [ $SRS_RESEARCH = YES ]; then
385 echo -e "${GREEN}research tools are builded${BLACK}" 403 echo -e "${GREEN}research tools are builded${BLACK}"
386 else 404 else