From 4372e32f72bcb3ffa08700f0d18dc7a6aaa7d16d Mon Sep 17 00:00:00 2001
From: Haibo Chen <495810242@qq.com>
Date: Mon, 6 Nov 2023 14:46:58 +0800
Subject: [PATCH] Don't compile libopus when enable sys-ffmpeg. v5.0.198
v6.0.98 (#3851)
---
trunk/auto/depends.sh | 2 +-
trunk/auto/options.sh | 125 +++++++++++----------------
trunk/doc/CHANGELOG.md | 2 +
trunk/src/core/srs_core_version5.hpp | 2 +-
trunk/src/core/srs_core_version6.hpp | 2 +-
5 files changed, 57 insertions(+), 76 deletions(-)
diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh
index e376fb016..38d09bf83 100755
--- a/trunk/auto/depends.sh
+++ b/trunk/auto/depends.sh
@@ -514,7 +514,7 @@ fi
# libopus, for WebRTC to transcode AAC with Opus.
#####################################################################################
# For cross build, we use opus of FFmpeg, so we don't build the libopus.
-if [[ $SRS_RTC == YES && $SRS_FFMPEG_OPUS != YES ]]; then
+if [[ $SRS_RTC == YES && $SRS_USE_SYS_FFMPEG != YES && $SRS_FFMPEG_OPUS != YES ]]; then
# Only build static libraries if no shared FFmpeg.
if [[ $SRS_SHARED_FFMPEG != YES ]]; then
OPUS_OPTIONS="--disable-shared --disable-doc"
diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh
index 0b1aba3ed..f856f7625 100755
--- a/trunk/auto/options.sh
+++ b/trunk/auto/options.sh
@@ -315,49 +315,22 @@ function parse_user_option() {
--extra-flags) SRS_EXTRA_FLAGS=${value} ;;
--build-tag) SRS_BUILD_TAG=${value} ;;
- --without-srtp-nasm) SRS_SRTP_ASM=NO ;;
- --with-srtp-nasm) SRS_SRTP_ASM=YES ;;
--srtp-nasm) SRS_SRTP_ASM=$(switch2value $value) ;;
-
- --without-nasm) SRS_NASM=NO ;;
- --with-nasm) SRS_NASM=YES ;;
--nasm) SRS_NASM=$(switch2value $value) ;;
-
- --with-ssl) SRS_SSL=YES ;;
--ssl) SRS_SSL=$(switch2value $value) ;;
--https) SRS_HTTPS=$(switch2value $value) ;;
--ssl-1-0) SRS_SSL_1_0=$(switch2value $value) ;;
--ssl-local) SRS_SSL_LOCAL=$(switch2value $value) ;;
-
- --with-hds) SRS_HDS=YES ;;
- --without-hds) SRS_HDS=NO ;;
--hds) SRS_HDS=$(switch2value $value) ;;
-
- --with-transcode) SRS_TRANSCODE=YES ;;
--transcode) SRS_TRANSCODE=$(switch2value $value) ;;
-
- --with-ingest) SRS_INGEST=YES ;;
--ingest) SRS_INGEST=$(switch2value $value) ;;
-
- --with-stat) SRS_STAT=YES ;;
--stat) SRS_STAT=$(switch2value $value) ;;
-
- --with-stream-caster) SRS_STREAM_CASTER=YES ;;
--stream-caster) SRS_STREAM_CASTER=$(switch2value $value) ;;
--stream-converter) SRS_STREAM_CASTER=$(switch2value $value) ;;
-
- --with-utest) SRS_UTEST=YES ;;
- --without-utest) SRS_UTEST=NO ;;
--utest) SRS_UTEST=$(switch2value $value) ;;
--gcov) SRS_GCOV=$(switch2value $value) ;;
--apm) SRS_APM=$(switch2value $value) ;;
-
- --with-srt) SRS_SRT=YES ;;
- --without-srt) SRS_SRT=NO ;;
--srt) SRS_SRT=$(switch2value $value) ;;
-
- --with-rtc) SRS_RTC=YES ;;
- --without-rtc) SRS_RTC=NO ;;
--rtc) SRS_RTC=$(switch2value $value) ;;
--simulator) SRS_SIMULATOR=$(switch2value $value) ;;
--generate-objs) SRS_GENERATE_OBJS=$(switch2value $value) ;;
@@ -366,39 +339,16 @@ function parse_user_option() {
--ffmpeg-opus) SRS_FFMPEG_OPUS=$(switch2value $value) ;;
--h265) SRS_H265=$(switch2value $value) ;;
--gb28181) SRS_GB28181=$(switch2value $value) ;;
-
--cxx11) SRS_CXX11=$(switch2value $value) ;;
--cxx14) SRS_CXX14=$(switch2value $value) ;;
--backtrace) SRS_BACKTRACE=$(switch2value $value) ;;
-
- --with-clean) SRS_CLEAN=YES ;;
- --without-clean) SRS_CLEAN=NO ;;
--clean) SRS_CLEAN=$(switch2value $value) ;;
-
- --with-gperf) SRS_GPERF=YES ;;
- --without-gperf) SRS_GPERF=NO ;;
--gperf) SRS_GPERF=$(switch2value $value) ;;
-
- --with-gmc) SRS_GPERF_MC=YES ;;
- --without-gmc) SRS_GPERF_MC=NO ;;
--gmc) SRS_GPERF_MC=$(switch2value $value) ;;
-
- --with-gmd) SRS_GPERF_MD=YES ;;
- --without-gmd) SRS_GPERF_MD=NO ;;
--gmd) SRS_GPERF_MD=$(switch2value $value) ;;
-
- --with-gmp) SRS_GPERF_MP=YES ;;
- --without-gmp) SRS_GPERF_MP=NO ;;
--gmp) SRS_GPERF_MP=$(switch2value $value) ;;
-
- --with-gcp) SRS_GPERF_CP=YES ;;
- --without-gcp) SRS_GPERF_CP=NO ;;
--gcp) SRS_GPERF_CP=$(switch2value $value) ;;
-
- --with-gprof) SRS_GPROF=YES ;;
- --without-gprof) SRS_GPROF=NO ;;
--gprof) SRS_GPROF=$(switch2value $value) ;;
-
--sanitizer) SRS_SANITIZER=$(switch2value $value) ;;
--sanitizer-static) SRS_SANITIZER_STATIC=$(switch2value $value) ;;
--sanitizer-log) SRS_SANITIZER_LOG=$(switch2value $value) ;;
@@ -418,9 +368,6 @@ function parse_user_option() {
--shared-srtp) SRS_SHARED_SRTP=$(switch2value $value) ;;
--use-sys-srtp) SRS_USE_SYS_SRTP=YES ;;
--sys-srtp) SRS_USE_SYS_SRTP=$(switch2value $value) ;;
-
- --with-valgrind) SRS_VALGRIND=YES ;;
- --without-valgrind) SRS_VALGRIND=NO ;;
--valgrind) SRS_VALGRIND=$(switch2value $value) ;;
--log-verbose) SRS_LOG_VERBOSE=$(switch2value $value) ;;
@@ -430,29 +377,60 @@ function parse_user_option() {
--debug) SRS_DEBUG=$(switch2value $value) ;;
--debug-stats) SRS_DEBUG_STATS=$(switch2value $value) ;;
- --generic-linux) SRS_GENERIC_LINUX=$(switch2value $value) ;;
-
- # Alias for --arm, cross build.
- --cross) SRS_CROSS_BUILD=$(switch2value $value) ;;
--cross-build) SRS_CROSS_BUILD=YES ;;
- --enable-cross-compile) SRS_CROSS_BUILD=YES ;;
-
- # Deprecated, might be removed in future.
- --osx) SRS_OSX=YES ;;
- --cygwin64) SRS_CYGWIN64=YES ;;
- --x86-x64) SRS_X86_X64=YES ;;
- --x86-64) SRS_X86_X64=YES ;;
- --with-nginx) SRS_NGINX=YES ;;
- --without-nginx) SRS_NGINX=NO ;;
- --nginx) SRS_NGINX=$(switch2value $value) ;;
- --with-ffmpeg) SRS_FFMPEG_TOOL=YES ;;
- --without-ffmpeg) SRS_FFMPEG_TOOL=NO ;;
- --ffmpeg) SRS_FFMPEG_TOOL=$(switch2value $value) ;;
- --ffmpeg-tool) SRS_FFMPEG_TOOL=$(switch2value $value) ;;
-
- # use cache for build.
+ --generic-linux) SRS_GENERIC_LINUX=$(switch2value $value) ;;
--build-cache) SRS_BUILD_CACHE=$(switch2value $value) ;;
+ ##########################################################################################
+ --without-srtp-nasm) SRS_SRTP_ASM=NO ;; # Deprecated, might be removed in future.
+ --with-srtp-nasm) SRS_SRTP_ASM=YES ;; # Deprecated, might be removed in future.
+ --without-nasm) SRS_NASM=NO ;; # Deprecated, might be removed in future.
+ --with-nasm) SRS_NASM=YES ;; # Deprecated, might be removed in future.
+ --with-ssl) SRS_SSL=YES ;; # Deprecated, might be removed in future.
+ --with-hds) SRS_HDS=YES ;; # Deprecated, might be removed in future.
+ --without-hds) SRS_HDS=NO ;; # Deprecated, might be removed in future.
+ --with-transcode) SRS_TRANSCODE=YES ;; # Deprecated, might be removed in future.
+ --with-ingest) SRS_INGEST=YES ;; # Deprecated, might be removed in future.
+ --with-stat) SRS_STAT=YES ;; # Deprecated, might be removed in future.
+ --with-stream-caster) SRS_STREAM_CASTER=YES ;; # Deprecated, might be removed in future.
+ --with-utest) SRS_UTEST=YES ;; # Deprecated, might be removed in future.
+ --without-utest) SRS_UTEST=NO ;; # Deprecated, might be removed in future.
+ --with-srt) SRS_SRT=YES ;; # Deprecated, might be removed in future.
+ --without-srt) SRS_SRT=NO ;; # Deprecated, might be removed in future.
+ --with-rtc) SRS_RTC=YES ;; # Deprecated, might be removed in future.
+ --without-rtc) SRS_RTC=NO ;; # Deprecated, might be removed in future.
+ --with-clean) SRS_CLEAN=YES ;; # Deprecated, might be removed in future.
+ --without-clean) SRS_CLEAN=NO ;; # Deprecated, might be removed in future.
+ --with-gperf) SRS_GPERF=YES ;; # Deprecated, might be removed in future.
+ --without-gperf) SRS_GPERF=NO ;; # Deprecated, might be removed in future.
+ --with-gmc) SRS_GPERF_MC=YES ;; # Deprecated, might be removed in future.
+ --without-gmc) SRS_GPERF_MC=NO ;; # Deprecated, might be removed in future.
+ --with-gmd) SRS_GPERF_MD=YES ;; # Deprecated, might be removed in future.
+ --without-gmd) SRS_GPERF_MD=NO ;; # Deprecated, might be removed in future.
+ --with-gmp) SRS_GPERF_MP=YES ;; # Deprecated, might be removed in future.
+ --without-gmp) SRS_GPERF_MP=NO ;; # Deprecated, might be removed in future.
+ --with-gcp) SRS_GPERF_CP=YES ;; # Deprecated, might be removed in future.
+ --without-gcp) SRS_GPERF_CP=NO ;; # Deprecated, might be removed in future.
+ --with-gprof) SRS_GPROF=YES ;; # Deprecated, might be removed in future.
+ --without-gprof) SRS_GPROF=NO ;; # Deprecated, might be removed in future.
+ --with-valgrind) SRS_VALGRIND=YES ;; # Deprecated, might be removed in future.
+ --without-valgrind) SRS_VALGRIND=NO ;; # Deprecated, might be removed in future.
+ --cross) SRS_CROSS_BUILD=$(switch2value $value) ;; # Deprecated, might be removed in future.
+ --enable-cross-compile) SRS_CROSS_BUILD=YES ;; # Deprecated, might be removed in future.
+
+ ##########################################################################################
+ --osx) SRS_OSX=YES ;; # Deprecated, might be removed in future.
+ --cygwin64) SRS_CYGWIN64=YES ;; # Deprecated, might be removed in future.
+ --x86-x64) SRS_X86_X64=YES ;; # Deprecated, might be removed in future.
+ --x86-64) SRS_X86_X64=YES ;; # Deprecated, might be removed in future.
+ --with-nginx) SRS_NGINX=YES ;; # Deprecated, might be removed in future.
+ --without-nginx) SRS_NGINX=NO ;; # Deprecated, might be removed in future.
+ --nginx) SRS_NGINX=$(switch2value $value) ;; # Deprecated, might be removed in future.
+ --with-ffmpeg) SRS_FFMPEG_TOOL=YES ;; # Deprecated, might be removed in future.
+ --without-ffmpeg) SRS_FFMPEG_TOOL=NO ;; # Deprecated, might be removed in future.
+ --ffmpeg) SRS_FFMPEG_TOOL=$(switch2value $value) ;; # Deprecated, might be removed in future.
+ --ffmpeg-tool) SRS_FFMPEG_TOOL=$(switch2value $value) ;; # Deprecated, might be removed in future.
+
*)
echo "$0: error: invalid option \"$option\""
exit 1
@@ -700,6 +678,7 @@ function regenerate_options() {
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cygwin64=$(value2switch $SRS_CYGWIN64)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --single-thread=$(value2switch $SRS_SINGLE_THREAD)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --generic-linux=$(value2switch $SRS_GENERIC_LINUX)"
+ SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --build-cache=$(value2switch $SRS_BUILD_CACHE)"
if [[ $SRS_CROSS_BUILD_ARCH != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --arch=$SRS_CROSS_BUILD_ARCH"; fi
if [[ $SRS_CROSS_BUILD_CPU != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --cpu=$SRS_CROSS_BUILD_CPU"; fi
if [[ $SRS_CROSS_BUILD_HOST != "" ]]; then SRS_AUTO_CONFIGURE="$SRS_AUTO_CONFIGURE --host=$SRS_CROSS_BUILD_HOST"; fi
diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md
index 551a7b0a8..d84f0ddbf 100644
--- a/trunk/doc/CHANGELOG.md
+++ b/trunk/doc/CHANGELOG.md
@@ -7,6 +7,7 @@ The changelog for SRS.
## SRS 6.0 Changelog
+* v6.0, 2023-11-06, Merge [#3851](https://github.com/ossrs/srs/pull/3851): donot compile libopus when enable sys-ffmpeg. v6.0.98 (#3851)
* v6.0, 2023-11-04, Merge [#3852](https://github.com/ossrs/srs/pull/3852): RTC: Refine FFmpeg opus audio noisy issue. v6.0.97 (#3852)
* v6.0, 2023-11-01, Merge [#3858](https://github.com/ossrs/srs/pull/3858): Support build without cache to test if actions fail. v6.0.96 (#3858)
* v6.0, 2023-10-25, Merge [#3845](https://github.com/ossrs/srs/pull/3845): RTC: Fix FFmpeg opus audio noisy issue. v6.0.95 (#3845)
@@ -109,6 +110,7 @@ The changelog for SRS.
## SRS 5.0 Changelog
+* v5.0, 2023-11-06, Merge [#3851](https://github.com/ossrs/srs/pull/3851): donot compile libopus when enable sys-ffmpeg. v5.0.198 (#3851)
* v5.0, 2023-11-04, Merge [#3852](https://github.com/ossrs/srs/pull/3852): RTC: Refine FFmpeg opus audio noisy issue. v5.0.197 (#3852)
* v5.0, 2023-11-01, Merge [#3858](https://github.com/ossrs/srs/pull/3858): Support build without cache to test if actions fail. v5.0.196 (#3858)
* v5.0, 2023-10-25, Merge [#3845](https://github.com/ossrs/srs/pull/3845): RTC: Fix FFmpeg opus audio noisy issue. v5.0.195 (#3845)
diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp
index 7610384ec..9ed582eca 100644
--- a/trunk/src/core/srs_core_version5.hpp
+++ b/trunk/src/core/srs_core_version5.hpp
@@ -9,6 +9,6 @@
#define VERSION_MAJOR 5
#define VERSION_MINOR 0
-#define VERSION_REVISION 197
+#define VERSION_REVISION 198
#endif
diff --git a/trunk/src/core/srs_core_version6.hpp b/trunk/src/core/srs_core_version6.hpp
index 53de90ee2..c3e667506 100644
--- a/trunk/src/core/srs_core_version6.hpp
+++ b/trunk/src/core/srs_core_version6.hpp
@@ -9,6 +9,6 @@
#define VERSION_MAJOR 6
#define VERSION_MINOR 0
-#define VERSION_REVISION 97
+#define VERSION_REVISION 98
#endif