Files
ppsspp/android/jni/Locals.mk
T
Henrik RydgårdandClaude Opus 5.5 d0e3141f43 FFmpeg: Vendor what PPSSPP uses into ext/ffmpeg, drop the submodule
The ffmpeg submodule held prebuilt libraries for every platform next to the
sources (about 1.5 GB checked out), and nothing uses those any more. Only the
needed sources are copied in, from the submodule's commit, along with every
header and template they include. The path is new, so checking out commits on
either side of this works.

It's also cut down to what PPSSPP uses: the H.264, AAC, MP3, ATRAC3 and ATRAC3+
decoders, the H.264 parser, the demuxers as before, and the FFV1 encoder, AVI
muxer and file protocol for AVI dumping. config.h takes its CONFIG_ values from
FFmpeg 3.0.2's own configure run with just those enabled. The raw H.264 demuxer
stays even though nothing opens raw H.264: probing PSMF data uses it to identify
the video stream's codec, which otherwise comes out as none.

On top of that:
- The files nothing links (configure would build them, but they're never pulled
  out of the static library, going by the GCC link map) are left out: mostly
  libavutil's crypto and hashing and the alternative DCT/IDCT/FFT versions.
- libswresample isn't built, now that nothing uses it.
- The H.264 decoder only does 8-bit video, which is all the PSP has. The SPS
  parser rejects any other bit depth, and the DSP files no longer build their 9-
  to 16-bit variants, which the linker kept because the init functions pick one
  by bit depth at run time.

That's 160 files to compile instead of 277, and 391 of FFmpeg's vendored, about
5.8 MB. The README in ext/ffmpeg has what was done, the PPSSPP patches in the
copy, how to add a component, and the tradeoffs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 22:27:54 +01:00

58 lines
2.5 KiB
Makefile

# These are definitions for LOCAL_ variables for PPSSPP.
# They are shared between ppsspp_jni (lib for Android app) and ppsspp_headless.
LOCAL_CFLAGS := -DUSE_FFMPEG -DWITH_UPNP -DUSING_GLES2 -DZ7_CRC_NUM_TABLES=1 -DMOBILE_DEVICE -O3 -fsigned-char -Wall -Wno-multichar -Wno-unused-variable -fno-strict-aliasing -D__STDC_CONSTANT_MACROS -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
# yes, it's really CPPFLAGS for C++
# deprecated-register is generated by Android default code and causes noise.
LOCAL_CPPFLAGS := -fexceptions -std=c++17 -frtti -Wno-reorder -Wno-deprecated-register -Wno-nullability-completeness
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../Common \
$(LOCAL_PATH)/../.. \
$(LOCAL_PATH)/../../ext \
$(LOCAL_PATH)/../../ext/snappy \
$(LOCAL_PATH)/../../ext/glslang \
$(LOCAL_PATH)/../../ext/miniupnp \
$(LOCAL_PATH)/../../ext/miniupnp-build \
$(LOCAL_PATH)/../../ext/libpng17 \
$(LOCAL_PATH)/../../ext/libzip \
$(LOCAL_PATH)/../../ext/OpenXR-SDK/include \
$(LOCAL_PATH)/../../ext/zstd/lib \
$(LOCAL_PATH)/../../ext/zlib \
$(LOCAL_PATH)/../../ext/ffmpeg \
$(LOCAL_PATH)/../../ext/armips \
$(LOCAL_PATH)/../../ext/armips/ext/filesystem/include \
$(LOCAL_PATH)/../../ext/armips/ext/tinyformat \
$(LOCAL_PATH)/../../ext/libchdr/deps/lzma-24.05/include \
$(LOCAL_PATH)/../../ext/libchdr/include \
$(LOCAL_PATH)/../../ext/cpu_features/include \
$(LOCAL_PATH)/../../ext/rcheevos/include \
$(LOCAL_PATH)
LOCAL_STATIC_LIBRARIES := libzip glslang-build miniupnp-build libffmpeg
# Whole, so that where it lands on the link line doesn't matter to the libraries using it.
LOCAL_WHOLE_STATIC_LIBRARIES := libzlib
LOCAL_LDLIBS := -landroid -lGLESv2 -lOpenSLES -lEGL -ldl -llog -latomic
ifneq ($(NDK_DEBUG),1)
# Prettier stack traces are nice on other platforms.
# Maybe we can switch to storing the pre-stripped builds at some point.
ifeq ($(TARGET_ARCH_ABI),x86_64)
LOCAL_LDFLAGS += -Wl,--gc-sections -Wl,--exclude-libs,ALL
endif
endif
# ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
ifeq ($(findstring armeabi-v7a,$(TARGET_ARCH_ABI)),armeabi-v7a)
LOCAL_CFLAGS := $(LOCAL_CFLAGS) -D_ARCH_32
endif
ifeq ($(TARGET_ARCH_ABI),x86_64)
LOCAL_CFLAGS := $(LOCAL_CFLAGS) -D_M_X64 -fomit-frame-pointer -mtune=atom -mfpmath=sse -mssse3 -mstackrealign
endif
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../ext/libadrenotools/include
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../ext/libadrenotools/lib/linkernsbypass
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
endif