History

avcodec, avformat/ffjni: fix duplicate JNI symbols

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.

Leo Izen committed 2 years ago

Commit 7c338f41 parent bf3b7414 files · +26 −1Browse files

Unified · Split

4 files
  1. libavcodec/Makefile +1 −0
  2. libavformat/Makefile +1 −0
  3. libavformat/ffjni.c +23 −0
  4. libavformat/file.c +1 −1
libavcodec/Makefile+1−0
@@ -1067,6 +1067,7 @@ STLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o · 1066 unmodified lines
10671067 STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o
10681068 STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o
10691069 STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o
1070+STLIBOBJS-$(CONFIG_JNI) += ffjni.o
10701071 STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o
10711072 STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o
10721073 STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o
libavformat/Makefile+1−0
@@ -729,6 +729,7 @@ SHLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o · 728 unmodified lines
729729 SHLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o
730730 SHLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o
731731 SHLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o
732+SHLIBOBJS-$(CONFIG_JNI) += ffjni.o
732733 SHLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o
733734 SHLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o
734735 SHLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o
libavformat/ffjni.c+23−0
@@ -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"
libavformat/file.c+1−1
@@ -528,8 +528,8 @@ const URLProtocol ff_fd_protocol = { · 527 unmodified lines
528528
529529 #if CONFIG_ANDROID_CONTENT_PROTOCOL
530530 #include <jni.h>
531+#include "libavcodec/ffjni.h"
531532 #include "libavcodec/jni.h"
532−#include "libavcodec/ffjni.c"
533533
534534 typedef struct JFields {
535535 jclass uri_class;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t