[FFmpeg-devel] Workaround for compiling FFMPEG 1.0 for Android x86

Michael Niedermayer michaelni at gmx.at
Mon Aug 5 20:01:57 CEST 2013


On Mon, Aug 05, 2013 at 01:52:52PM +0000, Saklatvala, George wrote:
> 

>  mpegaudiodec.c          |   77 ++++++++++++++++++++++++++++++++++++++++-
>  mpegvideoenc_template.c |   90 +++++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 165 insertions(+), 2 deletions(-)
> deb0c7cd94d10da17e5a5d9197377589e21d8889  0001-Workaround-to-compile-for-Android-x86-using-NDK-r7c-.patch
> From 205dabe2a279438286e4d4113d2c1f9834a7a2c1 Mon Sep 17 00:00:00 2001
> From: George Saklatvala <george.saklatvala at hp.com>
> Date: Mon, 5 Aug 2013 13:49:04 +0100
> Subject: [PATCH] Workaround to compile for Android x86, using NDK r7c (gcc
>  4.4.3). Reduces the register requirements, thereby working
>  around issue in gcc.



> 
> ---
>  libavcodec/x86/mpegaudiodec.c          | 77 ++++++++++++++++++++++++++++-
>  libavcodec/x86/mpegvideoenc_template.c | 90 +++++++++++++++++++++++++++++++++-
>  2 files changed, 165 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/x86/mpegaudiodec.c b/libavcodec/x86/mpegaudiodec.c
> index a8b55ae..4171dd7 100644
> --- a/libavcodec/x86/mpegaudiodec.c
> +++ b/libavcodec/x86/mpegaudiodec.c
> @@ -69,6 +69,43 @@ static void apply_window(const float *buf, const float *win1,
>      float *sum1a = sum1+len;
>      float *sum2a = sum2+len;
>  
> +#ifdef __ANDROID__

if you want to add support for a compiler that is unable to build
specific pieces of code.
Detect the limitation in configure by trying to build representative
code and then put the code under appropriate ifdef

that would be for example
#ifdef HAVE_7REGS or 6REGS or whatever
...
#endif

also fallback C code already exists for all the asm code, and it
may be possible to change the existing asm constraints to allow it
to build in some cases (this would need to be bencharked)
can you explain why you add special cased asm instead of using the C
code ?

and please post the compiler flags used and the compiler errors,
also patches should be against ffmpeg git master, and once such patch
would be applied it could be back ported to 1.0

Thanks


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130805/cc34b969/attachment.asc>


More information about the ffmpeg-devel mailing list