winlin

support disable the librtmp

@@ -15,6 +15,7 @@ SRS_HLS=RESERVED @@ -15,6 +15,7 @@ SRS_HLS=RESERVED
15 SRS_SSL=RESERVED 15 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_RESEARCH=RESERVED 19 SRS_RESEARCH=RESERVED
19 SRS_UTEST=RESERVED 20 SRS_UTEST=RESERVED
20 SRS_GPERF=RESERVED # tcmalloc 21 SRS_GPERF=RESERVED # tcmalloc
@@ -30,6 +31,7 @@ SRS_HLS=YES @@ -30,6 +31,7 @@ SRS_HLS=YES
30 SRS_SSL=YES 31 SRS_SSL=YES
31 SRS_FFMPEG=YES 32 SRS_FFMPEG=YES
32 SRS_HTTP=YES 33 SRS_HTTP=YES
  34 +SRS_LIBRTMP=YES
33 SRS_RESEARCH=NO 35 SRS_RESEARCH=NO
34 SRS_UTEST=YES 36 SRS_UTEST=YES
35 SRS_GPERF=NO 37 SRS_GPERF=NO
@@ -62,6 +64,7 @@ do @@ -62,6 +64,7 @@ do
62 --with-hls) SRS_HLS=YES ;; 64 --with-hls) SRS_HLS=YES ;;
63 --with-ffmpeg) SRS_FFMPEG=YES ;; 65 --with-ffmpeg) SRS_FFMPEG=YES ;;
64 --with-http) SRS_HTTP=YES ;; 66 --with-http) SRS_HTTP=YES ;;
  67 + --with-librtmp) SRS_LIBRTMP=YES ;;
65 --with-research) SRS_RESEARCH=YES ;; 68 --with-research) SRS_RESEARCH=YES ;;
66 --with-utest) SRS_UTEST=YES ;; 69 --with-utest) SRS_UTEST=YES ;;
67 --with-gperf) SRS_GPERF=YES ;; 70 --with-gperf) SRS_GPERF=YES ;;
@@ -74,6 +77,7 @@ do @@ -74,6 +77,7 @@ do
74 --without-hls) SRS_HLS=NO ;; 77 --without-hls) SRS_HLS=NO ;;
75 --without-ffmpeg) SRS_FFMPEG=NO ;; 78 --without-ffmpeg) SRS_FFMPEG=NO ;;
76 --without-http) SRS_HTTP=NO ;; 79 --without-http) SRS_HTTP=NO ;;
  80 + --without-librtmp) SRS_LIBRTMP=NO ;;
77 --without-research) SRS_RESEARCH=NO ;; 81 --without-research) SRS_RESEARCH=NO ;;
78 --without-utest) SRS_UTEST=NO ;; 82 --without-utest) SRS_UTEST=NO ;;
79 --without-gperf) SRS_GPERF=NO ;; 83 --without-gperf) SRS_GPERF=NO ;;
@@ -115,6 +119,7 @@ if [ $help = yes ]; then @@ -115,6 +119,7 @@ if [ $help = yes ]; then
115 --with-http enable http hooks, build cherrypy as demo api server. 119 --with-http enable http hooks, build cherrypy as demo api server.
116 srs will call the http hooks, such as: on_connect. 120 srs will call the http hooks, such as: on_connect.
117 --with-ffmpeg enable transcoding with ffmpeg. 121 --with-ffmpeg enable transcoding with ffmpeg.
  122 + --with-librtmp enable srs-librtmp, library for client.
118 --with-research build the research tools. 123 --with-research build the research tools.
119 --with-utest build the utest for srs. 124 --with-utest build the utest for srs.
120 --with-gperf build srs with gperf tools(no gmc/gmp/gcp, with tcmalloc only). 125 --with-gperf build srs with gperf tools(no gmc/gmp/gcp, with tcmalloc only).
@@ -127,6 +132,7 @@ if [ $help = yes ]; then @@ -127,6 +132,7 @@ if [ $help = yes ]; then
127 --without-hls disable hls, rtmp streaming only. 132 --without-hls disable hls, rtmp streaming only.
128 --without-http disable http, http hooks callback. 133 --without-http disable http, http hooks callback.
129 --without-ffmpeg disable the ffmpeg transcoding feature. 134 --without-ffmpeg disable the ffmpeg transcoding feature.
  135 + --without-librtmp disable srs-librtmp, library for client.
130 --without-research do not build the research tools. 136 --without-research do not build the research tools.
131 --without-utest do not build the utest for srs. 137 --without-utest do not build the utest for srs.
132 --without-gperf do not build srs with gperf tools(without tcmalloc and gmc/gmp/gcp). 138 --without-gperf do not build srs with gperf tools(without tcmalloc and gmc/gmp/gcp).
@@ -230,6 +236,10 @@ if [ $SRS_GPERF_CP = RESERVED ]; then @@ -230,6 +236,10 @@ if [ $SRS_GPERF_CP = RESERVED ]; then
230 echo "you must specifies the gperf-cp, see: ./configure --help"; 236 echo "you must specifies the gperf-cp, see: ./configure --help";
231 __check_ok=NO 237 __check_ok=NO
232 fi 238 fi
  239 +if [ $SRS_LIBRTMP = RESERVED ]; then
  240 + echo "you must specifies the librtmp, see: ./configure --help";
  241 + __check_ok=NO
  242 +fi
