From d80a7ace36d577abaf44d1dfb1e57f211a8a0d33 Mon Sep 17 00:00:00 2001 From: Maxime Chapelet Date: Fri, 28 Apr 2023 12:53:45 +0200 Subject: [PATCH] videotoolbox: allow CVPX_P010 on all Darwin systems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only OpenGLES isn’t compatible with `x420` formats. Other renderer implementation using Metal or AVSampleBufferDisplayLayer can display this chroma just fine. --- modules/codec/videotoolbox/decoder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/codec/videotoolbox/decoder.c b/modules/codec/videotoolbox/decoder.c index 51677ed28d..e1adb88f2d 100644 --- a/modules/codec/videotoolbox/decoder.c +++ b/modules/codec/videotoolbox/decoder.c @@ -252,10 +252,9 @@ static OSType GetBestChroma(uint8_t i_chroma_format, uint8_t i_depth_luma, return kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; if (i_depth_luma == 10 && i_depth_chroma == 10) { -#if !TARGET_OS_IPHONE if (deviceSupportsHEVC()) /* 42010bit went with HEVC on macOS */ return kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange; -#endif + /* Force BGRA output (and let VT handle the tone mapping) since the * Apple openGL* implementation can't handle 16 bit textures. This * is the case for iOS and some macOS devices (ones that are not