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
1067STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o1067STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o
1068STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o1068STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o
1069STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o1069STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o
1070STLIBOBJS-$(CONFIG_JNI) += ffjni.o
1070STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o1071STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o
1071STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o1072STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o
1072STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o1073STLIBOBJS-$(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
729SHLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o729SHLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o
730SHLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o730SHLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o
731SHLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o731SHLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o
732SHLIBOBJS-$(CONFIG_JNI) += ffjni.o
732SHLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o733SHLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o
733SHLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o734SHLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o
734SHLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o735SHLIBOBJS-$(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
528 528
529#if CONFIG_ANDROID_CONTENT_PROTOCOL529#if CONFIG_ANDROID_CONTENT_PROTOCOL
530#include <jni.h>530#include <jni.h>
531#include "libavcodec/ffjni.h"
531#include "libavcodec/jni.h"532#include "libavcodec/jni.h"
532#include "libavcodec/ffjni.c"
533 533
534typedef struct JFields {534typedef struct JFields {
535 jclass uri_class;535 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