Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg: Enable avfilter and avformat for gst-libav #1533

Merged
merged 3 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gvsbuild/patches/ffmpeg/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ configure_cmd[idx++]="--enable-shared"
configure_cmd[idx++]="--disable-everything"
configure_cmd[idx++]="--enable-swscale"
configure_cmd[idx++]="--enable-avcodec"
configure_cmd[idx++]="--enable-avfilter"
configure_cmd[idx++]="--enable-avformat"
configure_cmd[idx++]="--enable-hwaccel=av1_dxva2"
configure_cmd[idx++]="--enable-hwaccel=h264_dxva2"
configure_cmd[idx++]="--enable-hwaccel=hevc_dxva2"
Expand All @@ -37,8 +39,6 @@ configure_cmd[idx++]="--enable-hwaccel=av1_nvdec"
configure_cmd[idx++]="--enable-hwaccel=h264_nvdec"
configure_cmd[idx++]="--enable-hwaccel=hevc_nvdec"
configure_cmd[idx++]="--disable-programs"
configure_cmd[idx++]="--disable-avformat"
configure_cmd[idx++]="--disable-avfilter"
configure_cmd[idx++]="--disable-avdevice"
configure_cmd[idx++]="--disable-swresample"
configure_cmd[idx++]="--disable-postproc"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From https://github.com/microsoft/vcpkg/blob/master/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
Commit https://github.com/microsoft/vcpkg/commit/272269583c80a4ba626d405e79a88a2ddd6d950d

--- a/zconf.h
+++ b/zconf.h
@@ -434,11 +434,19 @@
#endif

#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
-# define Z_HAVE_UNISTD_H
+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1
+# define Z_HAVE_UNISTD_H
+# elif HAVE_UNISTD_H != 0
+# define Z_HAVE_UNISTD_H
+# endif
#endif

#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
-# define Z_HAVE_STDARG_H
+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1
+# define Z_HAVE_STDARG_H
+# elif HAVE_STDARG_H != 0
+# define Z_HAVE_STDARG_H
+# endif
#endif

#ifdef STDC
10 changes: 9 additions & 1 deletion gvsbuild/projects/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def build(self):

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

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

def post_install(self):
for lib in ["avcodec.lib", "avutil.lib", "swscale.lib"]:
for lib in [
"avcodec.lib",
"avfilter.lib",
"avformat.lib",
"avutil.lib",
"swscale.lib",
]:
self.builder.exec_msys(
["mv", lib, "../lib/"],
working_dir=os.path.join(self.builder.gtk_dir, "bin"),
Expand Down
4 changes: 3 additions & 1 deletion gvsbuild/projects/zlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def __init__(self):
version="1.3.1",
archive_url="https://github.com/madler/zlib/releases/download/v{version}/zlib-{version}.tar.xz",
hash="38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32",
patches=[],
patches=[
"0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch",
],
)

def build(self):
Expand Down