Skip to content

Commit b6a6d46

Browse files
committed
Update versions of ffmpeg and ffpyplayer recipes. Do not enable building of GPL components if not necessary. Add support for x86 build in ffmmpeg recipe
1 parent 690dd18 commit b6a6d46

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

pythonforandroid/recipes/ffmpeg/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class FFMpegRecipe(Recipe):
7-
version = '007e03348dbd8d3de3eb09022d72c734a8608144'
7+
version = 'n4.3.1'
88
# Moved to github.com instead of ffmpeg.org to improve download speed
99
url = 'https://github.com/FFmpeg/FFmpeg/archive/{version}.zip'
1010
depends = ['sdl2'] # Need this to build correct recipe order
@@ -44,6 +44,9 @@ def build_arch(self, arch):
4444
ldflags += ['-L' + build_dir]
4545

4646
if 'ffpyplayer_codecs' in self.ctx.recipe_build_order:
47+
# Enable GPL
48+
flags += ['--enable-gpl']
49+
4750
# libx264
4851
flags += ['--enable-libx264']
4952
build_dir = Recipe.get_recipe(
@@ -93,7 +96,6 @@ def build_arch(self, arch):
9396
'--enable-protocol=file,http,hls',
9497
'--enable-small',
9598
'--enable-hwaccels',
96-
'--enable-gpl',
9799
'--enable-pic',
98100
'--disable-static',
99101
'--disable-debug',
@@ -103,6 +105,10 @@ def build_arch(self, arch):
103105
if 'arm64' in arch.arch:
104106
cross_prefix = 'aarch64-linux-android-'
105107
arch_flag = 'aarch64'
108+
elif 'x86' in arch.arch:
109+
cross_prefix = 'i686-linux-android-'
110+
arch_flag = 'x86'
111+
flags += ['--disable-asm']
106112
else:
107113
cross_prefix = 'arm-linux-androideabi-'
108114
arch_flag = 'arm'
Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
--- ./configure 2019-07-21 18:36:31.000000000 +0200
2-
+++ ./configure_new 2019-10-04 12:43:41.798448200 +0200
3-
@@ -6222,7 +6222,7 @@
1+
--- ./configure 2020-10-11 19:12:16.759760904 +0200
2+
+++ ./configure.patch 2020-10-11 19:15:49.059533563 +0200
3+
@@ -6361,7 +6361,7 @@
44
enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
55
enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
66
enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
77
-enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
88
+enabled libshine && require "shine" shine/layer3.h shine_encode_buffer -lshine -lm
99
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
1010
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
11-
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
12-
@@ -6322,7 +6322,7 @@
13-
die "ERROR: OpenMAX IL headers not found"; } && enable omx
14-
enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
15-
check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
16-
- check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
17-
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
18-
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
19-
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
20-
die "ERROR: openssl not found"; }
11+
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++

pythonforandroid/recipes/ffpyplayer/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class FFPyPlayerRecipe(CythonRecipe):
7-
version = 'c99913f2317bf3840eeacf1c1c3db3b3d1f78007'
7+
version = 'v4.3.2'
88
url = 'https://github.com/matham/ffpyplayer/archive/{version}.zip'
99
depends = ['python3', 'sdl2', 'ffmpeg']
1010
opt_depends = ['openssl', 'ffpyplayer_codecs']
@@ -22,6 +22,11 @@ def get_recipe_env(self, arch, with_flags_in_cc=True):
2222
env["USE_SDL2_MIXER"] = '1'
2323
env["SDL2_MIXER_INCLUDE_DIR"] = join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer')
2424

25+
# ffmpeg recipe enables GPL components only if ffpyplayer_codecs recipe used.
26+
# Therefor we need to disable libpostproc if skipped.
27+
if 'ffpyplayer_codecs' not in self.ctx.recipe_build_order:
28+
env["CONFIG_POSTPROC"] = '0'
29+
2530
return env
2631

2732

0 commit comments

Comments
 (0)