Skip to content

Commit 9bfa3eb

Browse files
authored
Merge pull request #3065 from DexerBR/bump_recipe_versions
Bump `FFMpegRecipe` and `PyAVRecipe` versions
2 parents 2a4dd96 + c4b3314 commit 9bfa3eb

File tree

4 files changed

+53
-13
lines changed

4 files changed

+53
-13
lines changed

pythonforandroid/recipes/av/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
class PyAVRecipe(CythonRecipe):
66

77
name = "av"
8-
version = "10.0.0"
8+
version = "13.1.0"
99
url = "https://github.com/PyAV-Org/PyAV/archive/v{version}.zip"
1010

1111
depends = ["python3", "cython", "ffmpeg", "av_codecs"]
1212
opt_depends = ["openssl"]
13+
patches = ['patches/compilation_syntax_errors.patch']
1314

1415
def get_recipe_env(self, arch, with_flags_in_cc=True):
1516
env = super().get_recipe_env(arch)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git a/av/container/streams.pyx b/av/container/streams.pyx
2+
index 17e4992..502ac5a 100644
3+
--- a/av/container/streams.pyx
4+
+++ b/av/container/streams.pyx
5+
@@ -144,7 +144,7 @@ cdef class StreamContainer:
6+
7+
return stream_index
8+
9+
- def best(self, str type, /, Stream related = None):
10+
+ def best(self, str type, Stream related=None):
11+
"""best(type: Literal["video", "audio", "subtitle", "attachment", "data"], /, related: Stream | None)
12+
Finds the "best" stream in the file. Wraps :ffmpeg:`av_find_best_stream`. Example::
13+
14+
diff --git a/av/filter/context.pyx b/av/filter/context.pyx
15+
index b820d3d..8908b56 100644
16+
--- a/av/filter/context.pyx
17+
+++ b/av/filter/context.pyx
18+
@@ -77,7 +77,8 @@ cdef class FilterContext:
19+
20+
@property
21+
def graph(self):
22+
- if (graph := self._graph()):
23+
+ graph = self._graph()
24+
+ if graph:
25+
return graph
26+
else:
27+
raise RuntimeError("graph is unallocated")

pythonforandroid/recipes/ffmpeg/__init__.py

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

55

66
class FFMpegRecipe(Recipe):
7-
version = 'n4.3.1'
7+
version = 'n6.1.2'
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
11-
opts_depends = ['openssl', 'ffpyplayer_codecs']
11+
opts_depends = ['openssl', 'ffpyplayer_codecs', 'av_codecs']
1212
patches = ['patches/configure.patch']
1313

1414
def should_build(self, arch):
1515
build_dir = self.get_build_dir(arch.arch)
1616
return not exists(join(build_dir, 'lib', 'libavcodec.so'))
1717

18-
def prebuild_arch(self, arch):
19-
self.apply_patches(arch)
20-
2118
def get_recipe_env(self, arch):
2219
env = super().get_recipe_env(arch)
2320
env['NDK'] = self.ctx.ndk_dir
@@ -43,7 +40,9 @@ def build_arch(self, arch):
4340
'-DOPENSSL_API_COMPAT=0x10002000L']
4441
ldflags += ['-L' + build_dir]
4542

46-
if 'ffpyplayer_codecs' in self.ctx.recipe_build_order:
43+
codecs_opts = {"ffpyplayer_codecs", "av_codecs"}
44+
if codecs_opts.intersection(self.ctx.recipe_build_order):
45+
4746
# Enable GPL
4847
flags += ['--enable-gpl']
4948

@@ -52,7 +51,9 @@ def build_arch(self, arch):
5251
build_dir = Recipe.get_recipe(
5352
'libx264', self.ctx).get_build_dir(arch.arch)
5453
cflags += ['-I' + build_dir + '/include/']
55-
ldflags += ['-lx264', '-L' + build_dir + '/lib/']
54+
# Newer versions of FFmpeg prioritize the dynamic library and ignore
55+
# the static one, unless the static library path is explicitly set.
56+
ldflags += [build_dir + '/lib/' + 'libx264.a']
5657

5758
# libshine
5859
flags += ['--enable-libshine']
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
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 @@
4-
enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
1+
diff --git a/configure b/configure
2+
index 5af693c954..d1d0a4f0a2 100755
3+
--- a/configure
4+
+++ b/configure
5+
@@ -6800,7 +6800,7 @@ enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/
56
enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
67
enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
8+
enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
79
-enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
810
+enabled libshine && require "shine" shine/layer3.h shine_encode_buffer -lshine -lm
911
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
1012
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
11-
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
13+
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
14+
@@ -6850,7 +6850,7 @@ enabled libvpx && {
15+
enabled libwebp && {
16+
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
17+
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
18+
-enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
19+
+enabled libx264 && require "x264" "stdint.h x264.h" x264_encoder_encode &&
20+
require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && {
21+
[ "$toolchain" != "msvc" ] ||
22+
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&

0 commit comments

Comments
 (0)