fix build warnings/errors

development
Taner Sener 7 months ago
parent d8464bd02a
commit 07f7f32a70
  1. 14
      android.sh
  2. 7
      android/ffmpeg-kit-android-lib/src/main/cpp/ffmpeg_context.h
  3. 2
      android/jni/Android.mk
  4. 4
      apple/src/FFmpegKit.m
  5. 4
      apple/src/FFprobeKit.m
  6. 7
      apple/src/ffmpeg_context.h
  7. 8
      ios.sh
  8. 8
      linux.sh
  9. 2
      linux/src/Makefile.am
  10. 7
      linux/src/ffmpeg_context.h
  11. 8
      macos.sh
  12. 4
      scripts/function-android.sh
  13. 16
      scripts/function.sh
  14. 5
      scripts/source.sh
  15. 8
      tvos.sh

@ -158,6 +158,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g') EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}" export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;; ;;
--version-*)
CUSTOM_VERSION_KEY=$(echo $1 | sed -e 's/^--version-//g;s/=.*$//g')
CUSTOM_VERSION_VALUE=$(echo $1 | sed -e 's/^--version-.*=//g')
echo -e "INFO: Custom version detected: ${CUSTOM_VERSION_KEY} ${CUSTOM_VERSION_VALUE}\n" 1>>"${BASEDIR}"/build.log 2>&1
generate_custom_version_environment_variables "${CUSTOM_VERSION_KEY}" "${CUSTOM_VERSION_VALUE}"
;;
*) *)
print_unknown_option "$1" print_unknown_option "$1"
;; ;;
@ -190,7 +198,7 @@ if [[ -n ${BUILD_FULL} ]]; then
fi fi
# DISABLE SPECIFIED LIBRARIES # DISABLE SPECIFIED LIBRARIES
for disabled_library in ${disabled_libraries[@]}; do for disabled_library in "${disabled_libraries[@]}"; do
set_library "${disabled_library}" 0 set_library "${disabled_library}" 0
done done
@ -371,7 +379,9 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then
# BUILD NATIVE LIBRARY # BUILD NATIVE LIBRARY
if [[ ${SKIP_ffmpeg_kit} -ne 1 ]]; then if [[ ${SKIP_ffmpeg_kit} -ne 1 ]]; then
if [ "$(is_darwin_arm64)" == "1" ]; then
# NDK >= 24.0 DOES NOT REQUIRE arch -x86_64 ON DARWIN ARM64 HOSTS
if [[ "$(is_darwin_arm64)" == "1" ]] && [[ $(compare_versions "$DETECTED_NDK_VERSION" "24.0") -lt 1 ]]; then
arch -x86_64 "${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1 arch -x86_64 "${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1
else else
"${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1 "${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1

@ -20,16 +20,15 @@
#ifndef FFMPEG_CONTEXT_H #ifndef FFMPEG_CONTEXT_H
#define FFMPEG_CONTEXT_H #define FFMPEG_CONTEXT_H
#if HAVE_TERMIOS_H
#include <termios.h>
#endif
#include "fftools_ffmpeg.h" #include "fftools_ffmpeg.h"
#include "libavformat/avio.h" #include "libavformat/avio.h"
#include "libavutil/dict.h" #include "libavutil/dict.h"
extern __thread BenchmarkTimeStamps current_time; extern __thread BenchmarkTimeStamps current_time;
#if HAVE_TERMIOS_H
#include <termios.h>
extern __thread struct termios oldtty; extern __thread struct termios oldtty;
#endif
extern __thread int restore_tty; extern __thread int restore_tty;
extern __thread volatile int received_sigterm; extern __thread volatile int received_sigterm;
extern __thread volatile int received_nb_signals; extern __thread volatile int received_nb_signals;

@ -57,7 +57,7 @@ include $(BUILD_SHARED_LIBRARY)
$(call import-module, cpu-features) $(call import-module, cpu-features)
MY_SRC_FILES := ffmpegkit.c ffprobekit.c ffmpegkit_exception.c fftools_cmdutils.c fftools_ffmpeg.c fftools_ffprobe.c fftools_ffmpeg_mux.c fftools_ffmpeg_mux_init.c fftools_ffmpeg_demux.c fftools_ffmpeg_enc.c fftools_ffmpeg_dec.c fftools_ffmpeg_opt.c fftools_opt_common.c fftools_ffmpeg_hw.c fftools_ffmpeg_filter.c fftools_objpool.c fftools_sync_queue.c fftools_thread_queue.c android_support.c MY_SRC_FILES := ffmpegkit.c ffprobekit.c ffmpegkit_exception.c fftools_cmdutils.c fftools_ffmpeg.c fftools_ffprobe.c fftools_ffmpeg_mux.c fftools_ffmpeg_mux_init.c fftools_ffmpeg_demux.c fftools_ffmpeg_enc.c fftools_ffmpeg_dec.c fftools_ffmpeg_opt.c fftools_opt_common.c fftools_ffmpeg_hw.c fftools_ffmpeg_filter.c fftools_objpool.c fftools_sync_queue.c fftools_thread_queue.c android_support.c ffmpeg_context.c
MY_CFLAGS := -Wall -Werror -Wno-unused-parameter -Wno-switch -Wno-sign-compare MY_CFLAGS := -Wall -Werror -Wno-unused-parameter -Wno-switch -Wno-sign-compare
MY_LDLIBS := -llog -lz -landroid MY_LDLIBS := -llog -lz -landroid

@ -17,12 +17,12 @@
* along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>. * along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
*/ */
#import "FFmpegKit.h" #import "fftools_ffmpeg.h"
#import "ArchDetect.h" #import "ArchDetect.h"
#import "AtomicLong.h" #import "AtomicLong.h"
#import "FFmpegKit.h"
#import "FFmpegKitConfig.h" #import "FFmpegKitConfig.h"
#import "Packages.h" #import "Packages.h"
#import "fftools_ffmpeg.h"
@implementation FFmpegKit @implementation FFmpegKit

@ -17,10 +17,10 @@
* along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>. * along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
*/ */
#import "FFprobeKit.h" #import "fftools_ffmpeg.h"
#import "FFmpegKit.h" #import "FFmpegKit.h"
#import "FFmpegKitConfig.h" #import "FFmpegKitConfig.h"
#import "fftools_ffmpeg.h" #import "FFprobeKit.h"
@implementation FFprobeKit @implementation FFprobeKit

@ -20,16 +20,15 @@
#ifndef FFMPEG_CONTEXT_H #ifndef FFMPEG_CONTEXT_H
#define FFMPEG_CONTEXT_H #define FFMPEG_CONTEXT_H
#if HAVE_TERMIOS_H
#include <termios.h>
#endif
#include "fftools_ffmpeg.h" #include "fftools_ffmpeg.h"
#include "libavformat/avio.h" #include "libavformat/avio.h"
#include "libavutil/dict.h" #include "libavutil/dict.h"
extern __thread BenchmarkTimeStamps current_time; extern __thread BenchmarkTimeStamps current_time;
#if HAVE_TERMIOS_H
#include <termios.h>
extern __thread struct termios oldtty; extern __thread struct termios oldtty;
#endif
extern __thread int restore_tty; extern __thread int restore_tty;
extern __thread volatile int received_sigterm; extern __thread volatile int received_sigterm;
extern __thread volatile int received_nb_signals; extern __thread volatile int received_nb_signals;

@ -169,6 +169,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g') EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}" export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;; ;;
--version-*)
CUSTOM_VERSION_KEY=$(echo $1 | sed -e 's/^--version-//g;s/=.*$//g')
CUSTOM_VERSION_VALUE=$(echo $1 | sed -e 's/^--version-.*=//g')
echo -e "INFO: Custom version detected: ${CUSTOM_VERSION_KEY} ${CUSTOM_VERSION_VALUE}\n" 1>>"${BASEDIR}"/build.log 2>&1
generate_custom_version_environment_variables "${CUSTOM_VERSION_KEY}" "${CUSTOM_VERSION_VALUE}"
;;
*) *)
print_unknown_option "$1" print_unknown_option "$1"
;; ;;

