ffmpeg-kit/android/jni/Android.mk

124 lines
4.1 KiB
Makefile
Raw Normal View History

2020-08-05 03:53:02 +03:00
MY_LOCAL_PATH := $(call my-dir)
$(call import-add-path, $(MY_LOCAL_PATH))
MY_ARMV7 := false
MY_ARMV7_NEON := false
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
ifeq ("$(shell test -e $(MY_LOCAL_PATH)/../build/.armv7 && echo armv7)","armv7")
MY_ARMV7 := true
endif
ifeq ("$(shell test -e $(MY_LOCAL_PATH)/../build/.armv7neon && echo armv7neon)","armv7neon")
MY_ARMV7_NEON := true
endif
endif
2020-11-23 00:51:45 +02:00
ifeq ("$(shell test -e $(MY_LOCAL_PATH)/../build/.lts && echo lts)","lts")
MY_LTS_POSTFIX := -lts
2020-08-05 03:53:02 +03:00
else
MY_LTS_POSTFIX :=
endif
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
2020-11-23 00:51:45 +02:00
ifeq ($(MY_ARMV7_NEON), true)
MY_BUILD_DIR := android-$(TARGET_ARCH)-neon$(MY_LTS_POSTFIX)
2020-11-23 00:51:45 +02:00
else
MY_BUILD_DIR := android-$(TARGET_ARCH)$(MY_LTS_POSTFIX)
2020-11-23 00:51:45 +02:00
endif
else
MY_BUILD_DIR := android-$(TARGET_ARCH)$(MY_LTS_POSTFIX)
2020-08-05 03:53:02 +03:00
endif
2020-11-23 00:51:45 +02:00
FFMPEG_INCLUDES := $(MY_LOCAL_PATH)/../../prebuilt/$(MY_BUILD_DIR)/ffmpeg/include
2020-08-05 03:53:02 +03:00
MY_ARM_MODE := arm
MY_ARM_NEON := false
2021-01-26 23:24:31 +02:00
LOCAL_PATH := $(MY_LOCAL_PATH)/../ffmpeg-kit-android-lib/src/main/cpp
2020-08-05 03:53:02 +03:00
# DEFINE ARCH FLAGS
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
MY_ARCH_FLAGS := ARM_V7A
2022-09-02 01:24:40 +03:00
ifeq ("$(shell test -e $(MY_LOCAL_PATH)/../build/.lts && echo lts)","lts")
MY_ARM_NEON := false
else
MY_ARM_NEON := true
endif
2020-08-05 03:53:02 +03:00
endif
ifeq ($(TARGET_ARCH_ABI), arm64-v8a)
MY_ARCH_FLAGS := ARM64_V8A
MY_ARM_NEON := true
endif
ifeq ($(TARGET_ARCH_ABI), x86)
MY_ARCH_FLAGS := X86
2022-09-02 01:24:40 +03:00
MY_ARM_NEON := true
2020-08-05 03:53:02 +03:00
endif
ifeq ($(TARGET_ARCH_ABI), x86_64)
MY_ARCH_FLAGS := X86_64
2022-09-02 01:24:40 +03:00
MY_ARM_NEON := true
2020-08-05 03:53:02 +03:00
endif
include $(CLEAR_VARS)
LOCAL_ARM_MODE := $(MY_ARM_MODE)
LOCAL_MODULE := ffmpegkit_abidetect
LOCAL_SRC_FILES := ffmpegkit_abidetect.c
LOCAL_CFLAGS := -Wall -Wextra -Werror -Wno-unused-parameter -DFFMPEG_KIT_${MY_ARCH_FLAGS}
LOCAL_C_INCLUDES := $(FFMPEG_INCLUDES)
LOCAL_LDLIBS := -llog -lz -landroid
LOCAL_STATIC_LIBRARIES := cpu-features
LOCAL_ARM_NEON := ${MY_ARM_NEON}
include $(BUILD_SHARED_LIBRARY)
$(call import-module, cpu-features)
2023-08-03 08:32:35 +03:00
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_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
2021-01-11 03:09:39 +02:00
2020-08-05 03:53:02 +03:00
ifeq ($(TARGET_PLATFORM),android-16)
2021-01-11 03:09:39 +02:00
MY_SRC_FILES += android_lts_support.c
2020-08-05 03:53:02 +03:00
else ifeq ($(TARGET_PLATFORM),android-17)
2021-01-11 03:09:39 +02:00
MY_SRC_FILES += android_lts_support.c
2020-08-05 03:53:02 +03:00
endif
MY_CFLAGS := -Wall -Werror -Wno-unused-parameter -Wno-switch -Wno-sign-compare
MY_LDLIBS := -llog -lz -landroid
MY_BUILD_GENERIC_FFMPEG_KIT := true
ifeq ($(MY_ARMV7_NEON), true)
include $(CLEAR_VARS)
2021-01-26 23:24:31 +02:00
LOCAL_PATH := $(MY_LOCAL_PATH)/../ffmpeg-kit-android-lib/src/main/cpp
2020-08-05 03:53:02 +03:00
LOCAL_ARM_MODE := $(MY_ARM_MODE)
LOCAL_MODULE := ffmpegkit_armv7a_neon
LOCAL_SRC_FILES := $(MY_SRC_FILES)
LOCAL_CFLAGS := $(MY_CFLAGS)
LOCAL_LDLIBS := $(MY_LDLIBS)
LOCAL_SHARED_LIBRARIES := libavcodec_neon libavfilter_neon libswscale_neon libavformat_neon libavutil_neon libswresample_neon libavdevice_neon
ifeq ($(APP_STL), c++_shared)
LOCAL_SHARED_LIBRARIES += c++_shared # otherwise NDK will not add the library for packaging
endif
LOCAL_ARM_NEON := true
include $(BUILD_SHARED_LIBRARY)
$(call import-module, ffmpeg/neon)
ifneq ($(MY_ARMV7), true)
MY_BUILD_GENERIC_FFMPEG_KIT := false
endif
endif
ifeq ($(MY_BUILD_GENERIC_FFMPEG_KIT), true)
include $(CLEAR_VARS)
2021-01-26 23:24:31 +02:00
LOCAL_PATH := $(MY_LOCAL_PATH)/../ffmpeg-kit-android-lib/src/main/cpp
2020-08-05 03:53:02 +03:00
LOCAL_ARM_MODE := $(MY_ARM_MODE)
LOCAL_MODULE := ffmpegkit
LOCAL_SRC_FILES := $(MY_SRC_FILES)
LOCAL_CFLAGS := $(MY_CFLAGS)
LOCAL_LDLIBS := $(MY_LDLIBS)
LOCAL_SHARED_LIBRARIES := libavfilter libavformat libavcodec libavutil libswresample libavdevice libswscale
ifeq ($(APP_STL), c++_shared)
LOCAL_SHARED_LIBRARIES += c++_shared # otherwise NDK will not add the library for packaging
endif
LOCAL_ARM_NEON := ${MY_ARM_NEON}
include $(BUILD_SHARED_LIBRARY)
$(call import-module, ffmpeg)
endif