233 if [ $__check_ok = NO ]; then 243 if [ $__check_ok = NO ]; then
234 exit 1; 244 exit 1;
235 fi 245 fi
@@ -62,6 +62,8 @@ SrsHlsSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_HLS = YES ]; then SrsHlsSu @@ -62,6 +62,8 @@ SrsHlsSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_HLS = YES ]; then SrsHlsSu
62 SrsSslSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\$(GREEN)"; fi 62 SrsSslSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\$(GREEN)"; fi
63 SrsFfmpegSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_FFMPEG = YES ]; then SrsFfmpegSummaryColor="\$(GREEN)"; fi 63 SrsFfmpegSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_FFMPEG = YES ]; then SrsFfmpegSummaryColor="\$(GREEN)"; fi
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
  66 +SrsLibrtmpSSLSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_LIBRTMP = YES ]; then if [ $SRS_SSL = YES ]; then SrsLibrtmpSSLSummaryColor="\$(GREEN)"; fi fi
65 SrsResearchSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\$(GREEN)"; fi 67 SrsResearchSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_RESEARCH = YES ]; then SrsResearchSummaryColor="\$(GREEN)"; fi
66 SrsUtestSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\$(GREEN)"; fi 68 SrsUtestSummaryColor="\$(YELLOW)(disabled) "; if [ $SRS_UTEST = YES ]; then SrsUtestSummaryColor="\$(GREEN)"; fi
67 SrsGperfSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi 69 SrsGperfSummaryColor="\$(GREEN)(disabled) "; if [ $SRS_GPERF = YES ]; then SrsGperfSummaryColor="\$(GREEN)"; fi
@@ -113,11 +115,11 @@ default: bandwidth librtmp-sample utest @@ -113,11 +115,11 @@ default: bandwidth librtmp-sample utest
113 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)" 115 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
114 @echo -e " |\$(GREEN)bandwidth: ./objs/bandwidth, the bandwidth test client\$(BLACK)" 116 @echo -e " |\$(GREEN)bandwidth: ./objs/bandwidth, the bandwidth test client\$(BLACK)"
115 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)" 117 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
116 - @echo -e " |\$(GREEN)librtmp @see: https://github.com/winlinvip/simple-rtmp-server/wiki/SrsLibrtmp\$(BLACK)"  
117 - @echo -e " |\$(GREEN)librtmp: ./objs/include, ./objs/lib, the srs-librtmp library\$(BLACK)"  
118 - @echo -e " | \$(GREEN)simple handshake: publish/play stream with simple handshake to server\$(BLACK)"  
119 - @echo -e " | ${SrsSslSummaryColor}complex handshake: it's not required for client, recommend disable it\$(BLACK)"  
120 - @echo -e " | \$(GREEN)librtmp-sample: ./research/librtmp, the srs-librtmp client sample\$(BLACK)" 118 + @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}simple handshake: publish/play stream with simple handshake to server\$(BLACK)"
  121 + @echo -e " | ${SrsLibrtmpSSLSummaryColor}complex handshake: it's not required for client, recommend disable it\$(BLACK)"
  122 + @echo -e " | ${SrsLibrtmpSummaryColor}librtmp-sample: ./research/librtmp, the srs-librtmp client sample\$(BLACK)"
121 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)" 123 @echo -e " \$(BLACK)+------------------------------------------------------------------------------------\$(BLACK)"
122 @echo -e " |\$(GREEN)server: ./objs/srs, the srs server\$(BLACK)" 124 @echo -e " |\$(GREEN)server: ./objs/srs, the srs server\$(BLACK)"
123 @echo -e " | ${SrsHlsSummaryColor}hls @see: https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS\$(BLACK)" 125 @echo -e " | ${SrsHlsSummaryColor}hls @see: https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS\$(BLACK)"
@@ -155,6 +157,10 @@ bandwidth: server @@ -155,6 +157,10 @@ bandwidth: server
155 @echo "build the bandwidth test client tool" 157 @echo "build the bandwidth test client tool"
156 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} bandwidth 158 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} bandwidth
157 159
  160 +END
  161 +
  162 +if [ $SRS_LIBRTMP = YES ]; then
  163 + cat << END >> ${SRS_MAKEFILE}
