From patchwork Sun Mar 24 05:17:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Izen X-Patchwork-Id: 47402 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c889:b0:1a3:b6bb:3029 with SMTP id hb9csp528382pzb; Sat, 23 Mar 2024 22:18:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVcYzXUGkeeD5Y0yv9WjUDGcPt9ImSGQkqrISEelK98pJ44IQu13kuzCAlVhCe30/VzT6wVPuwRUsu1/9zixRe+HJGx+7SI0q36rg== X-Google-Smtp-Source: AGHT+IEjGGStJF/iLywgmbMruRXaDlR7Kw7jI5uqwQmN6bFbtx7xHvIaD/wPy9W6EpGpfNyBb3W3 X-Received: by 2002:a2e:8791:0:b0:2d4:25df:b8eb with SMTP id n17-20020a2e8791000000b002d425dfb8ebmr2695530lji.41.1711257484142; Sat, 23 Mar 2024 22:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711257484; cv=none; d=google.com; s=arc-20160816; b=YjbMl3Z8h/onhWt58RrkndG6T5ISFlLOHKMWY+Mzd8/fM9c57BpBleHFC68Lf4UKnm Drx/TSiOc5rDXkt9qb7aGbyJFP5UJndUEiI44z91sU7UVbNnHuQe/UWnjl7EtETsQd+X U6Dcb5CsbrsVzUY3UPKkkYMVdcDqFaUoTXHG+bQCgrD8sTquVRr2sgnnmffJf4WVjajo EQlwPmIpQmCKpaTT0qs+QJGfzBQGtEb9OYt4nkFGz1Wx3/tZkhseebFC6BvZxIvVGeYX 9ngt3ahT9A5RF+2XELQXsTqMbRJHGRr13P5ZKXcu7nOS3h9P+xPYdL9z4JkFWo+TBl4e mgTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=vCuU5G9ZQQtFo1U32anaUnX5ObjYrxPX6b3MSNB14dQ=; fh=+bdjGe20eEUjtjncwA1dnEEVYNfJL4vyhV+sIRR4l+g=; b=H33+MbHtDhPM11CFuoa8c6hIYvFjUO08TinIT+/RPSYX4K1dxWT87JnFBlF6oBUbKP y+yMefgsHQRLKNU5h9SeoBaIT/+emZGgxtqXGF3yarNVaNHJwQXcKHvX4wK/KQ5VuRWR UjQzXX0b5RhoI9ypzM+aL+ONMgSCOHmVzY0UzMIwguM4xZ8f5huWkLrZC4quhOWLJs8G EAAX1jSddZuGy8G/Lni3xhfEN+cxhHzG+ByojdPfJEH2dHqAhEFoQyCuhtDwBVMaswEs t9wB7HpU/XgiKnAFq6BZPGo4mhYeABSII+D0NysQ1g6Ciwb8uCNGVtNpk69wN9goEHJk T23g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Ljl3GCqq; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dg15-20020a0564021d0f00b0056869af6687si1292157edb.560.2024.03.23.22.18.03; Sat, 23 Mar 2024 22:18:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Ljl3GCqq; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ADF2268D3D5; Sun, 24 Mar 2024 07:17:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5D21168D244 for ; Sun, 24 Mar 2024 07:17:52 +0200 (EET) Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-6968993f9b5so393826d6.0 for ; Sat, 23 Mar 2024 22:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711257470; x=1711862270; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lAaqZltHrazanJ3F+JLp9evWUs4JeHYdJO+m87dCQ8k=; b=Ljl3GCqqzawKP2q2/Q0N4qcQPHhS5tGCEnZIOVJFRUJBenrCY2pNvpa/ksjDfg/vR8 rzb9ixbb6rPRzqtJdam2FLi2D7hyE8q6GZI2p27zRUsMZCMaYnhYlotpacK9gtdGVvV4 d1uwMcJ96/POKc8GbHhNEVMZRvqkJadB8nm+MW/qOzJRibjKOa5rQl7bbHxri7ZyCqSd 6g1z2ODyCdIJV8Vv2y6pMkfFYSPzyX5NAGz2R0JYAZhr3tfWppoVREqaRbpIXdRbfMwa NKPtYjCpSd0UBRTRgNdqRyji4f4/W3lKjAMo6TF92LtlUpoj89FAYS2b/pYqXI8a5xBw R0UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711257470; x=1711862270; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lAaqZltHrazanJ3F+JLp9evWUs4JeHYdJO+m87dCQ8k=; b=IWJxdICcogwh4dP1rDicmrk6e3TikWWrUaGYaLCRSszGrr5ntpsaVyO0+R9YQprFa5 FfnanGTvUDxJ9x90dNg19SU5VNg5y/ktBVhgSpFcwKYX4dTiPAmPxMP1Fv9JwdQEHmrp 3hWX2NOoEZKie7riJXs3Rw2WdYFvuSv/5huqcjX0QtzVx6g0y23IjPBp7vdDxZwRt4zp g9tyeNxkGQSr/gqlAKqJ1KqqxWm2zZs5bqJmC4ndMaO2/SbQkUA5F8tifERRlK2hQKdl HerdLohOUcW6B8lZziTODr3UxnrhF3XlIy1bqtZKH8lPFX9XV+yAueCn00YHJfua5qHe LALA== X-Gm-Message-State: AOJu0YzVnTLtMdhJZyeRQZJc13HQHb9bQv67NiV0D4q/x1mhXHdJz0g8 v0MwbhWp6o0EgZrp+IQiT/PBWbwXVBiAHAG0/+oFUZjkKKChVH+CNalsBTDGeiU= X-Received: by 2002:a05:620a:22d8:b0:78a:78c:4b68 with SMTP id o24-20020a05620a22d800b0078a078c4b68mr3574231qki.3.1711257470451; Sat, 23 Mar 2024 22:17:50 -0700 (PDT) Received: from gauss.local (c-68-56-149-176.hsd1.mi.comcast.net. [68.56.149.176]) by smtp.gmail.com with ESMTPSA id o6-20020a05620a22c600b0078a390fb634sm1167906qki.47.2024.03.23.22.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 22:17:50 -0700 (PDT) From: Leo Izen To: ffmpeg-devel@ffmpeg.org Date: Sun, 24 Mar 2024 01:17:41 -0400 Message-ID: <20240324051741.79725-1-leo.izen@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240323190518.1031-1-admin@shaoxia.xyz> References: <20240323190518.1031-1-admin@shaoxia.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec, avformat/ffjni: fix duplicate JNI symbols X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Leo Izen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: BF18YBaTUAyR 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. Signed-off-by: Leo Izen --- libavcodec/Makefile | 1 + libavformat/Makefile | 1 + libavformat/ffjni.c | 23 +++++++++++++++++++++++ libavformat/file.c | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 libavformat/ffjni.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 7ef2e03ca6..2446db51fd 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1068,6 +1068,7 @@ STLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o STLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o +STLIBOBJS-$(CONFIG_JNI) += ffjni.o STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o STLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o diff --git a/libavformat/Makefile b/libavformat/Makefile index 44aa485029..a89df7e9a3 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -728,6 +728,7 @@ SHLIBOBJS-$(CONFIG_ISO_MEDIA) += mpegaudiotabs.o SHLIBOBJS-$(CONFIG_FLV_MUXER) += mpeg4audio_sample_rates.o SHLIBOBJS-$(CONFIG_HLS_DEMUXER) += ac3_channel_layout_tab.o SHLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o +SHLIBOBJS-$(CONFIG_JNI) += ffjni.o SHLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER) += jpegxl_parse.o SHLIBOBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio_sample_rates.o SHLIBOBJS-$(CONFIG_MOV_DEMUXER) += ac3_channel_layout_tab.o diff --git a/libavformat/ffjni.c b/libavformat/ffjni.c new file mode 100644 index 0000000000..2b1483cf42 --- /dev/null +++ b/libavformat/ffjni.c @@ -0,0 +1,23 @@ +/* + * JNI utility functions - included stub + * + * Copyright (c) 2024 Leo Izen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavcodec/ffjni.c" diff --git a/libavformat/file.c b/libavformat/file.c index dd5819c06f..fa13ae9a6c 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -43,7 +43,7 @@ #if CONFIG_ANDROID_CONTENT_PROTOCOL #include #include "libavcodec/jni.h" -#include "libavcodec/ffjni.c" +#include "libavcodec/ffjni.h" #endif