1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add dvr option. refine macros of auto headers

This commit is contained in:
winlin 2014-04-15 14:01:57 +08:00
parent 1ae9178605
commit 23a1b29935
34 changed files with 242 additions and 150 deletions

View file

@ -289,21 +289,21 @@ if [ $SRS_HTTP_PARSER = YES ]; then
fi fi
if [ $SRS_HTTP_PARSER = YES ]; then if [ $SRS_HTTP_PARSER = YES ]; then
echo "#define SRS_HTTP_PARSER" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_HTTP_PARSER" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_HTTP_PARSER" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_HTTP_PARSER" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_HTTP_SERVER = YES ]; then if [ $SRS_HTTP_SERVER = YES ]; then
echo "#define SRS_HTTP_SERVER" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_HTTP_SERVER" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_HTTP_SERVER" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_HTTP_SERVER" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_HTTP_API = YES ]; then if [ $SRS_HTTP_API = YES ]; then
echo "#define SRS_HTTP_API" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_HTTP_API" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_HTTP_API" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_HTTP_API" >> $SRS_AUTO_HEADERS_H
fi fi
##################################################################################### #####################################################################################
@ -373,15 +373,21 @@ ln -sf `pwd`/research/api-server/static-dir/favicon.ico ${SRS_OBJS}/nginx/html/f
echo "nginx is ok" > ${SRS_OBJS}/nginx/html/nginx.html echo "nginx is ok" > ${SRS_OBJS}/nginx/html/nginx.html
if [ $SRS_NGINX = YES ]; then if [ $SRS_NGINX = YES ]; then
echo "#define SRS_NGINX" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_NGINX" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_NGINX" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_NGINX" >> $SRS_AUTO_HEADERS_H
fi
if [ $SRS_DVR = YES ]; then
echo "#define SRS_AUTO_DVR" >> $SRS_AUTO_HEADERS_H
else
echo "#undef SRS_AUTO_DVR" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_HLS = YES ]; then if [ $SRS_HLS = YES ]; then
echo "#define SRS_HLS" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_HLS" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_HLS" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_HLS" >> $SRS_AUTO_HEADERS_H
fi fi
##################################################################################### #####################################################################################
@ -405,9 +411,9 @@ if [ $SRS_HTTP_CALLBACK = YES ]; then
fi fi
if [ $SRS_HTTP_CALLBACK = YES ]; then if [ $SRS_HTTP_CALLBACK = YES ]; then
echo "#define SRS_HTTP_CALLBACK" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_HTTP_CALLBACK" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_HTTP_CALLBACK" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_HTTP_CALLBACK" >> $SRS_AUTO_HEADERS_H
fi fi
echo "link players to cherrypy static-dir" echo "link players to cherrypy static-dir"
@ -489,9 +495,9 @@ if [ $SRS_SSL = YES ]; then
fi fi
if [ $SRS_SSL = YES ]; then if [ $SRS_SSL = YES ]; then
echo "#define SRS_SSL" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_SSL" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_SSL" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_SSL" >> $SRS_AUTO_HEADERS_H
fi fi
##################################################################################### #####################################################################################
@ -520,21 +526,21 @@ __SRS_FFMPEG_STUB=NO
if [ $SRS_TRANSCODE = YES ]; then __SRS_FFMPEG_STUB=YES; fi if [ $SRS_TRANSCODE = YES ]; then __SRS_FFMPEG_STUB=YES; fi
if [ $SRS_INGEST = YES ]; then __SRS_FFMPEG_STUB=YES; fi if [ $SRS_INGEST = YES ]; then __SRS_FFMPEG_STUB=YES; fi
if [ $__SRS_FFMPEG_STUB = YES ]; then if [ $__SRS_FFMPEG_STUB = YES ]; then
echo "#define SRS_FFMPEG_STUB" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_FFMPEG" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_FFMPEG_STUB" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_FFMPEG" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_TRANSCODE = YES ]; then if [ $SRS_TRANSCODE = YES ]; then
echo "#define SRS_RTMP_TRANSCODE" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_TRANSCODE" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_RTMP_TRANSCODE" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_TRANSCODE" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_INGEST = YES ]; then if [ $SRS_INGEST = YES ]; then
echo "#define SRS_RTMP_INGEST" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_INGEST" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_RTMP_INGEST" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_INGEST" >> $SRS_AUTO_HEADERS_H
fi fi
##################################################################################### #####################################################################################
@ -591,38 +597,38 @@ if [ $SRS_GPERF = YES ]; then
fi fi
if [ $SRS_GPERF = YES ]; then if [ $SRS_GPERF = YES ]; then
echo "#define SRS_GPERF" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_GPERF" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_GPERF" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_GPERF" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_GPERF_MC = YES ]; then if [ $SRS_GPERF_MC = YES ]; then
echo "#define SRS_GPERF_MC" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_GPERF_MC" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_GPERF_MC" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_GPERF_MC" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_GPERF_MP = YES ]; then if [ $SRS_GPERF_MP = YES ]; then
echo "#define SRS_GPERF_MP" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_GPERF_MP" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_GPERF_MP" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_GPERF_MP" >> $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_GPERF_CP = YES ]; then if [ $SRS_GPERF_CP = YES ]; then
echo "#define SRS_GPERF_CP" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_GPERF_CP" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_GPERF_CP" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_GPERF_CP" >> $SRS_AUTO_HEADERS_H
fi fi
##################################################################################### #####################################################################################
# for arm. # for arm.
##################################################################################### #####################################################################################
if [ $SRS_ARM_UBUNTU12 = YES ]; then if [ $SRS_ARM_UBUNTU12 = YES ]; then
echo "#define SRS_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H
else else
echo "#undef SRS_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H echo "#undef SRS_AUTO_ARM_UBUNTU12" >> $SRS_AUTO_HEADERS_H
fi fi
echo "" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H
# prefix # prefix
echo "#define SRS_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H
@ -634,7 +640,7 @@ if [ $OS_IS_CENTOS = YES ]; then
else else
SRS_CONSTRIBUTORS=`cat ../AUTHORS.txt|grep "*"|awk -F '\* ' '{print $2}'` SRS_CONSTRIBUTORS=`cat ../AUTHORS.txt|grep "*"|awk -F '\* ' '{print $2}'`
fi fi
echo "#define SRS_CONSTRIBUTORS \"\\" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_CONSTRIBUTORS \"\\" >> $SRS_AUTO_HEADERS_H
for CONTRIBUTOR in $SRS_CONSTRIBUTORS; do for CONTRIBUTOR in $SRS_CONSTRIBUTORS; do
echo "${CONTRIBUTOR} \\" >> $SRS_AUTO_HEADERS_H echo "${CONTRIBUTOR} \\" >> $SRS_AUTO_HEADERS_H
done done

View file