158 librtmp: server 164 librtmp: server
159 @echo "build the client publish/play library." 165 @echo "build the client publish/play library."
160 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} librtmp 166 \$(MAKE) -f ${SRS_OBJS}/${SRS_MAKEFILE} librtmp
@@ -164,11 +170,35 @@ librtmp-sample: librtmp @@ -164,11 +170,35 @@ librtmp-sample: librtmp
164 (cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry}) 170 (cd research/librtmp; \$(MAKE) ${SrsLibrtmpSampleEntry})
165 @echo "srs-librtmp sample build success" 171 @echo "srs-librtmp sample build success"
166 172
  173 +END
  174 +else
  175 + cat << END >> ${SRS_MAKEFILE}
  176 +librtmp: server
  177 + @echo "srs-librtmp is disabled, ignore."
  178 +
  179 +librtmp-sample: librtmp
  180 + @echo "srs-librtmp sample is disabled, ignore."
  181 +
  182 +END
  183 +fi
  184 +
  185 +if [ $SRS_UTEST = YES ]; then
  186 + cat << END >> ${SRS_MAKEFILE}
167 utest: server 187 utest: server
168 @echo "build the utest for srs" 188 @echo "build the utest for srs"
169 ${SrsUtestMakeEntry} 189 ${SrsUtestMakeEntry}
170 @echo "utest for srs build success" 190 @echo "utest for srs build success"
171 191
  192 +END
  193 +else
  194 + cat << END >> ${SRS_MAKEFILE}
  195 +utest: server
  196 + @echo "utest is disabled, ignore"
  197 +
  198 +END
  199 +fi
  200 +
  201 +cat << END >> ${SRS_MAKEFILE}
172 # the ./configure will generate it. 202 # the ./configure will generate it.
173 _prepare_dir: 203 _prepare_dir:
174 @mkdir -p ${SRS_OBJS} 204 @mkdir -p ${SRS_OBJS}
@@ -298,9 +328,11 @@ BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh @@ -298,9 +328,11 @@ BUILD_KEY="srs" APP_MAIN="srs_main_server" APP_NAME="srs" . auto/apps.sh
298 # bandwidth test tool, to test the bandwidth to server 328 # bandwidth test tool, to test the bandwidth to server
299 BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" . auto/apps.sh 329 BUILD_KEY="bandwidth" APP_MAIN="srs_main_bandcheck" APP_NAME="bandwidth" . auto/apps.sh
300 # 330 #
301 -# srs librtmp  
302 -MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${LIBS_OBJS[@]}"  
303 -BUILD_KEY="librtmp" LIB_NAME="lib/srs_librtmp" . auto/libs.sh 331 +if [ $SRS_LIBRTMP = YES ]; then
  332 + # srs librtmp
  333 + MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${RTMP_OBJS[@]} ${LIBS_OBJS[@]}"
  334 + BUILD_KEY="librtmp" LIB_NAME="lib/srs_librtmp" . auto/libs.sh
  335 +fi
304 # 336 #
305 # utest, the unit-test cases of srs, base on gtest1.6 337 # utest, the unit-test cases of srs, base on gtest1.6
306 MODULE_FILES=("srs_utest") 338 MODULE_FILES=("srs_utest")
@@ -344,6 +376,11 @@ if [ $SRS_HTTP = YES ]; then @@ -344,6 +376,11 @@ if [ $SRS_HTTP = YES ]; then
344 else 376 else
345 echo -e "${YELLOW}warning: without http hooks callback over CherryPy support${BLACK}" 377 echo -e "${YELLOW}warning: without http hooks callback over CherryPy support${BLACK}"
346 fi 378 fi
  379 +if [ $SRS_LIBRTMP = YES ]; then
  380 + echo -e "${GREEN}srs-librtmp for client is enabled${BLACK}"
  381 +else
  382 + echo -e "${YELLOW}note: srs-librtmp for client is disabled${BLACK}"
  383 +fi
347 if [ $SRS_RESEARCH = YES ]; then 384 if [ $SRS_RESEARCH = YES ]; then
348 echo -e "${GREEN}research tools are builded${BLACK}" 385 echo -e "${GREEN}research tools are builded${BLACK}"
349 else 386 else
@@ -357,7 +394,7 @@ fi @@ -357,7 +394,7 @@ fi
357 if [ $SRS_GPERF = YES ]; then 394 if [ $SRS_GPERF = YES ]; then
358 echo -e "${GREEN}gperf(tcmalloc) for srs are builded${BLACK}" 395 echo -e "${GREEN}gperf(tcmalloc) for srs are builded${BLACK}"
359 else 396 else
360 - echo -e "${BLACK}note: gperf(tcmalloc) for srs are not builded${BLACK}" 397 + echo -e "${GREEN}note: gperf(tcmalloc) for srs are not builded${BLACK}"
361 fi 398 fi
362 if [ $SRS_GPERF_MC = YES ]; then 399 if [ $SRS_GPERF_MC = YES ]; then
363 echo -e "${YELLOW}gmc(gperf memory check) for srs are builded -- Performance may suffer${BLACK}" 400 echo -e "${YELLOW}gmc(gperf memory check) for srs are builded -- Performance may suffer${BLACK}"