Use SHLIBOBJS and STLIBOBJS in the Makefiles for avcodec and avformat, and add a stub ffjni.c to libavformat, which allows the symbols to be duplicated for shared builds but not static builds.
Unified · Split
| @@ -1067,6 +1067,7 @@ STLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o · 1066 unmodified lines | ||
| 1067 | 1067 | STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o |
| 1068 | 1068 | STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o |
| 1069 | 1069 | STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o |
| 1070 | +STLIBOBJS-$(CONFIG_JNI) += ffjni.o | |
| 1070 | 1071 | STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o |
| 1071 | 1072 | STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o |
| 1072 | 1073 | STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o |
| @@ -729,6 +729,7 @@ SHLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o · 728 unmodified lines | ||
| 729 | 729 | SHLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o |
| 730 | 730 | SHLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o |
| 731 | 731 | SHLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o |
| 732 | +SHLIBOBJS-$(CONFIG_JNI) += ffjni.o | |
| 732 | 733 | SHLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o |
| 733 | 734 | SHLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o |
| 734 | 735 | SHLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o |
| @@ -0,0 +1,23 @@ | ||
| 1 | +/* | |
| 2 | + * JNI utility functions - included stub | |
| 3 | + * | |
| 4 | + * Copyright (c) 2024 Leo Izen <leo.izen@gmail.com> | |
| 5 | + * | |
| 6 | + * This file is part of FFmpeg. | |
| 7 | + * | |
| 8 | + * FFmpeg is free software; you can redistribute it and/or | |
| 9 | + * modify it under the terms of the GNU Lesser General Public | |
| 10 | + * License as published by the Free Software Foundation; either | |
| 11 | + * version 2.1 of the License, or (at your option) any later version. | |
| 12 | + * | |
| 13 | + * FFmpeg is distributed in the hope that it will be useful, | |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 16 | + * Lesser General Public License for more details. | |
| 17 | + * | |
| 18 | + * You should have received a copy of the GNU Lesser General Public | |
| 19 | + * License along with FFmpeg; if not, write to the Free Software | |
| 20 | + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 21 | + */ | |
| 22 | + | |
| 23 | +#include "libavcodec/ffjni.c" | |
| @@ -528,8 +528,8 @@ const URLProtocol ff_fd_protocol = { · 527 unmodified lines | ||
| 528 | 528 | |
| 529 | 529 | #if CONFIG_ANDROID_CONTENT_PROTOCOL |
| 530 | 530 | #include <jni.h> |
| 531 | +#include "libavcodec/ffjni.h" | |
| 531 | 532 | #include "libavcodec/jni.h" |
| 532 | −#include "libavcodec/ffjni.c" | |
| 533 | 533 | |
| 534 | 534 | typedef struct JFields { |
| 535 | 535 | jclass uri_class; |