@ -124,6 +124,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g') EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}" export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;; ;;
--version-*)
CUSTOM_VERSION_KEY=$(echo $1 | sed -e 's/^--version-//g;s/=.*$//g')
CUSTOM_VERSION_VALUE=$(echo $1 | sed -e 's/^--version-.*=//g')
echo -e "INFO: Custom version detected: ${CUSTOM_VERSION_KEY} ${CUSTOM_VERSION_VALUE}\n" 1>>"${BASEDIR}"/build.log 2>&1
generate_custom_version_environment_variables "${CUSTOM_VERSION_KEY}" "${CUSTOM_VERSION_VALUE}"
;;
*) *)
print_unknown_option "$1" print_unknown_option "$1"
;; ;;

@ -19,6 +19,7 @@ libffmpegkit_la_SOURCES = \
ReturnCode.cpp \ ReturnCode.cpp \
Statistics.cpp \ Statistics.cpp \
StreamInformation.cpp \ StreamInformation.cpp \
ffmpeg_context.c \
ffmpegkit_exception.cpp \ ffmpegkit_exception.cpp \
fftools_cmdutils.c \ fftools_cmdutils.c \
fftools_ffmpeg.c \ fftools_ffmpeg.c \
@ -63,6 +64,7 @@ include_HEADERS = \
Statistics.h \ Statistics.h \
StatisticsCallback.h \ StatisticsCallback.h \
StreamInformation.h \ StreamInformation.h \
ffmpeg_context.h \
ffmpegkit_exception.h \ ffmpegkit_exception.h \
fftools_cmdutils.h \ fftools_cmdutils.h \
fftools_ffmpeg.h \ fftools_ffmpeg.h \

