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. 2
      apple/src/Log.h
  7. 2
      apple/src/Log.m
  8. 7
      apple/src/ffmpeg_context.h
  9. 8
      ios.sh
  10. 8
      linux.sh
  11. 2
      linux/src/Makefile.am
  12. 7
      linux/src/ffmpeg_context.h
  13. 8
      macos.sh
  14. 4
      scripts/function-android.sh
  15. 16
      scripts/function.sh
  16. 5
      scripts/source.sh
  17. 8
      tvos.sh

@ -158,6 +158,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
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"
;;
@ -190,7 +198,7 @@ if [[ -n ${BUILD_FULL} ]]; then
fi
# DISABLE SPECIFIED LIBRARIES
for disabled_library in ${disabled_libraries[@]}; do
for disabled_library in "${disabled_libraries[@]}"; do
set_library "${disabled_library}" 0
done
@ -371,7 +379,9 @@ if [[ -n ${ANDROID_ARCHITECTURES} ]]; then
# BUILD NATIVE LIBRARY
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
else
"${ANDROID_NDK_ROOT}"/ndk-build -B 1>>"${BASEDIR}"/build.log 2>&1

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

@ -57,7 +57,7 @@ include $(BUILD_SHARED_LIBRARY)
$(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_LDLIBS := -llog -lz -landroid

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

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

@ -27,7 +27,7 @@
*/
@interface Log : NSObject
- (instancetype)init:(long)sessionId:(int)level:(NSString *)message;
- (instancetype)init:(long)sessionId :(int)level :(NSString *)message;
- (long)getSessionId;

@ -25,7 +25,7 @@
NSString *_message;
}
- (instancetype)init:(long)sessionId:(int)level:(NSString *)message {
- (instancetype)init:(long)sessionId :(int)level :(NSString *)message {
self = [super init];
if (self) {
_sessionId = sessionId;

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

@ -124,6 +124,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
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"
;;

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

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

@ -94,9 +94,9 @@ APP_ALLOW_MISSING_DEPS := true
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
}

@ -924,6 +924,7 @@ display_help_advanced_options() {
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 " --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
echo -e "$1"
fi
@ -2416,6 +2417,21 @@ initialize_folder() {
}
fail_operation() {
if [[ "$?" -ne 0 ]]; then
echo -e "failed\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}"
;;
2)
CUSTOM_VERSION_FLAG=$(echo "version_$1" | sed "s/\-/\_/g")
if [[ ! -z "${!CUSTOM_VERSION_FLAG}" ]]; then
echo "${!CUSTOM_VERSION_FLAG}"
else
echo "${SOURCE_ID}"
fi
;;
3)
echo "${SOURCE_TYPE}"

@ -164,6 +164,14 @@ while [ ! $# -eq 0 ]; do
EXTRA_LDFLAGS=$(echo $1 | sed -e 's/^--extra-ldflags=//g')
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"
;;

Loading…
Cancel
Save