Skip to content

Commit f079b36

Browse files
authored
Merge pull request kivy#3302 from kivy/pyav
`pyav`: update to `17.0.0`
2 parents 4d80da2 + a184a16 commit f079b36

5 files changed

Lines changed: 60 additions & 41 deletions

File tree

pythonforandroid/recipes/av/__init__.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
from pythonforandroid.toolchain import Recipe
2-
from pythonforandroid.recipe import CythonRecipe
2+
from pythonforandroid.recipe import PyProjectRecipe
33

44

5-
class PyAVRecipe(CythonRecipe):
5+
class PyAVRecipe(PyProjectRecipe):
66

77
name = "av"
8-
version = "13.1.0"
8+
version = "17.0.0"
99
url = "https://github.com/PyAV-Org/PyAV/archive/v{version}.zip"
10-
11-
depends = ["python3", "cython", "ffmpeg", "av_codecs"]
12-
opt_depends = ["openssl"]
13-
patches = ['patches/compilation_syntax_errors.patch']
10+
patches = ["libs.patch"]
11+
depends = ["python3", "ffmpeg", "av_codecs", "openssl"]
12+
hostpython_prerequisites = ["cython>=3.1.0"]
1413

1514
def get_recipe_env(self, arch, with_flags_in_cc=True):
1615
env = super().get_recipe_env(arch)
17-
18-
build_dir = Recipe.get_recipe("ffmpeg", self.ctx).get_build_dir(
19-
arch.arch
20-
)
21-
self.setup_extra_args = ["--ffmpeg-dir={}".format(build_dir)]
22-
16+
build_dir = Recipe.get_recipe("ffmpeg", self.ctx).get_build_dir(arch.arch)
17+
env["CFLAGS"] += f" -I{build_dir}"
18+
self.extra_build_args += ["--config-setting=--ffmpeg-dir={}".format(build_dir)]
2319
return env
2420

2521

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff '--color=auto' -uNr PyAV-17.0.0/setup.py PyAV-17.0.0.mod/setup.py
2+
--- PyAV-17.0.0/setup.py 2026-03-14 19:42:41.000000000 +0530
3+
+++ PyAV-17.0.0.mod/setup.py 2026-05-22 08:21:47.438004827 +0530
4+
@@ -79,20 +79,21 @@
5+
"""
6+
Get distutils-compatible extension arguments using pkg-config.
7+
"""
8+
- pkg_config = os.environ.get("PKG_CONFIG", "pkg-config")
9+
- try:
10+
- raw_cflags = subprocess.check_output(
11+
- [pkg_config, "--cflags", "--libs"]
12+
- + ["lib" + name for name in FFMPEG_LIBRARIES]
13+
- )
14+
- except FileNotFoundError:
15+
- print(f"{pkg_config} is required for building PyAV")
16+
- exit(1)
17+
- except subprocess.CalledProcessError:
18+
- print(f"{pkg_config} could not find libraries {FFMPEG_LIBRARIES}")
19+
- exit(1)
20+
+ # pkg_config = os.environ.get("PKG_CONFIG", "pkg-config")
21+
+ # try:
22+
+ # raw_cflags = subprocess.check_output(
23+
+ # [pkg_config, "--cflags", "--libs"]
24+
+ # + ["lib" + name for name in FFMPEG_LIBRARIES]
25+
+ # )
26+
+ # except FileNotFoundError:
27+
+ # print(f"{pkg_config} is required for building PyAV")
28+
+ # exit(1)
29+
+ # except subprocess.CalledProcessError:
30+
+ # print(f"{pkg_config} could not find libraries {FFMPEG_LIBRARIES}")
31+
+ # exit(1)
32+
33+
- known, unknown = parse_cflags(raw_cflags.decode("utf-8"))
34+
+ raw_cflags = "-lavdevice -lavfilter -lavformat -lavcodec -lswscale -lswresample -lavutil"
35+
+ known, unknown = parse_cflags(raw_cflags)
36+
if unknown:
37+
print("pkg-config returned flags we don't understand: {}".format(unknown))
38+
if "-pthread" in unknown:

pythonforandroid/recipes/av/patches/compilation_syntax_errors.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

pythonforandroid/recipes/libshine/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class LibShineRecipe(Recipe):
1010
version = 'c72aba9031bde18a0995e7c01c9b53f2e08a0e46'
1111
url = 'https://github.com/toots/shine/archive/{version}.zip'
12-
12+
patches = ["fixbuild.patch"]
1313
built_libraries = {'libshine.so': 'lib'}
1414

1515
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff '--color=auto' -uNr shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46/src/lib/l3mdct.h shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46.mod/src/lib/l3mdct.h
2+
--- shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46/src/lib/l3mdct.h 2017-08-01 19:14:17.000000000 +0530
3+
+++ shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46.mod/src/lib/l3mdct.h 2026-05-22 08:30:59.625697302 +0530
4+
@@ -1,7 +1,7 @@
5+
#ifndef shine_MDCT_H
6+
#define shine_MDCT_H
7+
8+
-void shine_mdct_initialise();
9+
+void shine_mdct_initialise(shine_global_config *config);
10+
void shine_mdct_sub(shine_global_config *config, int stride);
11+
12+
#endif

0 commit comments

Comments
 (0)