Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: copypaste <copypaste@kittens.ph>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] Fix broken build on Android due to broken asm-generic/termbits.h include
Date: Fri, 24 Feb 2023 09:55:03 -0500
Message-ID: <85d9a1fe-05a7-4565-b7c4-55bb7cbd1f76@edison> (raw)
In-Reply-To: <CA+anqdx1bOWmP=8TqHnGTnLO1BXqAQ99BhDH_i1VV3jYxxaYJA@mail.gmail.com> <7bc69084-d980-4a93-9442-27e4a2ec4284@edison>

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

  Here's my attempt to do just that. :-)  

 
Compiled fine with:
 

 
configuration: --prefix=/data/data/com.termux/files/usr/local --enable-indev=alsa --enable-indev=xcbgrab --enable-libfreetype --enable-libfontconfig --cc=clang --cxx=clang++ --disable-libxcb-shm --enable-vulkan --enable-opencl --enable-opengl --enable-libass --enable-libopus --enable-libfribidi --enable-librsvg --disable-stripping --enable-logging --enable-debug --logfile=/dev/tty --enable-nonfree --enable-jni --enable-gpl --enable-version3 --host-os=android --target-os=android --enable-mediacodec
 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Prevent-collisions-between-Android-s-asm-generic-ter.patch --]
[-- Type: text/x-diff, Size: 2511 bytes --]

From 44d7cfe5d10b367b289549d90fabb3b985acb128 Mon Sep 17 00:00:00 2001
From: Fredrick Brennan <copypaste@kittens.ph>
Date: Fri, 24 Feb 2023 09:51:16 -0500
Subject: [PATCH] Prevent collisions between Android's asm-generic/termbits.h
 and ffmpeg

---
 libavcodec/aaccoder.c |  5 +++++
 libavcodec/faandct.c  | 15 +++++++++++++++
 libavcodec/hevcdec.h  |  9 +++++++++
 libavcodec/opus_pvq.h |  4 ++++
 4 files changed, 33 insertions(+)

diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 6291c16123..de51fa80fb 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -52,6 +52,11 @@
 
 #include "libavcodec/aaccoder_twoloop.h"
 
+#ifdef __ANDROID__
+#undef B0
+#undef B1
+#endif
+
 /* Parameter of f(x) = a*(lambda/100), defines the maximum fourier spread
  * beyond which no PNS is used (since the SFBs contain tone rather than noise) */
 #define NOISE_SPREAD_THRESHOLD 0.9f
diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c
index 38c392bbae..923fa9beda 100644
--- a/libavcodec/faandct.c
+++ b/libavcodec/faandct.c
@@ -37,6 +37,21 @@ for this approach). Unfortunately, long double is not always available correctly
 e.g ppc has issues.
 TODO: add L suffixes when ppc and toolchains sort out their stuff.
 */
+#ifdef __ANDROID__
+#undef B0
+#undef B1
+#undef B2
+#undef B3
+#undef B4
+#undef B5
+#undef B6
+#undef B7
+#undef A1
+#undef A2
+#undef A3
+#undef A4
+#undef A5
+#endif
 #define B0 1.000000000000000000000000000000000000
 #define B1 0.720959822006947913789091890943021267 // (cos(pi*1/16)sqrt(2))^-1
 #define B2 0.765366864730179543456919968060797734 // (cos(pi*2/16)sqrt(2))^-1
diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h
index 9d3f4adbb3..4b500350c0 100644
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@ -57,6 +57,15 @@
 #define L0 0
 #define L1 1
 
+#ifdef __ANDROID__
+#undef A0
+#undef A1
+#undef A2
+#undef B0
+#undef B1
+#undef B2
+#endif
+
 #define EPEL_EXTRA_BEFORE 1
 #define EPEL_EXTRA_AFTER  2
 #define EPEL_EXTRA        3
diff --git a/libavcodec/opus_pvq.h b/libavcodec/opus_pvq.h
index b71bc49034..91c59f2812 100644
--- a/libavcodec/opus_pvq.h
+++ b/libavcodec/opus_pvq.h
@@ -27,6 +27,10 @@
 
 #include "opus_celt.h"
 
+#ifdef __ANDROID__
+#undef B0
+#endif
+
 #define QUANT_FN(name) uint32_t (name)(struct CeltPVQ *pvq, CeltFrame *f,            \
                                        OpusRangeCoder *rc, const int band, float *X, \
                                        float *Y, int N, int b, uint32_t blocks,      \
-- 
2.39.2


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      parent reply	other threads:[~2023-02-24 14:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  9:12 copypaste
2023-02-23 13:45 ` Anton Khirnov
2023-02-23 14:37 ` copypaste
2023-02-23 14:46   ` copypaste
2023-02-23 15:01   ` Hendrik Leppkes
2023-02-27 13:44     ` "zhilizhao(赵志立)"
2023-02-24 14:55   ` copypaste [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85d9a1fe-05a7-4565-b7c4-55bb7cbd1f76@edison \
    --to=copypaste@kittens.ph \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git