@ -20,16 +20,15 @@
#ifndef FFMPEG_CONTEXT_H #ifndef FFMPEG_CONTEXT_H
#define FFMPEG_CONTEXT_H #define FFMPEG_CONTEXT_H
#if HAVE_TERMIOS_H
#include <termios.h>
#endif
#include "fftools_ffmpeg.h" #include "fftools_ffmpeg.h"
#include "libavformat/avio.h" #include "libavformat/avio.h"
#include "libavutil/dict.h" #include "libavutil/dict.h"
extern __thread BenchmarkTimeStamps current_time; extern __thread BenchmarkTimeStamps current_time;
#if HAVE_TERMIOS_H
#include <termios.h>
extern __thread struct termios oldtty; extern __thread struct termios oldtty;
#endif
extern __thread int restore_tty; extern __thread int restore_tty;
extern __thread volatile int received_sigterm; extern __thread volatile int received_sigterm;
extern __thread volatile int received_nb_signals; extern __thread volatile int received_nb_signals;

@ -161,6 +161,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g') EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}" export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;; ;;
--version-*)
CUSTOM_VERSION_KEY=$(echo $1 | sed -e 's/^--version-//g;s/=.*$//g')
CUSTOM_VERSION_VALUE=$(echo $1 | sed -e 's/^--version-.*=//g')
echo -e "INFO: Custom version detected: ${CUSTOM_VERSION_KEY} ${CUSTOM_VERSION_VALUE}\n" 1>>"${BASEDIR}"/build.log 2>&1
generate_custom_version_environment_variables "${CUSTOM_VERSION_KEY}" "${CUSTOM_VERSION_VALUE}"
;;
*) *)
print_unknown_option "$1" print_unknown_option "$1"
;; ;;

