commit 7db0bbe8746538aedcd3f6f98ae7aca2dec20894
Author: Dominik 'Rathann' Mierzejewski <dominik(a)greysector.net>
Date: Tue Mar 12 15:18:55 2024 +0100
re-enable zlib and nvdec
fix build with zlib-ng
fix building nvdec on aarch64
gpac-aarch64-nvdec.patch | 33 +++++++++++++++++++++++++++++++++
gpac-no-zmemcpy.patch | 12 ++++++++++++
gpac.spec | 21 +++++++++++++--------
3 files changed, 58 insertions(+), 8 deletions(-)
---
diff --git a/gpac-aarch64-nvdec.patch b/gpac-aarch64-nvdec.patch
new file mode 100644
index 0000000..e84c810
--- /dev/null
+++ b/gpac-aarch64-nvdec.patch
@@ -0,0 +1,33 @@
+diff -up gpac-2.2.1/src/filters/dec_nvdec_sdk.c.orig
gpac-2.2.1/src/filters/dec_nvdec_sdk.c
+--- gpac-2.2.1/src/filters/dec_nvdec_sdk.c.orig 2023-04-24 12:57:53.000000000 +0000
++++ gpac-2.2.1/src/filters/dec_nvdec_sdk.c 2024-03-12 11:42:51.690883435 +0000
+@@ -197,7 +197,7 @@ tcuvidDecodePicture *c
+ tcuvidMapVideoFrame *cuvidMapVideoFrame;
+ tcuvidUnmapVideoFrame *cuvidUnmapVideoFrame;
+
+-#if defined(WIN64) || defined(_WIN64) || defined(__x86_64) || defined(AMD64) ||
defined(_M_AMD64)
++#if defined(WIN64) || defined(_WIN64) || defined(__x86_64) || defined(AMD64) ||
defined(_M_AMD64) || defined(__aarch64__)
+ tcuvidMapVideoFrame64 *cuvidMapVideoFrame64;
+ tcuvidUnmapVideoFrame64 *cuvidUnmapVideoFrame64;
+ #endif
+diff -up gpac-2.2.1/src/filters/dec_nvdec_sdk.h.orig
gpac-2.2.1/src/filters/dec_nvdec_sdk.h
+--- gpac-2.2.1/src/filters/dec_nvdec_sdk.h.orig 2023-04-24 12:57:53.000000000 +0000
++++ gpac-2.2.1/src/filters/dec_nvdec_sdk.h 2024-03-12 11:43:53.158031385 +0000
+@@ -1821,7 +1821,7 @@ typedef void *CUDADRIVER;
+
+
+
+-#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
++#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined(__aarch64__)
+ #if (CUDA_VERSION >= 3020) && (!defined(CUDA_FORCE_API_VERSION) ||
(CUDA_FORCE_API_VERSION >= 3020))
+ #define __CUVID_DEVPTR64
+ #endif
+@@ -2526,7 +2526,7 @@ typedef CUresult CUDAAPI tcuvidMapVideoF
+ typedef CUresult CUDAAPI tcuvidUnmapVideoFrame(CUvideodecoder hDecoder, unsigned int
DevPtr);
+ #endif
+
+-#if defined(WIN64) || defined(_WIN64) || defined(__x86_64) || defined(AMD64) ||
defined(_M_AMD64)
++#if defined(WIN64) || defined(_WIN64) || defined(__x86_64) || defined(AMD64) ||
defined(_M_AMD64) || defined(__aarch64__)
+ /**
+ * \fn CUresult CUDAAPI cuvidMapVideoFrame64(CUvideodecoder hDecoder, int nPicIdx,
unsigned long long *pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS *pVPP);
+ * map a video frame
diff --git a/gpac-no-zmemcpy.patch b/gpac-no-zmemcpy.patch
new file mode 100644
index 0000000..0fa2aff
--- /dev/null
+++ b/gpac-no-zmemcpy.patch
@@ -0,0 +1,12 @@
+diff -up gpac-2.2.1/src/utils/gzio.c.orig gpac-2.2.1/src/utils/gzio.c
+--- gpac-2.2.1/src/utils/gzio.c.orig 2023-04-24 14:57:53.000000000 +0200
++++ gpac-2.2.1/src/utils/gzio.c 2024-03-12 11:40:34.486536168 +0100
+@@ -407,7 +407,7 @@ int gf_gzread(void *file, voidp buf, uns
+ uInt n = s->stream.avail_in;
+ if (n > s->stream.avail_out) n = s->stream.avail_out;
+ if (n > 0) {
+- zmemcpy(s->stream.next_out, s->stream.next_in, n);
++ memcpy(s->stream.next_out, s->stream.next_in, n);
+ next_out += n;
+ s->stream.next_out = next_out;
+ s->stream.next_in += n;
diff --git a/gpac.spec b/gpac.spec
index a958826..31b424d 100644
--- a/gpac.spec
+++ b/gpac.spec
@@ -17,7 +17,7 @@
Name: gpac
Summary: MPEG-4 multimedia framework
Version: 2.2.1
-Release: 5%{?shortcommit0:.%{date}git%{shortcommit0}}%{?dist}
+Release: 6%{?shortcommit0:.%{date}git%{shortcommit0}}%{?dist}
License: LGPLv2+
URL:
https://gpac.sourceforge.net/
Source0:
https://github.com/gpac/gpac/archive/v%{version}/gpac-%{version}.tar.gz
@@ -25,6 +25,12 @@ Source0:
https://github.com/gpac/gpac/archive/v%{version}/gpac-%{version}.ta
Patch0: gpac-doxygen_195.patch
Patch1:
https://github.com/gpac/gpac/commit/ba14e34dd7a3c4cef5a56962898e9f863dd4b...
+# zlib-ng doesn't define the zmemcpy macro anymore
+#
https://github.com/gpac/gpac/pull/2780
+Patch2: gpac-no-zmemcpy.patch
+# cuvid device pointers are 64bit on aarch64 as well
+#
https://github.com/gpac/gpac/pull/2781
+Patch3: gpac-aarch64-nvdec.patch
BuildRequires: SDL2-devel
BuildRequires: a52dec-devel
@@ -125,13 +131,7 @@ sed -i 's/dh_link/ln -s -r/' Makefile
--disable-oss-audio \
%{?_with_amr:--enable-amr} \
--enable-pic \
-%if 0%{?fedora} && 0%{?fedora} >= 40
- --use-zlib=no \
-%ifarch %{arm64}
- --disable-nvdec \
-%endif
-%endif
- --verbose
+ --verbose
#Avoid mess with setup.h
cp -p config.h include/gpac
@@ -200,6 +200,11 @@ rm %{buildroot}%{_includedir}/gpac/config.h
%changelog
+* Tue Mar 12 2024 Dominik Mierzejewski <dominik(a)greysector.net> - 2.2.1-6
+- re-enable zlib and nvdec
+- fix build with zlib-ng
+- fix building nvdec on aarch64
+
* Sat Feb 03 2024 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
2.2.1-5
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild