Skip to content

Commit 4f2801d

Browse files
authored
Merge pull request #1533 from Biswa96/fix-gst-libav
ffmpeg: Enable avfilter and avformat for gst-libav
2 parents f93d49c + 729f3de commit 4f2801d

File tree

4 files changed

+84
-4
lines changed

4 files changed

+84
-4
lines changed

gvsbuild/patches/ffmpeg/build/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ configure_cmd[idx++]="--enable-shared"
1515
configure_cmd[idx++]="--disable-everything"
1616
configure_cmd[idx++]="--enable-swscale"
1717
configure_cmd[idx++]="--enable-avcodec"
18+
configure_cmd[idx++]="--enable-avfilter"
19+
configure_cmd[idx++]="--enable-avformat"
1820
configure_cmd[idx++]="--enable-hwaccel=av1_dxva2"
1921
configure_cmd[idx++]="--enable-hwaccel=h264_dxva2"
2022
configure_cmd[idx++]="--enable-hwaccel=hevc_dxva2"
@@ -37,8 +39,6 @@ configure_cmd[idx++]="--enable-hwaccel=av1_nvdec"
3739
configure_cmd[idx++]="--enable-hwaccel=h264_nvdec"
3840
configure_cmd[idx++]="--enable-hwaccel=hevc_nvdec"
3941
configure_cmd[idx++]="--disable-programs"
40-
configure_cmd[idx++]="--disable-avformat"
41-
configure_cmd[idx++]="--disable-avfilter"
4242
configure_cmd[idx++]="--disable-avdevice"
4343
configure_cmd[idx++]="--disable-swresample"
4444
configure_cmd[idx++]="--disable-postproc"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
From 7108497fda9d4536a1afade7f42266e06dca4488 Mon Sep 17 00:00:00 2001
2+
From: Mark Adler <[email protected]>
3+
Date: Thu, 13 Feb 2025 22:44:48 -0800
4+
Subject: [PATCH] Check that HAVE_UNISTD_H and HAVE_STDARG_H are not defined as
5+
0.
6+
7+
---
8+
configure | 4 ++--
9+
zconf.h | 4 ++--
10+
zconf.h.in | 4 ++--
11+
3 files changed, 6 insertions(+), 6 deletions(-)
12+
13+
diff --git a/configure b/configure
14+
index 393c23c94..1834659fd 100755
15+
--- a/configure
16+
+++ b/configure
17+
@@ -611,7 +611,7 @@ cat > $test.c <<EOF
18+
int main() { return 0; }
19+
EOF
20+
if try $CC -c $CFLAGS $test.c; then
21+
- sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
22+
+ sed < zconf.h "/^#if HAVE_UNISTD_H-0.* may be/s/ HAVE_UNISTD_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
23+
mv zconf.temp.h zconf.h
24+
echo "Checking for unistd.h... Yes." | tee -a configure.log
25+
else
26+
@@ -626,7 +626,7 @@ cat > $test.c <<EOF
27+
int main() { return 0; }
28+
EOF
29+
if try $CC -c $CFLAGS $test.c; then
30+
- sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
31+
+ sed < zconf.h "/^#if HAVE_STDARG_H-0.* may be/s/ HAVE_STDARG_H-0\(.*\) may be/ 1\1 was/" > zconf.temp.h
32+
mv zconf.temp.h zconf.h
33+
echo "Checking for stdarg.h... Yes." | tee -a configure.log
34+
else
35+
diff --git a/zconf.h b/zconf.h
36+
index d6c159a1e..bc3ef079b 100644
37+
--- a/zconf.h
38+
+++ b/zconf.h
39+
@@ -436,11 +436,11 @@ typedef uLong FAR uLongf;
40+
typedef unsigned long z_crc_t;
41+
#endif
42+
43+
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
44+
+#if HAVE_UNISTD_H-0 /* may be set to #if 1 by ./configure */
45+
# define Z_HAVE_UNISTD_H
46+
#endif
47+
48+
-#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
49+
+#if HAVE_STDARG_H-0 /* may be set to #if 1 by ./configure */
50+
# define Z_HAVE_STDARG_H
51+
#endif
52+
53+
diff --git a/zconf.h.in b/zconf.h.in
54+
index d6c159a1e..bc3ef079b 100644
55+
--- a/zconf.h.in
56+
+++ b/zconf.h.in
57+
@@ -436,11 +436,11 @@ typedef uLong FAR uLongf;
58+
typedef unsigned long z_crc_t;
59+
#endif
60+
61+
-#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
62+
+#if HAVE_UNISTD_H-0 /* may be set to #if 1 by ./configure */
63+
# define Z_HAVE_UNISTD_H
64+
#endif
65+
66+
-#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
67+
+#if HAVE_STDARG_H-0 /* may be set to #if 1 by ./configure */
68+
# define Z_HAVE_STDARG_H
69+
#endif
70+

gvsbuild/projects/ffmpeg.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def build(self):
6161

6262
if configuration in ["debug-optimized", "debug"]:
6363
self.install(r".\libavcodec\avcodec-60.pdb bin")
64+
self.install(r".\libavfilter\avfilter-10.pdb bin")
65+
self.install(r".\libavformat\avformat-61.pdb bin")
6466
self.install(r".\libavutil\avutil-58.pdb bin")
6567
self.install(r".\libswscale\libswscale-7.pdb bin")
6668

@@ -69,7 +71,13 @@ def build(self):
6971
self.install(r".\COPYING.GPLv2 " r"share\doc\ffmpeg")
7072

7173
def post_install(self):
72-
for lib in ["avcodec.lib", "avutil.lib", "swscale.lib"]:
74+
for lib in [
75+
"avcodec.lib",
76+
"avfilter.lib",
77+
"avformat.lib",
78+
"avutil.lib",
79+
"swscale.lib",
80+
]:
7381
self.builder.exec_msys(
7482
["mv", lib, "../lib/"],
7583
working_dir=os.path.join(self.builder.gtk_dir, "bin"),

gvsbuild/projects/zlib.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def __init__(self):
3939
version="1.3.1",
4040
archive_url="https://github.com/madler/zlib/releases/download/v{version}/zlib-{version}.tar.xz",
4141
hash="38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32",
42-
patches=[],
42+
patches=[
43+
"001-fix-ffmpeg-build-failure.patch",
44+
],
4345
)
4446

4547
def build(self):

0 commit comments

Comments
 (0)