ffmpeg_4: fix build error on darwin

See https://trac.ffmpeg.org/ticket/9242
This commit is contained in:
Zane van Iperen 2021-05-16 08:05:03 +10:00
parent f1b78f8618
commit 8f64c5d9fc
No known key found for this signature in database
GPG key ID: 68616B2D8AC4DCC5
2 changed files with 38 additions and 0 deletions

View file

@ -9,4 +9,7 @@ callPackage ./generic.nix (rec {
branch = "4.4";
sha256 = "03kxc29y8190k4y8s8qdpsghlbpmchv1m8iqygq2qn0vfm4ka2a2";
darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ];
/* Work around https://trac.ffmpeg.org/ticket/9242 */
patches = [ ./v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch ];
} // args)

View file

@ -0,0 +1,35 @@
From 5b562aaddbc6e7a94a079c2e88230b205a7f4d73 Mon Sep 17 00:00:00 2001
From: Zane van Iperen <zane@zanevaniperen.com>
Date: Sat, 15 May 2021 19:33:52 +1000
Subject: [PATCH v2] avcodec/videotoolboxenc: #define TARGET_CPU_ARM64 to 0 if
not provided by the SDK
Fixes build failure on older SDKs without it.
Fixes #9242
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
libavcodec/videotoolboxenc.c | 4 ++++
1 file changed, 4 insertions(+)
NB: This is untested, I do not have a Mac to try it on.
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 58239e0ab9..f063a86e73 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -50,6 +50,10 @@ enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
#endif
+#ifndef TARGET_CPU_ARM64
+# define TARGET_CPU_ARM64 0
+#endif
+
typedef OSStatus (*getParameterSetAtIndex)(CMFormatDescriptionRef videoDesc,
size_t parameterSetIndex,
const uint8_t **parameterSetPointerOut,
--
2.29.3