@ -94,9 +94,9 @@ APP_ALLOW_MISSING_DEPS := true
APP_PLATFORM := android-${API} APP_PLATFORM := android-${API}
APP_CFLAGS := -O3 -DANDROID ${LTS_BUILD_FLAG}${BUILD_DATE} -Wall -Wno-deprecated-declarations -Wno-pointer-sign -Wno-switch -Wno-unused-result -Wno-unused-variable ${USES_FFMPEG_KIT_PROTOCOLS} ${FFMPEG_KIT_DEBUG} APP_CFLAGS := -O3 -DANDROID ${LTS_BUILD_FLAG}${BUILD_DATE} -Wall -Wno-deprecated-declarations -Wno-pointer-sign -Wno-switch -Wno-unused-result -Wno-unused-variable ${USES_FFMPEG_KIT_PROTOCOLS} ${FFMPEG_KIT_DEBUG} ${EXTRA_CFLAGS}
APP_LDFLAGS := -Wl,--hash-style=both APP_LDFLAGS := -Wl,--hash-style=both ${EXTRA_LDFLAGS}
EOF EOF
} }

@ -924,6 +924,7 @@ display_help_advanced_options() {
echo -e " --reconf-LIBRARY\t\trun autoreconf before building LIBRARY [no]" echo -e " --reconf-LIBRARY\t\trun autoreconf before building LIBRARY [no]"
echo -e " --redownload-LIBRARY\t\tdownload LIBRARY even if it is detected as already downloaded [no]" echo -e " --redownload-LIBRARY\t\tdownload LIBRARY even if it is detected as already downloaded [no]"
echo -e " --rebuild-LIBRARY\t\tbuild LIBRARY even if it is detected as already built [no]" echo -e " --rebuild-LIBRARY\t\tbuild LIBRARY even if it is detected as already built [no]"
echo -e " --version-LIBRARY=n\t\toverride default LIBRARY version []"
if [ -n "$1" ]; then if [ -n "$1" ]; then
echo -e "$1" echo -e "$1"
fi fi
@ -2416,6 +2417,21 @@ initialize_folder() {
} }
fail_operation() { fail_operation() {
if [[ "$?" -ne 0 ]]; then
echo -e "failed\n" echo -e "failed\n"
echo -e "See build.log for the details\n" echo -e "See build.log for the details\n"
fi
}
#
# 1. key
# 2. value
#
generate_custom_version_environment_variables() {
VERSION_KEY=$(echo "VERSION_$1" | sed "s/\-/\_/g" | tr '[A-Z]' '[a-z]')
VERSION_VALUE="$2"
export "${VERSION_KEY}"="${VERSION_VALUE}"
echo -e "INFO: Custom version env variable generated: ${VERSION_KEY}=${VERSION_VALUE}\n" 1>>"${BASEDIR}"/build.log 2>&1
} }

@ -273,7 +273,12 @@ get_library_source() {
echo "${SOURCE_REPO_URL}" echo "${SOURCE_REPO_URL}"
;; ;;
2) 2)
CUSTOM_VERSION_FLAG=$(echo "version_$1" | sed "s/\-/\_/g")
if [[ ! -z "${!CUSTOM_VERSION_FLAG}" ]]; then
echo "${!CUSTOM_VERSION_FLAG}"
else
echo "${SOURCE_ID}" echo "${SOURCE_ID}"
fi
;; ;;
3) 3)
echo "${SOURCE_TYPE}" echo "${SOURCE_TYPE}"

@ -164,6 +164,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g') EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}" export EXTRA_LDFLAGS="${EXTRA_LDFLAGS}"
;; ;;
--version-*)
CUSTOM_VERSION_KEY=$(echo $1 | sed -e 's/^--version-//g;s/=.*$//g')
CUSTOM_VERSION_VALUE=$(echo $1 | sed -e 's/^--version-.*=//g')
echo -e "INFO: Custom version detected: ${CUSTOM_VERSION_KEY} ${CUSTOM_VERSION_VALUE}\n" 1>>"${BASEDIR}"/build.log 2>&1
generate_custom_version_environment_variables "${CUSTOM_VERSION_KEY}" "${CUSTOM_VERSION_VALUE}"
;;
*) *)
print_unknown_option "$1" print_unknown_option "$1"
;; ;;

Loading…
Cancel
Save