@ -14,6 +14,7 @@
help=no help=no
SRS_HLS=RESERVED SRS_HLS=RESERVED
SRS_DVR=RESERVED
SRS_NGINX=RESERVED SRS_NGINX=RESERVED
SRS_SSL=RESERVED SRS_SSL=RESERVED
SRS_FFMPEG_TOOL=RESERVED SRS_FFMPEG_TOOL=RESERVED
@ -74,6 +75,7 @@ do
--with-ssl) SRS_SSL=YES ;; --with-ssl) SRS_SSL=YES ;;
--with-hls) SRS_HLS=YES ;; --with-hls) SRS_HLS=YES ;;
--with-dvr) SRS_DVR=YES ;;
--with-nginx) SRS_NGINX=YES ;; --with-nginx) SRS_NGINX=YES ;;
--with-ffmpeg) SRS_FFMPEG_TOOL=YES ;; --with-ffmpeg) SRS_FFMPEG_TOOL=YES ;;
--with-transcode) SRS_TRANSCODE=YES ;; --with-transcode) SRS_TRANSCODE=YES ;;
@ -94,6 +96,7 @@ do
--without-ssl) SRS_SSL=NO ;; --without-ssl) SRS_SSL=NO ;;
--without-hls) SRS_HLS=NO ;; --without-hls) SRS_HLS=NO ;;
--without-dvr) SRS_DVR=NO ;;
--without-nginx) SRS_NGINX=NO ;; --without-nginx) SRS_NGINX=NO ;;
--without-ffmpeg) SRS_FFMPEG_TOOL=NO ;; --without-ffmpeg) SRS_FFMPEG_TOOL=NO ;;
--without-transcode) SRS_TRANSCODE=NO ;; --without-transcode) SRS_TRANSCODE=NO ;;
@ -142,6 +145,7 @@ if [ $SRS_INGEST = YES ]; then if [ $SRS_FFMPEG_TOOL = RESERVED ]; then SRS_FFMP
# if arm specified, set some default to disabled. # if arm specified, set some default to disabled.
if [ $SRS_ARM_UBUNTU12 = YES ]; then if [ $SRS_ARM_UBUNTU12 = YES ]; then
if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi
if [ $SRS_DVR = RESERVED ]; then SRS_DVR=YES; fi
SRS_NGINX=NO SRS_NGINX=NO
if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi
SRS_FFMPEG_TOOL=NO SRS_FFMPEG_TOOL=NO
@ -167,6 +171,7 @@ if [ $SRS_ARM_UBUNTU12 = YES ]; then
SRS_STATIC=YES SRS_STATIC=YES
else else
if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi if [ $SRS_HLS = RESERVED ]; then SRS_HLS=YES; fi
if [ $SRS_DVR = RESERVED ]; then SRS_DVR=YES; fi
if [ $SRS_NGINX = RESERVED ]; then SRS_NGINX=NO; fi if [ $SRS_NGINX = RESERVED ]; then SRS_NGINX=NO; fi
if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi if [ $SRS_SSL = RESERVED ]; then SRS_SSL=YES; fi
if [ $SRS_FFMPEG_TOOL = RESERVED ]; then SRS_FFMPEG_TOOL=NO; fi if [ $SRS_FFMPEG_TOOL = RESERVED ]; then SRS_FFMPEG_TOOL=NO; fi
@ -194,6 +199,7 @@ fi
# if dev specified, open features if possible. # if dev specified, open features if possible.
if [ $SRS_DEV = YES ]; then if [ $SRS_DEV = YES ]; then
SRS_HLS=YES SRS_HLS=YES
SRS_DVR=YES
SRS_NGINX=NO SRS_NGINX=NO
SRS_SSL=YES SRS_SSL=YES
SRS_FFMPEG_TOOL=YES SRS_FFMPEG_TOOL=YES
@ -220,6 +226,7 @@ fi
# if raspberry-pi specified, open ssl/hls/static features # if raspberry-pi specified, open ssl/hls/static features
if [ $SRS_PI = YES ]; then if [ $SRS_PI = YES ]; then
SRS_HLS=YES SRS_HLS=YES
SRS_DVR=YES
SRS_NGINX=NO SRS_NGINX=NO
SRS_SSL=YES SRS_SSL=YES
SRS_FFMPEG_TOOL=NO SRS_FFMPEG_TOOL=NO
@ -264,6 +271,7 @@ if [ $help = yes ]; then
--with-ssl enable rtmp complex handshake, requires openssl-devel installed. --with-ssl enable rtmp complex handshake, requires openssl-devel installed.
to delivery h264 video and aac audio to flash player. to delivery h264 video and aac audio to flash player.
--with-hls enable hls streaming, mux RTMP to m3u8/ts files. --with-hls enable hls streaming, mux RTMP to m3u8/ts files.
--with-dvr enable dvr, mux RTMP to flv files.
--with-nginx enable delivery HTTP stream with nginx. --with-nginx enable delivery HTTP stream with nginx.
build nginx at: ./objs/nginx/sbin/nginx build nginx at: ./objs/nginx/sbin/nginx
--with-http-callback enable http hooks, build cherrypy as demo api server. --with-http-callback enable http hooks, build cherrypy as demo api server.
@ -288,6 +296,7 @@ if [ $help = yes ]; then
--without-ssl disable rtmp complex handshake. --without-ssl disable rtmp complex handshake.
--without-hls disable hls, rtmp streaming only. --without-hls disable hls, rtmp streaming only.
--without-dvr disable dvr, donot support record RTMP stream to flv.
--without-nginx disable delivery HTTP stream with nginx. --without-nginx disable delivery HTTP stream with nginx.
--without-http-callback disable http, http hooks callback. --without-http-callback disable http, http hooks callback.
--without-http-server disable http server, use external server to delivery http stream. --without-http-server disable http server, use external server to delivery http stream.
@ -360,6 +369,7 @@ fi
# check variable neccessary # check variable neccessary
if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_HLS = RESERVED ]; then echo "you must specifies the hls, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_DVR = RESERVED ]; then echo "you must specifies the dvr, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_NGINX = RESERVED ]; then echo "you must specifies the nginx, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_SSL = RESERVED ]; then echo "you must specifies the ssl, see: ./configure --help"; __check_ok=NO; fi
if [ $SRS_FFMPEG_TOOL = RESERVED ]; then echo "you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi if [ $SRS_FFMPEG_TOOL = RESERVED ]; then echo "you must specifies the ffmpeg, see: ./configure --help"; __check_ok=NO; fi
@ -386,6 +396,7 @@ SRS_CONFIGURE=""
if [ $SRS_DEV = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --dev"; fi if [ $SRS_DEV = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --dev"; fi
if [ $SRS_PI = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --pi"; fi if [ $SRS_PI = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --pi"; fi
if [ $SRS_HLS = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-hls"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-hls"; fi if [ $SRS_HLS = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-hls"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-hls"; fi
if [ $SRS_DVR = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-dvr"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-dvr"; fi
if [ $SRS_NGINX = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-nginx"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-nginx"; fi if [ $SRS_NGINX = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-nginx"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-nginx"; fi
if [ $SRS_SSL = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ssl"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ssl"; fi if [ $SRS_SSL = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ssl"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ssl"; fi
if [ $SRS_FFMPEG_TOOL = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ffmpeg"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ffmpeg"; fi if [ $SRS_FFMPEG_TOOL = YES ]; then SRS_CONFIGURE="${SRS_CONFIGURE} --with-ffmpeg"; else SRS_CONFIGURE="${SRS_CONFIGURE} --without-ffmpeg"; fi

22
trunk/configure vendored
View file

@ -35,10 +35,10 @@ echo "#ifndef SRS_AUTO_HEADER_HPP" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_AUTO_HEADER_HPP" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_HEADER_HPP" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_BUILD_TS \"`date +%s`\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_BUILD_DATE \"`date \"+%Y-%m-%d %H:%M:%S\"`\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_UNAME \"`uname -a`\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_UNAME \"`uname -a`\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_CONFIGURE \"${SRS_CONFIGURE}\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_CONFIGURE \"${SRS_AUTO_CONFIGURE}\"" >> $SRS_AUTO_HEADERS_H
# new empty line to auto headers file. # new empty line to auto headers file.
echo "" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H
@ -54,7 +54,7 @@ if [[ -z $SrsArmAR ]]; then SrsArmAR="arm-linux-gnueabi-ar"; fi
if [[ -z $SrsArmLD ]]; then SrsArmLD="arm-linux-gnueabi-ld"; fi if [[ -z $SrsArmLD ]]; then SrsArmLD="arm-linux-gnueabi-ld"; fi
if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB="arm-linux-gnueabi-ranlib"; fi if [[ -z $SrsArmRANDLIB ]]; then SrsArmRANDLIB="arm-linux-gnueabi-ranlib"; fi
echo "cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB" echo "cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB"
echo "#define SRS_ARM_TOOL_CHAIN \"cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB\"" >> $SRS_AUTO_HEADERS_H echo "#define SRS_AUTO_ARM_TOOL_CHAIN \"cc=$SrsArmCC gcc=$SrsArmGCC g++=$SrsArmCXX ar=$SrsArmAR ld=$SrsArmLD randlib=$SrsArmRANDLIB\"" >> $SRS_AUTO_HEADERS_H
echo "" >> $SRS_AUTO_HEADERS_H echo "" >> $SRS_AUTO_HEADERS_H
# apply user options. # apply user options.
@ -82,6 +82,7 @@ if [ $SRS_UTEST = YES ]; then SrsUtestMakeEntry="(cd ${SRS_OBJS}/utest; \$(MAKE)
##################################################################################### #####################################################################################
# colorful summary # colorful summary
SrsHlsSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi SrsHlsSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_HLS = YES ]; then SrsHlsSummaryColor="\${GREEN}"; fi
SrsDvrSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_DVR = YES ]; then SrsDvrSummaryColor="\${GREEN}"; fi
SrsNginxSummaryColor="\${GREEN}{disabled} "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi SrsNginxSummaryColor="\${GREEN}{disabled} "; if [ $SRS_NGINX = YES ]; then SrsNginxSummaryColor="\${GREEN}"; fi
SrsSslSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi SrsSslSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_SSL = YES ]; then SrsSslSummaryColor="\${GREEN}"; fi
SrsFfmpegSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_FFMPEG_TOOL = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi SrsFfmpegSummaryColor="\${YELLOW}{disabled} "; if [ $SRS_FFMPEG_TOOL = YES ]; then SrsFfmpegSummaryColor="\${GREEN}"; fi
@ -149,6 +150,8 @@ echo -e " \${BLACK}+--------------------------------------------------------
echo -e " |\${GREEN}server: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}" echo -e " |\${GREEN}server: ./objs/srs -c conf/srs.conf, start the srs server\${BLACK}"
echo -e " | ${SrsHlsSummaryColor}hls @see: https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS\${BLACK}" echo -e " | ${SrsHlsSummaryColor}hls @see: https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS\${BLACK}"
echo -e " | ${SrsHlsSummaryColor}hls: generate m3u8 and ts from rtmp stream\${BLACK}" echo -e " | ${SrsHlsSummaryColor}hls: generate m3u8 and ts from rtmp stream\${BLACK}"
echo -e " | ${SrsDvrSummaryColor}dvr @see: https://github.com/winlinvip/simple-rtmp-server/wiki/DVR\${BLACK}"
echo -e " | ${SrsDvrSummaryColor}dvr: record RTMP stream to flv files.\${BLACK}"
echo -e " | ${SrsNginxSummaryColor}nginx @see: https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS\${BLACK}" echo -e " | ${SrsNginxSummaryColor}nginx @see: https://github.com/winlinvip/simple-rtmp-server/wiki/DeliveryHLS\${BLACK}"
echo -e " | ${SrsNginxSummaryColor}nginx: delivery HLS stream by nginx\${BLACK}" echo -e " | ${SrsNginxSummaryColor}nginx: delivery HLS stream by nginx\${BLACK}"
echo -e " | ${SrsSslSummaryColor}ssl @see: https://github.com/winlinvip/simple-rtmp-server/wiki/RTMPHandshake\${BLACK}" echo -e " | ${SrsSslSummaryColor}ssl @see: https://github.com/winlinvip/simple-rtmp-server/wiki/RTMPHandshake\${BLACK}"
@ -436,7 +439,7 @@ MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_socke
"srs_app_http" "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_http" "srs_app_thread" "srs_app_bandwidth" "srs_app_st" "srs_app_log"
"srs_app_config" "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api" "srs_app_config" "srs_app_pithy_print" "srs_app_reload" "srs_app_http_api"
"srs_app_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest" "srs_app_http_conn" "srs_app_http_hooks" "srs_app_json" "srs_app_ingest"
"srs_app_ffmpeg" "srs_app_utility") "srs_app_ffmpeg" "srs_app_utility" "srs_app_flv")
APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh APP_INCS="src/app"; MODULE_DIR=${APP_INCS} . auto/modules.sh
APP_OBJS="${MODULE_OBJS[@]}" APP_OBJS="${MODULE_OBJS[@]}"
# #
@ -504,7 +507,7 @@ mkdir -p ${SRS_OBJS}/logs
# summary # summary
echo "" echo ""
echo "configure summary:" echo "configure summary:"
echo " ${SRS_CONFIGURE}" echo " ${SRS_AUTO_CONFIGURE}"
if [ $SRS_HLS = YES ]; then if [ $SRS_HLS = YES ]; then
echo -e "${GREEN}HLS is enabled${BLACK}" echo -e "${GREEN}HLS is enabled${BLACK}"
else else
@ -515,6 +518,11 @@ if [ $SRS_NGINX = YES ]; then
else else
echo -e "${GREEN}note: Nginx http server is disabled${BLACK}" echo -e "${GREEN}note: Nginx http server is disabled${BLACK}"
fi fi
if [ $SRS_DVR = YES ]; then
echo -e "${GREEN}DVR is enabled${BLACK}"
else
echo -e "${YELLOW}warning: without DVR support${BLACK}"
fi
if [ $SRS_SSL = YES ]; then if [ $SRS_SSL = YES ]; then
echo -e "${GREEN}rtmp complex handshake is enabled${BLACK}" echo -e "${GREEN}rtmp complex handshake is enabled${BLACK}"
else else

View file

@ -1206,7 +1206,7 @@ void SrsConfig::print_help(char** argv)
printf( printf(
RTMP_SIG_SRS_NAME" "RTMP_SIG_SRS_VERSION" "RTMP_SIG_SRS_COPYRIGHT"\n" RTMP_SIG_SRS_NAME" "RTMP_SIG_SRS_VERSION" "RTMP_SIG_SRS_COPYRIGHT"\n"
"Primary Authors: "RTMP_SIG_SRS_PRIMARY_AUTHROS"\n" "Primary Authors: "RTMP_SIG_SRS_PRIMARY_AUTHROS"\n"
"Build: "SRS_BUILD_DATE" Configuration:"SRS_CONFIGURE"\n" "Build: "SRS_AUTO_BUILD_DATE" Configuration:"SRS_AUTO_CONFIGURE"\n"
"Usage: %s [-h?vV] [[-t] -c <filename>]\n" "Usage: %s [-h?vV] [[-t] -c <filename>]\n"
"\n" "\n"
"Options:\n" "Options:\n"
@ -2132,13 +2132,13 @@ string SrsConfig::get_ingest_input_type(SrsConfDirective* ingest)
SrsConfDirective* conf = ingest->get("input"); SrsConfDirective* conf = ingest->get("input");
if (!conf) { if (!conf) {
return SRS_RTMP_INGEST_TYPE_FILE; return SRS_AUTO_INGEST_TYPE_FILE;
} }
conf = conf->get("type"); conf = conf->get("type");
if (!conf) { if (!conf) {
return SRS_RTMP_INGEST_TYPE_FILE; return SRS_AUTO_INGEST_TYPE_FILE;
} }
return conf->arg0(); return conf->arg0();

View file

@ -70,8 +70,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_STAGE_INGESTER_INTERVAL_MS 2000 #define SRS_STAGE_INGESTER_INTERVAL_MS 2000
#define SRS_STAGE_HLS_INTERVAL_MS 2000 #define SRS_STAGE_HLS_INTERVAL_MS 2000
#define SRS_RTMP_INGEST_TYPE_FILE "file" #define SRS_AUTO_INGEST_TYPE_FILE "file"
#define SRS_RTMP_INGEST_TYPE_STREAM "stream" #define SRS_AUTO_INGEST_TYPE_STREAM "stream"
class SrsFileBuffer; class SrsFileBuffer;

View file

@ -34,7 +34,7 @@ using namespace std;
#include <srs_protocol_rtmp_stack.hpp> #include <srs_protocol_rtmp_stack.hpp>
#include <srs_app_ffmpeg.hpp> #include <srs_app_ffmpeg.hpp>
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
// when error, encoder sleep for a while and retry. // when error, encoder sleep for a while and retry.
#define SRS_RTMP_ENCODER_SLEEP_US (int64_t)(3*1000*1000LL) #define SRS_RTMP_ENCODER_SLEEP_US (int64_t)(3*1000*1000LL)

View file

@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
#include <string> #include <string>
#include <vector> #include <vector>

View file

@ -39,7 +39,7 @@ using namespace std;
#include <srs_app_pithy_print.hpp> #include <srs_app_pithy_print.hpp>
#include <srs_protocol_rtmp_stack.hpp> #include <srs_protocol_rtmp_stack.hpp>
#ifdef SRS_FFMPEG_STUB #ifdef SRS_AUTO_FFMPEG
#define SRS_RTMP_ENCODER_COPY "copy" #define SRS_RTMP_ENCODER_COPY "copy"
#define SRS_RTMP_ENCODER_NO_VIDEO "vn" #define SRS_RTMP_ENCODER_NO_VIDEO "vn"

View file

@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_FFMPEG_STUB #ifdef SRS_AUTO_FFMPEG
#include <string> #include <string>
#include <vector> #include <vector>

View file

@ -0,0 +1,29 @@
/*
The MIT License (MIT)
Copyright (c) 2013-2014 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <srs_app_flv.hpp>
#ifdef SRS_AUTO_DVR
#endif

View file

@ -0,0 +1,36 @@
/*
The MIT License (MIT)
Copyright (c) 2013-2014 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SRS_APP_FLV_HPP
#define SRS_APP_FLV_HPP
/*
#include <srs_app_flv.hpp>
*/
#include <srs_core.hpp>
#ifdef SRS_AUTO_DVR
#endif
#endif

View file

@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_hls.hpp> #include <srs_app_hls.hpp>
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -45,14 +45,14 @@ using namespace std;
#include <srs_app_pithy_print.hpp> #include <srs_app_pithy_print.hpp>
// max PES packets size to flush the video. // max PES packets size to flush the video.
#define SRS_HLS_AUDIO_CACHE_SIZE 1024 * 1024 #define SRS_AUTO_HLS_AUDIO_CACHE_SIZE 1024 * 1024
// drop the segment when duration of ts too small. // drop the segment when duration of ts too small.
#define SRS_HLS_SEGMENT_MIN_DURATION_MS 100 #define SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS 100
// @see: NGX_RTMP_HLS_DELAY, // @see: NGX_RTMP_HLS_DELAY,
// 63000: 700ms, ts_tbn=90000 // 63000: 700ms, ts_tbn=90000
#define SRS_HLS_DELAY 63000 #define SRS_AUTO_HLS_DELAY 63000
// the mpegts header specifed the video/audio pid. // the mpegts header specifed the video/audio pid.
#define TS_VIDEO_PID 256 #define TS_VIDEO_PID 256
@ -199,7 +199,7 @@ public:
p[-1] |= 0x20; // Both Adaption and Payload p[-1] |= 0x20; // Both Adaption and Payload
*p++ = 7; // size *p++ = 7; // size
*p++ = 0x50; // random access + PCR *p++ = 0x50; // random access + PCR
p = write_pcr(p, frame->dts - SRS_HLS_DELAY); p = write_pcr(p, frame->dts - SRS_AUTO_HLS_DELAY);
} }
// PES header // PES header
@ -255,11 +255,11 @@ public:
*p++ = header_size; *p++ = header_size;
// pts; // 33bits // pts; // 33bits
p = write_pts(p, flags >> 6, frame->pts + SRS_HLS_DELAY); p = write_pts(p, flags >> 6, frame->pts + SRS_AUTO_HLS_DELAY);
// dts; // 33bits // dts; // 33bits
if (frame->dts != frame->pts) { if (frame->dts != frame->pts) {
p = write_pts(p, 1, frame->dts + SRS_HLS_DELAY); p = write_pts(p, 1, frame->dts + SRS_AUTO_HLS_DELAY);
} }
} }
@ -684,7 +684,7 @@ int SrsHlsMuxer::segment_close(string log_desc)
srs_assert(it == segments.end()); srs_assert(it == segments.end());
// valid, add to segments if segment duration is ok // valid, add to segments if segment duration is ok
if (current->duration * 1000 >= SRS_HLS_SEGMENT_MIN_DURATION_MS) { if (current->duration * 1000 >= SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS) {
segments.push_back(current); segments.push_back(current);
srs_trace("%s reap ts segment, sequence_no=%d, uri=%s, duration=%.2f, start=%"PRId64"", srs_trace("%s reap ts segment, sequence_no=%d, uri=%s, duration=%.2f, start=%"PRId64"",
@ -1026,7 +1026,7 @@ int SrsHlsCache::write_audio(SrsCodec* codec, SrsHlsMuxer* muxer, int64_t pts, S
} }
// flush if buffer exceed max size. // flush if buffer exceed max size.
if (ab->size > SRS_HLS_AUDIO_CACHE_SIZE) { if (ab->size > SRS_AUTO_HLS_AUDIO_CACHE_SIZE) {
if ((ret = muxer->flush_audio(af, ab)) != ERROR_SUCCESS) { if ((ret = muxer->flush_audio(af, ab)) != ERROR_SUCCESS) {
return ret; return ret;
} }

View file

@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
#include <string> #include <string>
#include <vector> #include <vector>

View file

@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http.hpp> #include <srs_app_http.hpp>
#ifdef SRS_HTTP_PARSER #ifdef SRS_AUTO_HTTP_PARSER
#include <stdlib.h> #include <stdlib.h>

View file

@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_HTTP_PARSER #ifdef SRS_AUTO_HTTP_PARSER
#include <string> #include <string>
#include <vector> #include <vector>

View file

@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http_api.hpp> #include <srs_app_http_api.hpp>
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
#include <sstream> #include <sstream>
using namespace std; using namespace std;
@ -193,7 +193,7 @@ int SrsApiAuthors::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
<< JFIELD_ORG("data", JOBJECT_START) << JFIELD_ORG("data", JOBJECT_START)
<< JFIELD_STR("primary_authors", RTMP_SIG_SRS_PRIMARY_AUTHROS) << JFIELD_CONT << JFIELD_STR("primary_authors", RTMP_SIG_SRS_PRIMARY_AUTHROS) << JFIELD_CONT
<< JFIELD_STR("contributors_link", RTMP_SIG_SRS_CONTRIBUTORS_URL) << JFIELD_CONT << JFIELD_STR("contributors_link", RTMP_SIG_SRS_CONTRIBUTORS_URL) << JFIELD_CONT
<< JFIELD_STR("contributors", SRS_CONSTRIBUTORS) << JFIELD_STR("contributors", SRS_AUTO_CONSTRIBUTORS)
<< JOBJECT_END << JOBJECT_END
<< JOBJECT_END; << JOBJECT_END;

View file

@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
class SrsSocket; class SrsSocket;
class SrsHttpMessage; class SrsHttpMessage;

View file

@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http_conn.hpp> #include <srs_app_http_conn.hpp>
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
#include <sstream> #include <sstream>
using namespace std; using namespace std;

View file

@ -30,7 +30,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
#include <srs_app_st.hpp> #include <srs_app_st.hpp>
#include <srs_app_conn.hpp> #include <srs_app_conn.hpp>

View file

@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http_hooks.hpp> #include <srs_app_http_hooks.hpp>
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
#include <sstream> #include <sstream>
using namespace std; using namespace std;

View file

@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
#include <http_parser.h> #include <http_parser.h>

View file

@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_ingest.hpp> #include <srs_app_ingest.hpp>
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
using namespace std; using namespace std;
@ -35,7 +35,7 @@ using namespace std;
// when error, ingester sleep for a while and retry. // when error, ingester sleep for a while and retry.
// ingest never sleep a long time, for we must start the stream ASAP. // ingest never sleep a long time, for we must start the stream ASAP.
#define SRS_RTMP_INGESTER_SLEEP_US (int64_t)(6*100*1000LL) #define SRS_AUTO_INGESTER_SLEEP_US (int64_t)(6*100*1000LL)
SrsIngesterFFMPEG::SrsIngesterFFMPEG(SrsFFMPEG* _ffmpeg, string _vhost, string _id) SrsIngesterFFMPEG::SrsIngesterFFMPEG(SrsFFMPEG* _ffmpeg, string _vhost, string _id)
{ {
@ -53,7 +53,7 @@ SrsIngester::SrsIngester()
{ {
_srs_config->subscribe(this); _srs_config->subscribe(this);
pthread = new SrsThread(this, SRS_RTMP_INGESTER_SLEEP_US); pthread = new SrsThread(this, SRS_AUTO_INGESTER_SLEEP_US);
pithy_print = new SrsPithyPrint(SRS_STAGE_INGESTER); pithy_print = new SrsPithyPrint(SRS_STAGE_INGESTER);
} }
@ -187,7 +187,7 @@ int SrsIngester::cycle()
// pithy print // pithy print
ingester(); ingester();
pithy_print->elapse(SRS_RTMP_INGESTER_SLEEP_US / 1000); pithy_print->elapse(SRS_AUTO_INGESTER_SLEEP_US / 1000);
return ret; return ret;
} }
@ -282,7 +282,7 @@ int SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective* vhost, S
return ret; return ret;
} }
if (input_type == SRS_RTMP_INGEST_TYPE_FILE) { if (input_type == SRS_AUTO_INGEST_TYPE_FILE) {
std::string input_url = _srs_config->get_ingest_input_url(ingest); std::string input_url = _srs_config->get_ingest_input_url(ingest);
if (input_url.empty()) { if (input_url.empty()) {
ret = ERROR_ENCODER_NO_INPUT; ret = ERROR_ENCODER_NO_INPUT;
@ -296,7 +296,7 @@ int SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective* vhost, S
if ((ret = ffmpeg->initialize(input_url, output, log_file)) != ERROR_SUCCESS) { if ((ret = ffmpeg->initialize(input_url, output, log_file)) != ERROR_SUCCESS) {
return ret; return ret;
} }
} else if (input_type == SRS_RTMP_INGEST_TYPE_STREAM) { } else if (input_type == SRS_AUTO_INGEST_TYPE_STREAM) {
std::string input_url = _srs_config->get_ingest_input_url(ingest); std::string input_url = _srs_config->get_ingest_input_url(ingest);
if (input_url.empty()) { if (input_url.empty()) {
ret = ERROR_ENCODER_NO_INPUT; ret = ERROR_ENCODER_NO_INPUT;

View file

@ -29,7 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <srs_core.hpp> #include <srs_core.hpp>
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
#include <vector> #include <vector>

View file

@ -68,7 +68,7 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* srs_server, st_netfd_t client_stfd)
skt = new SrsSocket(client_stfd); skt = new SrsSocket(client_stfd);
rtmp = new SrsRtmpServer(skt); rtmp = new SrsRtmpServer(skt);
refer = new SrsRefer(); refer = new SrsRefer();
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
http_hooks = new SrsHttpHooks(); http_hooks = new SrsHttpHooks();
#endif #endif
bandwidth = new SrsBandwidth(); bandwidth = new SrsBandwidth();
@ -86,7 +86,7 @@ SrsRtmpConn::~SrsRtmpConn()
srs_freep(rtmp); srs_freep(rtmp);
srs_freep(skt); srs_freep(skt);
srs_freep(refer); srs_freep(refer);
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
srs_freep(http_hooks); srs_freep(http_hooks);
#endif #endif
srs_freep(bandwidth); srs_freep(bandwidth);
@ -727,7 +727,7 @@ int SrsRtmpConn::on_connect()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
// HTTP: on_connect // HTTP: on_connect
SrsConfDirective* on_connect = _srs_config->get_vhost_on_connect(req->vhost); SrsConfDirective* on_connect = _srs_config->get_vhost_on_connect(req->vhost);
if (!on_connect) { if (!on_connect) {
@ -749,7 +749,7 @@ int SrsRtmpConn::on_connect()
void SrsRtmpConn::on_close() void SrsRtmpConn::on_close()
{ {
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
// whatever the ret code, notify the api hooks. // whatever the ret code, notify the api hooks.
// HTTP: on_close // HTTP: on_close
SrsConfDirective* on_close = _srs_config->get_vhost_on_close(req->vhost); SrsConfDirective* on_close = _srs_config->get_vhost_on_close(req->vhost);
@ -769,7 +769,7 @@ int SrsRtmpConn::on_publish()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
// HTTP: on_publish // HTTP: on_publish
SrsConfDirective* on_publish = _srs_config->get_vhost_on_publish(req->vhost); SrsConfDirective* on_publish = _srs_config->get_vhost_on_publish(req->vhost);
if (!on_publish) { if (!on_publish) {
@ -791,7 +791,7 @@ int SrsRtmpConn::on_publish()
void SrsRtmpConn::on_unpublish() void SrsRtmpConn::on_unpublish()
{ {
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
// whatever the ret code, notify the api hooks. // whatever the ret code, notify the api hooks.
// HTTP: on_unpublish // HTTP: on_unpublish
SrsConfDirective* on_unpublish = _srs_config->get_vhost_on_unpublish(req->vhost); SrsConfDirective* on_unpublish = _srs_config->get_vhost_on_unpublish(req->vhost);
@ -811,7 +811,7 @@ int SrsRtmpConn::on_play()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
// HTTP: on_play // HTTP: on_play
SrsConfDirective* on_play = _srs_config->get_vhost_on_play(req->vhost); SrsConfDirective* on_play = _srs_config->get_vhost_on_play(req->vhost);
if (!on_play) { if (!on_play) {
@ -833,7 +833,7 @@ int SrsRtmpConn::on_play()
void SrsRtmpConn::on_stop() void SrsRtmpConn::on_stop()
{ {
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
// whatever the ret code, notify the api hooks. // whatever the ret code, notify the api hooks.
// HTTP: on_stop // HTTP: on_stop
SrsConfDirective* on_stop = _srs_config->get_vhost_on_stop(req->vhost); SrsConfDirective* on_stop = _srs_config->get_vhost_on_stop(req->vhost);

View file

@ -42,7 +42,7 @@ class SrsRefer;
class SrsConsumer; class SrsConsumer;
class SrsCommonMessage; class SrsCommonMessage;
class SrsSocket; class SrsSocket;
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
class SrsHttpHooks; class SrsHttpHooks;
#endif #endif
class SrsBandwidth; class SrsBandwidth;
@ -58,7 +58,7 @@ private:
SrsSocket* skt; SrsSocket* skt;
SrsRtmpServer* rtmp; SrsRtmpServer* rtmp;
SrsRefer* refer; SrsRefer* refer;
#ifdef SRS_HTTP_CALLBACK #ifdef SRS_AUTO_HTTP_CALLBACK
SrsHttpHooks* http_hooks; SrsHttpHooks* http_hooks;
#endif #endif
SrsBandwidth* bandwidth; SrsBandwidth* bandwidth;

View file

@ -41,7 +41,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_http_api.hpp> #include <srs_app_http_api.hpp>
#include <srs_app_http_conn.hpp> #include <srs_app_http_conn.hpp>
#include <srs_app_http.hpp> #include <srs_app_http.hpp>
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
#include <srs_app_ingest.hpp> #include <srs_app_ingest.hpp>
#endif #endif
@ -169,13 +169,13 @@ SrsServer::SrsServer()
// donot new object in constructor, // donot new object in constructor,
// for some global instance is not ready now, // for some global instance is not ready now,
// new these objects in initialize instead. // new these objects in initialize instead.
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
http_api_handler = NULL; http_api_handler = NULL;
#endif #endif
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
http_stream_handler = NULL; http_stream_handler = NULL;
#endif #endif
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
ingester = NULL; ingester = NULL;
#endif #endif
} }
@ -202,14 +202,14 @@ SrsServer::~SrsServer()
pid_fd = -1; pid_fd = -1;
} }
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
srs_freep(http_api_handler); srs_freep(http_api_handler);
#endif #endif
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
srs_freep(http_stream_handler); srs_freep(http_stream_handler);
#endif #endif
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
srs_freep(ingester); srs_freep(ingester);
#endif #endif
} }
@ -224,26 +224,26 @@ int SrsServer::initialize()
srs_assert(_srs_config); srs_assert(_srs_config);
_srs_config->subscribe(this); _srs_config->subscribe(this);
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
srs_assert(!http_api_handler); srs_assert(!http_api_handler);
http_api_handler = SrsHttpHandler::create_http_api(); http_api_handler = SrsHttpHandler::create_http_api();
#endif #endif
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
srs_assert(!http_stream_handler); srs_assert(!http_stream_handler);
http_stream_handler = SrsHttpHandler::create_http_stream(); http_stream_handler = SrsHttpHandler::create_http_stream();
#endif #endif
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
srs_assert(!ingester); srs_assert(!ingester);
ingester = new SrsIngester(); ingester = new SrsIngester();
#endif #endif
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
if ((ret = http_api_handler->initialize()) != ERROR_SUCCESS) { if ((ret = http_api_handler->initialize()) != ERROR_SUCCESS) {
return ret; return ret;
} }
#endif #endif
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
if ((ret = http_stream_handler->initialize()) != ERROR_SUCCESS) { if ((ret = http_stream_handler->initialize()) != ERROR_SUCCESS) {
return ret; return ret;
} }
@ -377,7 +377,7 @@ int SrsServer::ingest()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
if ((ret = ingester->start()) != ERROR_SUCCESS) { if ((ret = ingester->start()) != ERROR_SUCCESS) {
srs_error("start ingest streams failed. ret=%d", ret); srs_error("start ingest streams failed. ret=%d", ret);
return ret; return ret;
@ -401,7 +401,7 @@ int SrsServer::cycle()
// if user interrupt the program, exit to check mem leak. // if user interrupt the program, exit to check mem leak.
// but, if gperf, use reload to ensure main return normally, // but, if gperf, use reload to ensure main return normally,
// because directly exit will cause core-dump. // because directly exit will cause core-dump.
#ifdef SRS_GPERF_MC #ifdef SRS_AUTO_GPERF_MC
if (signal_gmc_stop) { if (signal_gmc_stop) {
break; break;
} }
@ -419,7 +419,7 @@ int SrsServer::cycle()
} }
} }
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
ingester->stop(); ingester->stop();
#endif #endif
@ -449,7 +449,7 @@ void SrsServer::on_signal(int signo)
} }
if (signo == SIGINT) { if (signo == SIGINT) {
#ifdef SRS_GPERF_MC #ifdef SRS_AUTO_GPERF_MC
srs_trace("gmc is on, main cycle will terminate normally."); srs_trace("gmc is on, main cycle will terminate normally.");
signal_gmc_stop = true; signal_gmc_stop = true;
#else #else
@ -494,7 +494,7 @@ int SrsServer::listen_http_api()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
close_listeners(SrsListenerHttpApi); close_listeners(SrsListenerHttpApi);
if (_srs_config->get_http_api_enabled()) { if (_srs_config->get_http_api_enabled()) {
SrsListener* listener = new SrsListener(this, SrsListenerHttpApi); SrsListener* listener = new SrsListener(this, SrsListenerHttpApi);
@ -515,7 +515,7 @@ int SrsServer::listen_http_stream()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
close_listeners(SrsListenerHttpStream); close_listeners(SrsListenerHttpStream);
if (_srs_config->get_http_stream_enabled()) { if (_srs_config->get_http_stream_enabled()) {
SrsListener* listener = new SrsListener(this, SrsListenerHttpStream); SrsListener* listener = new SrsListener(this, SrsListenerHttpStream);
@ -568,7 +568,7 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
if (type == SrsListenerRtmpStream) { if (type == SrsListenerRtmpStream) {
conn = new SrsRtmpConn(this, client_stfd); conn = new SrsRtmpConn(this, client_stfd);
} else if (type == SrsListenerHttpApi) { } else if (type == SrsListenerHttpApi) {
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
conn = new SrsHttpApi(this, client_stfd, http_api_handler); conn = new SrsHttpApi(this, client_stfd, http_api_handler);
#else #else
srs_warn("close http client for server not support http-api"); srs_warn("close http client for server not support http-api");
@ -576,7 +576,7 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
return ret; return ret;
#endif #endif
} else if (type == SrsListenerHttpStream) { } else if (type == SrsListenerHttpStream) {
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
conn = new SrsHttpConn(this, client_stfd, http_stream_handler); conn = new SrsHttpConn(this, client_stfd, http_stream_handler);
#else #else
srs_warn("close http client for server not support http-server"); srs_warn("close http client for server not support http-server");
@ -622,7 +622,7 @@ int SrsServer::on_reload_vhost_added(std::string vhost)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
if (!_srs_config->get_vhost_http_enabled(vhost)) { if (!_srs_config->get_vhost_http_enabled(vhost)) {
return ret; return ret;
} }
@ -639,7 +639,7 @@ int SrsServer::on_reload_vhost_removed(std::string vhost)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) { if ((ret = on_reload_vhost_http_updated()) != ERROR_SUCCESS) {
return ret; return ret;
} }
@ -652,7 +652,7 @@ int SrsServer::on_reload_vhost_http_updated()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
srs_freep(http_stream_handler); srs_freep(http_stream_handler);
http_stream_handler = SrsHttpHandler::create_http_stream(); http_stream_handler = SrsHttpHandler::create_http_stream();
@ -668,7 +668,7 @@ int SrsServer::on_reload_http_api_enabled()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
ret = listen_http_api(); ret = listen_http_api();
#endif #endif
@ -679,7 +679,7 @@ int SrsServer::on_reload_http_api_disabled()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
close_listeners(SrsListenerHttpApi); close_listeners(SrsListenerHttpApi);
#endif #endif
@ -690,7 +690,7 @@ int SrsServer::on_reload_http_stream_enabled()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
ret = listen_http_stream(); ret = listen_http_stream();
#endif #endif
@ -701,7 +701,7 @@ int SrsServer::on_reload_http_stream_disabled()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
close_listeners(SrsListenerHttpStream); close_listeners(SrsListenerHttpStream);
#endif #endif
@ -712,7 +712,7 @@ int SrsServer::on_reload_http_stream_updated()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
if ((ret = on_reload_http_stream_enabled()) != ERROR_SUCCESS) { if ((ret = on_reload_http_stream_enabled()) != ERROR_SUCCESS) {
return ret; return ret;
} }

View file

@ -79,13 +79,13 @@ class SrsServer : public ISrsReloadHandler
{ {
friend class SrsListener; friend class SrsListener;
private: private:
#ifdef SRS_HTTP_API #ifdef SRS_AUTO_HTTP_API
SrsHttpHandler* http_api_handler; SrsHttpHandler* http_api_handler;
#endif #endif
#ifdef SRS_HTTP_SERVER #ifdef SRS_AUTO_HTTP_SERVER
SrsHttpHandler* http_stream_handler; SrsHttpHandler* http_stream_handler;
#endif #endif
#ifdef SRS_RTMP_INGEST #ifdef SRS_AUTO_INGEST
SrsIngester* ingester; SrsIngester* ingester;
#endif #endif
private: private:

View file

@ -428,10 +428,10 @@ SrsSource::SrsSource(SrsRequest* _req)
{ {
req = _req->copy(); req = _req->copy();
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
hls = new SrsHls(this); hls = new SrsHls(this);
#endif #endif
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
encoder = new SrsEncoder(); encoder = new SrsEncoder();
#endif #endif
@ -474,10 +474,10 @@ SrsSource::~SrsSource()
srs_freep(gop_cache); srs_freep(gop_cache);
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
srs_freep(hls); srs_freep(hls);
#endif #endif
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
srs_freep(encoder); srs_freep(encoder);
#endif #endif
@ -585,7 +585,7 @@ int SrsSource::on_reload_vhost_hls(string vhost)
return ret; return ret;
} }
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
hls->on_unpublish(); hls->on_unpublish();
if ((ret = hls->on_publish(req)) != ERROR_SUCCESS) { if ((ret = hls->on_publish(req)) != ERROR_SUCCESS) {
srs_error("hls publish failed. ret=%d", ret); srs_error("hls publish failed. ret=%d", ret);
@ -605,7 +605,7 @@ int SrsSource::on_reload_vhost_transcode(string vhost)
return ret; return ret;
} }
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
encoder->on_unpublish(); encoder->on_unpublish();
if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) { if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) {
srs_error("start encoder failed. ret=%d", ret); srs_error("start encoder failed. ret=%d", ret);
@ -643,7 +643,7 @@ int SrsSource::on_hls_start()
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
// feed the hls the metadata/sequence header, // feed the hls the metadata/sequence header,
// when reload to enable the hls. // when reload to enable the hls.
@ -671,7 +671,7 @@ int SrsSource::on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
if (metadata && (ret = hls->on_meta_data(metadata->metadata)) != ERROR_SUCCESS) { if (metadata && (ret = hls->on_meta_data(metadata->metadata)) != ERROR_SUCCESS) {
srs_error("hls process onMetaData message failed. ret=%d", ret); srs_error("hls process onMetaData message failed. ret=%d", ret);
return ret; return ret;
@ -760,7 +760,7 @@ int SrsSource::on_audio(SrsCommonMessage* audio)
} }
srs_verbose("initialize shared ptr audio success."); srs_verbose("initialize shared ptr audio success.");
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
if ((ret = hls->on_audio(msg->copy())) != ERROR_SUCCESS) { if ((ret = hls->on_audio(msg->copy())) != ERROR_SUCCESS) {
srs_warn("hls process audio message failed, ignore and disable hls. ret=%d", ret); srs_warn("hls process audio message failed, ignore and disable hls. ret=%d", ret);
@ -837,7 +837,7 @@ int SrsSource::on_video(SrsCommonMessage* video)
} }
srs_verbose("initialize shared ptr video success."); srs_verbose("initialize shared ptr video success.");
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
if ((ret = hls->on_video(msg->copy())) != ERROR_SUCCESS) { if ((ret = hls->on_video(msg->copy())) != ERROR_SUCCESS) {
srs_warn("hls process video message failed, ignore and disable hls. ret=%d", ret); srs_warn("hls process video message failed, ignore and disable hls. ret=%d", ret);
@ -919,14 +919,14 @@ int SrsSource::on_publish(SrsRequest* _req)
return ret; return ret;
} }
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) { if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) {
srs_error("start encoder failed. ret=%d", ret); srs_error("start encoder failed. ret=%d", ret);
return ret; return ret;
} }
#endif #endif
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
if ((ret = hls->on_publish(req)) != ERROR_SUCCESS) { if ((ret = hls->on_publish(req)) != ERROR_SUCCESS) {
srs_error("start hls failed. ret=%d", ret); srs_error("start hls failed. ret=%d", ret);
return ret; return ret;
@ -941,12 +941,12 @@ void SrsSource::on_unpublish()
// destroy all forwarders // destroy all forwarders
destroy_forwarders(); destroy_forwarders();
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
encoder->on_unpublish(); encoder->on_unpublish();
#endif #endif
// TODO: HLS should continue previous sequence and stream. // TODO: HLS should continue previous sequence and stream.
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
hls->on_unpublish(); hls->on_unpublish();
#endif #endif

View file

@ -43,10 +43,10 @@ class SrsOnMetaDataPacket;
class SrsSharedPtrMessage; class SrsSharedPtrMessage;
class SrsForwarder; class SrsForwarder;
class SrsRequest; class SrsRequest;
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
class SrsHls; class SrsHls;
#endif #endif
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
class SrsEncoder; class SrsEncoder;
#endif #endif
@ -220,11 +220,11 @@ private:
// to delivery stream to clients. // to delivery stream to clients.
std::vector<SrsConsumer*> consumers; std::vector<SrsConsumer*> consumers;
// hls handler. // hls handler.
#ifdef SRS_HLS #ifdef SRS_AUTO_HLS
SrsHls* hls; SrsHls* hls;
#endif #endif
// transcoding handler. // transcoding handler.
#ifdef SRS_RTMP_TRANSCODE #ifdef SRS_AUTO_TRANSCODE
SrsEncoder* encoder; SrsEncoder* encoder;
#endif #endif
// gop cache for client fast startup. // gop cache for client fast startup.

View file

@ -181,7 +181,7 @@ int srs_simple_handshake(srs_rtmp_t rtmp)
int srs_complex_handshake(srs_rtmp_t rtmp) int srs_complex_handshake(srs_rtmp_t rtmp)
{ {
#ifndef SRS_SSL #ifndef SRS_AUTO_SSL
return ERROR_RTMP_HS_SSL_REQUIRE; return ERROR_RTMP_HS_SSL_REQUIRE;
#endif #endif
@ -378,7 +378,7 @@ int srs_write_packet(srs_rtmp_t rtmp, int type, u_int32_t timestamp, char* data,
int srs_ssl_enabled() int srs_ssl_enabled()
{ {
#ifndef SRS_SSL #ifndef SRS_AUTO_SSL
return false; return false;
#endif #endif
return true; return true;

View file

@ -29,10 +29,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#ifdef SRS_GPERF_MP #ifdef SRS_AUTO_GPERF_MP
#include <gperftools/heap-profiler.h> #include <gperftools/heap-profiler.h>
#endif #endif
#ifdef SRS_GPERF_CP #ifdef SRS_AUTO_GPERF_CP
#include <gperftools/profiler.h> #include <gperftools/profiler.h>
#endif #endif
@ -71,15 +71,15 @@ int main(int argc, char** argv)
// TODO: support both little and big endian. // TODO: support both little and big endian.
srs_assert(srs_is_little_endian()); srs_assert(srs_is_little_endian());
#ifdef SRS_GPERF_MP #ifdef SRS_AUTO_GPERF_MP
HeapProfilerStart("gperf.srs.gmp"); HeapProfilerStart("gperf.srs.gmp");
#endif #endif
#ifdef SRS_GPERF_CP #ifdef SRS_AUTO_GPERF_CP
ProfilerStart("gperf.srs.gcp"); ProfilerStart("gperf.srs.gcp");
#endif #endif
#ifdef SRS_GPERF_MC #ifdef SRS_AUTO_GPERF_MC
#ifdef SRS_GPERF_MP #ifdef SRS_AUTO_GPERF_MP
srs_error("option --with-gmc confict with --with-gmp, " srs_error("option --with-gmc confict with --with-gmp, "
"@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\n" "@see: http://google-perftools.googlecode.com/svn/trunk/doc/heap_checker.html\n"
"Note that since the heap-checker uses the heap-profiling framework internally, " "Note that since the heap-checker uses the heap-profiling framework internally, "
@ -100,11 +100,11 @@ int main(int argc, char** argv)
} }
srs_trace("srs(simple-rtmp-server) "RTMP_SIG_SRS_VERSION); srs_trace("srs(simple-rtmp-server) "RTMP_SIG_SRS_VERSION);
srs_trace("uname: "SRS_UNAME); srs_trace("uname: "SRS_AUTO_UNAME);
srs_trace("build: %s, %s", SRS_BUILD_DATE, srs_is_little_endian()? "little-endian":"big-endian"); srs_trace("build: %s, %s", SRS_AUTO_BUILD_DATE, srs_is_little_endian()? "little-endian":"big-endian");
srs_trace("configure: "SRS_CONFIGURE); srs_trace("configure: "SRS_AUTO_CONFIGURE);
#ifdef SRS_ARM_UBUNTU12 #ifdef SRS_AUTO_ARM_UBUNTU12
srs_trace("arm tool chain: "SRS_ARM_TOOL_CHAIN); srs_trace("arm tool chain: "SRS_AUTO_ARM_TOOL_CHAIN);
#endif #endif
if ((ret = _srs_server->initialize()) != ERROR_SUCCESS) { if ((ret = _srs_server->initialize()) != ERROR_SUCCESS) {

View file

@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_protocol_utility.hpp> #include <srs_protocol_utility.hpp>
#include <srs_protocol_rtmp.hpp> #include <srs_protocol_rtmp.hpp>
#ifdef SRS_SSL #ifdef SRS_AUTO_SSL
using namespace srs; using namespace srs;
@ -1070,7 +1070,7 @@ SrsComplexHandshake::~SrsComplexHandshake()
{ {
} }
#ifndef SRS_SSL #ifndef SRS_AUTO_SSL
int SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* /*hs_bytes*/, ISrsProtocolReaderWriter* /*io*/) int SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* /*hs_bytes*/, ISrsProtocolReaderWriter* /*io*/)
{ {
srs_trace("directly use simple handshake for ssl disabled."); srs_trace("directly use simple handshake for ssl disabled.");
@ -1169,7 +1169,7 @@ int SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrs
} }
#endif #endif
#ifndef SRS_SSL #ifndef SRS_AUTO_SSL
int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* /*hs_bytes*/, ISrsProtocolReaderWriter* /*io*/) int SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* /*hs_bytes*/, ISrsProtocolReaderWriter* /*io*/)
{ {
return ERROR_RTMP_TRY_SIMPLE_HS; return ERROR_RTMP_TRY_SIMPLE_HS;

View file

@ -34,7 +34,7 @@ class ISrsProtocolReaderWriter;
class SrsComplexHandshake; class SrsComplexHandshake;
class SrsHandshakeBytes; class SrsHandshakeBytes;
#ifdef SRS_SSL #ifdef SRS_AUTO_SSL
namespace srs namespace srs
{ {

View file

@ -51,6 +51,8 @@ file
..\app\srs_app_encoder.cpp, ..\app\srs_app_encoder.cpp,
..\app\srs_app_ffmpeg.hpp, ..\app\srs_app_ffmpeg.hpp,
..\app\srs_app_ffmpeg.cpp, ..\app\srs_app_ffmpeg.cpp,
..\app\srs_app_flv.hpp,
..\app\srs_app_flv.cpp,
..\app\srs_app_forward.hpp, ..\app\srs_app_forward.hpp,
..\app\srs_app_forward.cpp, ..\app\srs_app_forward.cpp,
..\app\srs_app_hls.hpp, ..\app\srs_app_hls.hpp,