--- a/meson.build +++ b/meson.build @@ -1518,11 +1518,22 @@ sources += files('video/out/opengl/hwdec_vdpau.c') endif +# TimPlay TASK-44: VideoToolbox → OpenGL interop (`hwdec_mac_gl.c`) faqat +# CGL + IOSurface + CoreVideo'ni ishlatadi (`CGLTexImageIOSurface2D`), mpv'ning +# o'z oynasi (cocoa/gl-cocoa) shart emas — libmpv render API'da GL kontekstini +# ilova beradi. Asl shart `gl-cocoa`ni talab qiladi, u esa `cocoa` → swift-build +# zanjirini tortadi. Shuning uchun darwin + `gl` (plain-gl) ham yetarli deb +# hisoblaymiz va kerakli framework'larni aniq bog'laymiz. videotoolbox_gl = get_option('videotoolbox-gl').require( - features['gl-cocoa'] or features['ios-gl'], - error_message: 'gl-cocoa nor ios-gl could be found!', + features['gl-cocoa'] or features['ios-gl'] or (darwin and features['gl']), + error_message: 'gl-cocoa nor ios-gl nor darwin+gl could be found!', ) features += {'videotoolbox-gl': videotoolbox_gl.allowed()} +if features['videotoolbox-gl'] and not features['gl-cocoa'] and not features['ios-gl'] + dependencies += dependency('appleframeworks', + modules: ['OpenGL', 'IOSurface', 'CoreVideo'], + required: true) +endif corevideo = dependency('appleframeworks', modules: ['CoreVideo'], required: get_option('videotoolbox-pl').require(darwin)) videotoolbox_pl = get_option('videotoolbox-pl').require(