Skip to content

Commit cc8d56e

Browse files
Seifert69claude
andcommitted
fix(build/apple): stub resman resources + link zlib — U23/U25 for iOS
Mirror of U23 for the iOS/Apple wrapper, plus zlib linkage. iOS run arthenica#44 (build 26059781838) failed at the wrapper link with the same 4 ff_graph_* undefined symbols Android hit (U23), plus inflate/inflateEnd/inflateInit2_ — zlib symbols that resman.c calls to decompress the embedded gzipped graph.css/graph.html resources. U23 (iOS): copy ffmpegkit_resources.c into apple/src/ and add to libffmpegkit_la_SOURCES. Same empty-stub strategy as Android. U25: add -lz to FFMPEG_FRAMEWORKS in apple/configure.ac so the wrapper links against the system zlib. resman.c's inflate calls are reachable from the build-time linker even though the empty stub data means they're never actually invoked at runtime. iOS doesn't need binder.c (no CONFIG_MEDIACODEC; iOS uses VideoToolbox). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0dd16d7 commit cc8d56e

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

apple/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ AM_PROG_AR
2424
AC_PROG_OBJC
2525
CFLAGS="$cflags_bckup"
2626

27-
FFMPEG_FRAMEWORKS="-framework libavcodec -framework libavfilter -framework libavformat -framework libavutil -framework libswscale -framework libswresample"
27+
FFMPEG_FRAMEWORKS="-framework libavcodec -framework libavfilter -framework libavformat -framework libavutil -framework libswscale -framework libswresample -lz"
2828
AC_SUBST(FFMPEG_FRAMEWORKS)
2929

3030
LT_INIT

apple/src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ libffmpegkit_la_SOURCES = \
2121
Statistics.m \
2222
StreamInformation.m \
2323
ffmpegkit_exception.m \
24+
ffmpegkit_resources.c \
2425
fftools_cmdutils.c \
2526
fftools_ffmpeg.c \
2627
fftools_ffmpeg_dec.c \

apple/src/ffmpegkit_resources.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Homebase ffmpeg-kit — empty resource stubs for n8's fftools/resources/resman.c.
3+
*
4+
* FFmpeg 8 added an embedded-resources mechanism for ffprobe's mermaid
5+
* graph rendering (`-print_graphs`, `-print_graphs_format mermaid`). The
6+
* raw `graph.html` and `graph.css` files in `fftools/resources/` get
7+
* gzipped and embedded into `ff_graph_html_data` / `ff_graph_css_data`
8+
* via FFmpeg's resources Makefile (bin2c-style).
9+
*
10+
* Our wrapper build uses ndk-build, not FFmpeg's make pipeline, so the
11+
* resource .o files aren't produced. resman.c references the externs and
12+
* the wrapper link fails.
13+
*
14+
* chat-kmp never invokes `-print_graphs`, so the resource bytes are
15+
* unused at runtime. We define empty stubs so the link succeeds. If a
16+
* future consumer needs the mermaid output, replace these with the real
17+
* gzipped resource bytes (or bring FFmpeg's resources Makefile pipeline
18+
* into the wrapper build).
19+
*/
20+
21+
#include <stdint.h>
22+
23+
const unsigned char ff_graph_html_data[] = { 0 };
24+
const unsigned int ff_graph_html_len = 0;
25+
const unsigned char ff_graph_css_data[] = { 0 };
26+
const unsigned int ff_graph_css_len = 0;

0 commit comments

Comments
 (0)