diff --git a/README.md b/README.md index 4b178a802..769060cee 100755 --- a/README.md +++ b/README.md @@ -188,6 +188,7 @@ For external services to work with SRS: ## V4 changes +* v4.0, 2021-06-01, Support --shared-ffmpeg to link with *.so for LGPL license. 4.0.126 * v4.0, 2021-06-01, Support --shared-srt to link with *.so for MPL license. 4.0.125 * v4.0, 2021-05-31, Use [SPDX-License-Identifier: MIT](https://spdx.dev/ids/). 4.0.124 * v4.0, 2021-05-28, Fix bugs for GB28181 and RTC. 4.0.123 diff --git a/trunk/3rdparty/README.md b/trunk/3rdparty/README.md index 4b97c9ee7..af193268d 100644 --- a/trunk/3rdparty/README.md +++ b/trunk/3rdparty/README.md @@ -1,84 +1,73 @@ http-parser-2.1.zip * for srs to support http callback. +* https://github.com/joyent/http-parser +* https://github.com/ossrs/srs/wiki/LicenseMixing#http-parser nginx-1.5.7.zip +* http://nginx.org/ * for srs to support hls streaming. srt-1-fit srt-1.4.1.tar.gz * https://github.com/Haivision/srt/releases/tag/v1.4.1 +* https://github.com/ossrs/srs/wiki/LicenseMixing#srt + +openssl-1.1-fit +openssl-1.1.1b.tar.gz +* http://www.openssl.org/source/openssl-1.1.1b.tar.gz -openssl-1.1.1b.tar.gz openssl-1.1.0e.zip openssl-OpenSSL_1_0_2u.tar.gz +* http://www.openssl.org/source/openssl-1.1.0e.tar.gz * openssl for SRS(with-ssl) RTMP complex handshake to delivery h264+aac stream. * SRTP depends on openssl 1.0.*, so we use both ssl versions. +* https://github.com/ossrs/srs/wiki/LicenseMixing#openssl CherryPy-3.2.4.zip * sample api server for srs. +* https://pypi.python.org/pypi/CherryPy/3.2.4 libsrtp-2.3.0.tar.gz -* For WebRTC. +* For WebRTC, SRTP to encrypt and decrypt RTP. +* https://github.com/cisco/libsrtp/releases/tag/v2.3.0 -ffmpeg-3.2.4.tar.gz -yasm-1.2.0.tar.gz -lame-3.99.5.tar.gz -speex-1.2rc1.zip -x264-snapshot-20131129-2245-stable.tar.bz2 (core.138) -* for srs to support live stream transcoding. -* remark: we use *.zip for all linux plantform. - -fdk-aac-0.1.3.zip -* https://github.com/mstorsjo/fdk-aac/releases - -tools/ccache-3.1.9.zip -* to fast build. +ffmpeg-4.2.tar.gz +opus-1.3.1.tar.gz +* http://ffmpeg.org/releases/ffmpeg-4.2.tar.gz +* https://github.com/xiph/opus/releases/tag/v1.3.1 +* To support RTMP/WebRTC transcoding. +* https://github.com/ossrs/srs/wiki/LicenseMixing#ffmpeg gtest-1.6.0.zip * google test framework. +* https://code.google.com/p/googletest/downloads/list gperftools-2.1.zip * gperf tools for performance benchmark. +* https://code.google.com/p/gperftools/downloads/list st-srs st-1.9.zip state-threads state-threads-1.9.1.tar.gz * Patched ST from https://github.com/ossrs/state-threads +* https://github.com/ossrs/srs/wiki/LicenseMixing#state-threads + +JSON +* https://github.com/udp/json-parser +* https://github.com/ossrs/srs/wiki/LicenseMixing#json + +USRSCTP +* https://github.com/ossrs/srs/wiki/LicenseMixing#usrsctp links: -* nginx: - http://nginx.org/ -* http-parser: - https://github.com/joyent/http-parser * state-threads: https://github.com/ossrs/state-threads -* ffmpeg: - http://ffmpeg.org/ - http://ffmpeg.org/releases/ffmpeg-3.2.4.tar.gz * x264: - http://www.videolan.org/ ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20131129-2245-stable.tar.bz2 * lame: - http://sourceforge.net/projects/lame/ http://nchc.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz * yasm: - http://yasm.tortall.net/ http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz -* cherrypy: - http://www.cherrypy.org/ - https://pypi.python.org/pypi/CherryPy/3.2.4 -* openssl: - http://www.openssl.org/ - http://www.openssl.org/source/openssl-1.1.0e.tar.gz -* gtest: - https://code.google.com/p/googletest - https://code.google.com/p/googletest/downloads/list -* gperftools: - https://code.google.com/p/gperftools/ - https://code.google.com/p/gperftools/downloads/list * speex: - http://www.speex.org/downloads/ http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz -* srtp: - https://github.com/cisco/libsrtp/releases/tag/v2.3.0 diff --git a/trunk/3rdparty/ffmpeg-4-fit/libavcodec/libavcodec.v b/trunk/3rdparty/ffmpeg-4-fit/libavcodec/libavcodec.v new file mode 100644 index 000000000..f1d5e5bc7 --- /dev/null +++ b/trunk/3rdparty/ffmpeg-4-fit/libavcodec/libavcodec.v @@ -0,0 +1,6 @@ +LIBAVCODEC_MAJOR { + global: + av*; + local: + *; +}; diff --git a/trunk/3rdparty/ffmpeg-4-fit/libavcodec/log2_tab.c b/trunk/3rdparty/ffmpeg-4-fit/libavcodec/log2_tab.c new file mode 100644 index 000000000..47a1df03b --- /dev/null +++ b/trunk/3rdparty/ffmpeg-4-fit/libavcodec/log2_tab.c @@ -0,0 +1 @@ +#include "libavutil/log2_tab.c" diff --git a/trunk/3rdparty/ffmpeg-4-fit/libavcodec/reverse.c b/trunk/3rdparty/ffmpeg-4-fit/libavcodec/reverse.c new file mode 100644 index 000000000..440badaf3 --- /dev/null +++ b/trunk/3rdparty/ffmpeg-4-fit/libavcodec/reverse.c @@ -0,0 +1 @@ +#include "libavutil/reverse.c" diff --git a/trunk/3rdparty/ffmpeg-4-fit/libavutil/libavutil.v b/trunk/3rdparty/ffmpeg-4-fit/libavutil/libavutil.v new file mode 100644 index 000000000..fb17058df --- /dev/null +++ b/trunk/3rdparty/ffmpeg-4-fit/libavutil/libavutil.v @@ -0,0 +1,6 @@ +LIBAVUTIL_MAJOR { + global: + av*; + local: + *; +}; diff --git a/trunk/3rdparty/ffmpeg-4-fit/libswresample/libswresample.v b/trunk/3rdparty/ffmpeg-4-fit/libswresample/libswresample.v new file mode 100644 index 000000000..3b3508d70 --- /dev/null +++ b/trunk/3rdparty/ffmpeg-4-fit/libswresample/libswresample.v @@ -0,0 +1,7 @@ +LIBSWRESAMPLE_MAJOR { + global: + swr_*; + swresample_*; + local: + *; +}; diff --git a/trunk/3rdparty/ffmpeg-4-fit/libswresample/log2_tab.c b/trunk/3rdparty/ffmpeg-4-fit/libswresample/log2_tab.c new file mode 100644 index 000000000..47a1df03b --- /dev/null +++ b/trunk/3rdparty/ffmpeg-4-fit/libswresample/log2_tab.c @@ -0,0 +1 @@ +#include "libavutil/log2_tab.c" diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 9f7524c04..559b5fc88 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -636,6 +636,10 @@ if [ ! -f ${SRS_OBJS}/srtp2/lib/libsrtp2.a ]; then echo "Build libsrtp-2-fit sta # libopus, for WebRTC to transcode AAC with Opus. ##################################################################################### if [[ $SRS_RTC == YES ]]; then + # Only build static libraries if no shared FFmpeg. + if [[ $SRS_SHARED_FFMPEG == NO ]]; then + OPUS_OPTIONS="--disable-shared" + fi if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1/_release/lib/libopus.a ]]; then echo "The opus-1.3.1 is ok."; else @@ -643,7 +647,7 @@ if [[ $SRS_RTC == YES ]]; then ( rm -rf ${SRS_OBJS}/${SRS_PLATFORM}/opus-1.3.1 && cd ${SRS_OBJS}/${SRS_PLATFORM} && tar xf ../../3rdparty/opus-1.3.1.tar.gz && cd opus-1.3.1 && - ./configure --prefix=`pwd`/_release --enable-static --disable-shared && make ${SRS_JOBS} && make install + ./configure --prefix=`pwd`/_release --enable-static $OPUS_OPTIONS && make ${SRS_JOBS} && make install cd .. && rm -rf opus && ln -sf opus-1.3.1/_release opus ) fi @@ -669,6 +673,10 @@ if [[ $SRS_FFMPEG_FIT == YES ]]; then nasm -v >/dev/null 2>&1; ret=$?; if [[ 0 -ne $ret ]]; then FFMPEG_OPTIONS="--disable-x86asm" fi + # Only build static libraries if no shared FFmpeg. + if [[ $SRS_SHARED_FFMPEG == YES ]]; then + FFMPEG_OPTIONS="$FFMPEG_OPTIONS --enable-shared" + fi if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/ffmpeg-4-fit/_release/lib/libavcodec.a ]]; then echo "The ffmpeg-4-fit is ok."; diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index b5b5ff80a..d0e96229a 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -40,9 +40,14 @@ SRS_PREFIX=/usr/local/srs SRS_JOBS=1 SRS_STATIC=NO # If enabled, link shared libraries for libst.so which uses MPL license. +# See https://github.com/ossrs/srs/wiki/LicenseMixing#state-threads SRS_SHARED_ST=NO # If enabled, link shared libraries for libsrt.so which uses MPL license. +# See https://github.com/ossrs/srs/wiki/LicenseMixing#srt SRS_SHARED_SRT=NO +# If enabled, link shared libraries for FFmpeg which is LGPL license. +# See https://github.com/ossrs/srs/wiki/LicenseMixing#ffmpeg +SRS_SHARED_FFMPEG=NO # whether enable the gcov SRS_GCOV=NO # whether enable the log verbose/info/trace level. @@ -149,8 +154,9 @@ Experts: --sys-ssl=on|off Do not compile ssl, use system ssl(-lssl) if required. Default: $(value2switch $SRS_USE_SYS_SSL) --ssl-1-0=on|off Whether use openssl-1.0.*. Default: $(value2switch $SRS_SSL_1_0) --ssl-local=on|off Whether use local openssl, not system even exists. Default: $(value2switch $SRS_SSL_LOCAL) - --shared-st=on|off Use link shared libraries for ST which uses MPL license. Default: $(value2switch $SRS_SHARED_ST) - --shared-srt=on|off Use link shared libraries for SRT which uses MPL license. Default: $(value2switch $SRS_SHARED_SRT) + --shared-st=on|off Use shared libraries for ST which is MPL license. Default: $(value2switch $SRS_SHARED_ST) + --shared-srt=on|off Use shared libraries for SRT which is MPL license. Default: $(value2switch $SRS_SHARED_SRT) + --shared-ffmpeg=on|off Use shared libraries for FFmpeg which is LGPL license. Default: $(value2switch $SRS_SHARED_FFMPEG) --clean=on|off Whether do 'make clean' when configure. Default: $(value2switch $SRS_CLEAN) --simulator=on|off RTC: Whether enable network simulator. Default: $(value2switch $SRS_SIMULATOR) --build-tag= Set the build object directory suffix. @@ -298,10 +304,10 @@ function parse_user_option() { --sys-ssl) SRS_USE_SYS_SSL=$(switch2value $value) ;; --use-shared-st) SRS_SHARED_ST=YES ;; - --shared-st) SRS_SHARED_ST=$(switch2value $value) ;; - --use-shared-srt) SRS_SHARED_SRT=YES ;; + --shared-st) SRS_SHARED_ST=$(switch2value $value) ;; --shared-srt) SRS_SHARED_SRT=$(switch2value $value) ;; + --shared-ffmpeg) SRS_SHARED_FFMPEG=$(switch2value $value) ;; --with-valgrind) SRS_VALGRIND=YES ;; --without-valgrind) SRS_VALGRIND=NO ;; @@ -483,6 +489,7 @@ function regenerate_options() { SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static=$(value2switch $SRS_STATIC)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --shared-st=$(value2switch $SRS_SHARED_ST)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --shared-srt=$(value2switch $SRS_SHARED_SRT)" + SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --shared-ffmpeg=$(value2switch $SRS_SHARED_FFMPEG)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose=$(value2switch $SRS_LOG_VERBOSE)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info=$(value2switch $SRS_LOG_INFO)" SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace=$(value2switch $SRS_LOG_TRACE)" diff --git a/trunk/configure b/trunk/configure index 9da08295a..c5f16d253 100755 --- a/trunk/configure +++ b/trunk/configure @@ -143,6 +143,7 @@ fi if [[ $SRS_FFMPEG_FIT == YES ]]; then LibFfmpegRoot="${SRS_OBJS_DIR}/ffmpeg/include"; LibFfmpegFile="${SRS_OBJS_DIR}/ffmpeg/lib/libavcodec.a ${SRS_OBJS_DIR}/ffmpeg/lib/libswresample.a ${SRS_OBJS_DIR}/ffmpeg/lib/libavutil.a" LibFfmpegRoot="${LibFfmpegRoot} ${SRS_OBJS_DIR}/opus/include"; LibFfmpegFile="${LibFfmpegFile} ${SRS_OBJS_DIR}/opus/lib/libopus.a" + if [[ $SRS_SHARED_FFMPEG == YES ]]; then LibFfmpegFile="-L${SRS_OBJS_DIR}/ffmpeg/lib -lavcodec -lswresample -lavutil -L${SRS_OBJS_DIR}/opus/lib -lopus"; fi fi # openssl-1.1.0e, for the RTMP complex handshake. diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index ab73c9e97..927b5994b 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 125 +#define VERSION_REVISION 126 #endif