From 6b59d0077247f3a06c86ef26a591e974c433aa79 Mon Sep 17 00:00:00 2001 From: gnattu Date: Wed, 23 Oct 2024 23:46:11 +0800 Subject: [PATCH] lavc/videotoolbox: remove opengl compatability key We are not using OpenGL and this compatability key could introduce performance penalty on some Macs. Performance difference is neglible on Apple Silicon but on old Intel Macs like the 2018 MacBook Air, decoding performance could be reduced by 15% as the IOSurface might make extra frame copies to reshape the pixel buffer. --- ...ideotoolbox-remove-opengl-compatability.patch | 16 ++++++++++++++++ debian/patches/series | 1 + 2 files changed, 17 insertions(+) create mode 100644 debian/patches/0079-videotoolbox-remove-opengl-compatability.patch diff --git a/debian/patches/0079-videotoolbox-remove-opengl-compatability.patch b/debian/patches/0079-videotoolbox-remove-opengl-compatability.patch new file mode 100644 index 0000000000..5e6d78cb04 --- /dev/null +++ b/debian/patches/0079-videotoolbox-remove-opengl-compatability.patch @@ -0,0 +1,16 @@ +Index: FFmpeg/libavcodec/videotoolbox.c +=================================================================== +--- FFmpeg.orig/libavcodec/videotoolbox.c ++++ FFmpeg/libavcodec/videotoolbox.c +@@ -786,11 +786,6 @@ static CFDictionaryRef videotoolbox_buff + CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties); + CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w); + CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h); +-#if TARGET_OS_IPHONE +- CFDictionarySetValue(buffer_attributes, kCVPixelBufferOpenGLESCompatibilityKey, kCFBooleanTrue); +-#else +- CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue); +-#endif + + CFRelease(io_surface_properties); + CFRelease(cv_pix_fmt); diff --git a/debian/patches/series b/debian/patches/series index 72119ec28a..855339c787 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -76,3 +76,4 @@ 0076-alway-set-videotoolboxenc-pixel-buffer-info.patch 0077-add-remove-dovi-hdr10plus-bsf.patch 0078-fix-atenc-layout-samplerate.patch +0079-videotoolbox-remove-opengl-compatability.patch