Skip to content

Commit e2851d9

Browse files
misl6AndreMiras
authored andcommitted
Fixes ffmpeg build on ndk 19 (kivy#1997)
* ffmpeg builds w/ libx264 and openssl via ndk 19 fixes kivy#1996 * target a specific hash * update travis_wait to 30
1 parent 3938445 commit e2851d9

File tree

4 files changed

+41
-49
lines changed

4 files changed

+41
-49
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ jobs:
6565
script: make docker/run/make/testapps/python2/armeabi-v7a
6666
- <<: *testapps
6767
name: Rebuild updated recipes
68-
script: make docker/run/make/rebuild_updated_recipes
68+
script: travis_wait 30 make docker/run/make/rebuild_updated_recipes

pythonforandroid/recipes/ffmpeg/__init__.py

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

55

66
class FFMpegRecipe(Recipe):
7-
version = 'n3.4.5'
7+
version = '007e03348dbd8d3de3eb09022d72c734a8608144'
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
@@ -37,22 +37,31 @@ def build_arch(self, arch):
3737
'--enable-nonfree',
3838
'--enable-protocol=https,tls_openssl',
3939
]
40-
build_dir = Recipe.get_recipe('openssl', self.ctx).get_build_dir(arch.arch)
41-
cflags += ['-I' + build_dir + '/include/']
40+
build_dir = Recipe.get_recipe(
41+
'openssl', self.ctx).get_build_dir(arch.arch)
42+
cflags += ['-I' + build_dir + '/include/',
43+
'-DOPENSSL_API_COMPAT=0x10002000L']
4244
ldflags += ['-L' + build_dir]
4345

4446
if 'ffpyplayer_codecs' in self.ctx.recipe_build_order:
4547
# libx264
4648
flags += ['--enable-libx264']
47-
build_dir = Recipe.get_recipe('libx264', self.ctx).get_build_dir(arch.arch)
49+
build_dir = Recipe.get_recipe(
50+
'libx264', self.ctx).get_build_dir(arch.arch)
4851
cflags += ['-I' + build_dir + '/include/']
4952
ldflags += ['-lx264', '-L' + build_dir + '/lib/']
5053

54+
"""
55+
WARNING: DISABLED during migration to ndk19, cause We're
56+
getting a runtime error for a missing symbol.
57+
5158
# libshine
5259
flags += ['--enable-libshine']
5360
build_dir = Recipe.get_recipe('libshine', self.ctx).get_build_dir(arch.arch)
5461
cflags += ['-I' + build_dir + '/include/']
5562
ldflags += ['-lshine', '-L' + build_dir + '/lib/']
63+
ldflags += ['-lm']
64+
"""
5665

5766
# Enable all codecs:
5867
flags += [
@@ -79,22 +88,20 @@ def build_arch(self, arch):
7988

8089
# disable binaries / doc
8190
flags += [
82-
'--disable-ffmpeg',
83-
'--disable-ffplay',
84-
'--disable-ffprobe',
85-
'--disable-ffserver',
91+
'--disable-programs',
8692
'--disable-doc',
8793
]
8894

8995
# other flags:
9096
flags += [
9197
'--enable-filter=aresample,resample,crop,adelay,volume,scale',
92-
'--enable-protocol=file,http',
98+
'--enable-protocol=file,http,hls',
9399
'--enable-small',
94100
'--enable-hwaccels',
95101
'--enable-gpl',
96102
'--enable-pic',
97103
'--disable-static',
104+
'--disable-debug',
98105
'--enable-shared',
99106
]
100107

@@ -108,9 +115,13 @@ def build_arch(self, arch):
108115
# android:
109116
flags += [
110117
'--target-os=android',
111-
'--cross-prefix={}'.format(cross_prefix),
118+
'--enable-cross-compile',
119+
'--cross-prefix={}-'.format(arch.target),
112120
'--arch={}'.format(arch_flag),
113-
'--sysroot=' + self.ctx.ndk_platform,
121+
'--strip={}strip'.format(cross_prefix),
122+
'--sysroot={}'.format(join(self.ctx.ndk_dir, 'toolchains',
123+
'llvm', 'prebuilt', 'linux-x86_64',
124+
'sysroot')),
114125
'--enable-neon',
115126
'--prefix={}'.format(realpath('.')),
116127
]
Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,20 @@
1-
--- ./configure.orig 2017-12-11 00:35:18.000000000 +0300
2-
+++ ./configure 2017-12-19 09:47:54.104914600 +0300
3-
@@ -4841,9 +4841,6 @@
4-
add_cflags -std=c11 ||
5-
check_cflags -std=c99
6-
7-
-check_cppflags -D_FILE_OFFSET_BITS=64
8-
-check_cppflags -D_LARGEFILE_SOURCE
9-
-
10-
add_host_cppflags -D_ISOC99_SOURCE
11-
check_host_cflags -std=c99
12-
check_host_cflags -Wall
13-
@@ -5979,7 +5976,7 @@
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 @@
144
enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
155
enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
16-
enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new
6+
enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
177
-enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
18-
+enabled libshine && require "shine" shine/layer3.h shine_encode_buffer -lshine
19-
enabled libsmbclient && { use_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
20-
require smbclient libsmbclient.h smbc_init -lsmbclient; }
21-
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy
22-
23-
diff -Naur ffmpeg/configure ffmpeg-1/configure
24-
--- ffmpeg/configure 2019-01-11 09:30:02.824961600 +0100
25-
+++ ffmpeg-1/configure 2019-01-11 09:29:54.976149600 +0100
26-
@@ -6068,11 +6068,11 @@
27-
{ ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } ||
28-
die "ERROR: OpenMAX IL headers not found"; }
29-
enabled omx && require_header OMX_Core.h
30-
-enabled openssl && { use_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
31-
+enabled openssl && { use_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
32-
use_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
33-
- check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
34-
- check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl32 -leay32 ||
35-
- check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto -lws2_32 -lgdi32 ||
36-
+ check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
37-
+ check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
38-
+ check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
8+
+enabled libshine && require "shine" shine/layer3.h shine_encode_buffer -lshine -lm
9+
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
10+
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 ||
3920
die "ERROR: openssl not found"; }
40-
enabled rkmpp && { { require_pkg_config rockchip_mpp rockchip_mpp rockchip/rk_mpi.h mpp_create ||

pythonforandroid/recipes/ffpyplayer_codecs/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33

44
class FFPyPlayerCodecsRecipe(Recipe):
5-
depends = ['libshine', 'libx264']
5+
depends = ['libx264']
6+
# disabled libshine due a missing symbol error (see ffmpeg recipe)
67

78
def build_arch(self, arch):
89
pass

0 commit comments

Comments
 (0)