2016-09-09 06:55:23 +00:00
|
|
|
vulkan_sources = [
|
|
|
|
'gstvulkan.c',
|
|
|
|
'vkbuffermemory.c',
|
|
|
|
'vkbufferpool.c',
|
|
|
|
'vkdevice.c',
|
|
|
|
'vkdisplay.c',
|
|
|
|
'vkerror.c',
|
2016-11-04 04:21:36 +00:00
|
|
|
'vkfence.c',
|
2016-09-09 06:55:23 +00:00
|
|
|
'vkimagememory.c',
|
|
|
|
'vkinstance.c',
|
|
|
|
'vkmemory.c',
|
|
|
|
'vkqueue.c',
|
|
|
|
'vksink.c',
|
|
|
|
'vkswapper.c',
|
2016-11-04 04:21:36 +00:00
|
|
|
'vktrash.c',
|
2016-09-09 06:55:23 +00:00
|
|
|
'vkupload.c',
|
|
|
|
'vkutils.c',
|
|
|
|
'vkwindow.c',
|
|
|
|
]
|
|
|
|
|
2019-03-25 06:50:13 +00:00
|
|
|
vulkan_objc_args = []
|
2016-09-09 06:55:23 +00:00
|
|
|
vulkan_defines = []
|
|
|
|
optional_deps = []
|
2018-07-27 13:29:23 +00:00
|
|
|
if get_option('vulkan').disabled()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
2016-09-09 06:55:23 +00:00
|
|
|
|
2019-03-27 06:56:28 +00:00
|
|
|
if host_system == 'ios'
|
|
|
|
vulkan_dep = cc.find_library('MoltenVK', required : get_option('vulkan'))
|
|
|
|
else
|
|
|
|
vulkan_dep = cc.find_library('vulkan', required : get_option('vulkan'))
|
|
|
|
endif
|
2016-09-09 06:55:23 +00:00
|
|
|
has_vulkan_header = cc.has_header('vulkan/vulkan.h')
|
2018-07-27 13:29:23 +00:00
|
|
|
if not has_vulkan_header and get_option('vulkan').enabled()
|
|
|
|
error('vulkan plugin enabled, but vulkan.h not found')
|
|
|
|
endif
|
|
|
|
|
2016-09-09 06:55:23 +00:00
|
|
|
if vulkan_dep.found() and has_vulkan_header
|
|
|
|
have_vulkan_windowing = false
|
|
|
|
|
|
|
|
vkconf = configuration_data()
|
|
|
|
|
2018-07-27 13:29:23 +00:00
|
|
|
xcb_dep = dependency('xcb', version : '>=1.10', required : get_option('x11'))
|
2016-09-09 06:55:23 +00:00
|
|
|
if xcb_dep.found()
|
|
|
|
vulkan_sources += [
|
|
|
|
'xcb/vkdisplay_xcb.c',
|
|
|
|
'xcb/vkwindow_xcb.c',
|
|
|
|
'xcb/xcb_event_source.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
optional_deps += xcb_dep
|
|
|
|
have_vulkan_windowing = true
|
|
|
|
vkconf.set10('GST_VULKAN_HAVE_WINDOW_XCB', 1)
|
|
|
|
endif
|
|
|
|
|
2018-07-27 13:29:23 +00:00
|
|
|
wayland_client_dep = dependency('wayland-client', version : '>=1.4', required : get_option('wayland'))
|
2016-09-09 06:55:23 +00:00
|
|
|
if wayland_client_dep.found()
|
|
|
|
vulkan_sources += [
|
|
|
|
'wayland/vkdisplay_wayland.c',
|
|
|
|
'wayland/vkwindow_wayland.c',
|
|
|
|
'wayland/wayland_event_source.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
optional_deps += wayland_client_dep
|
|
|
|
have_vulkan_windowing = true
|
|
|
|
vkconf.set10('GST_VULKAN_HAVE_WINDOW_WAYLAND', 1)
|
|
|
|
endif
|
|
|
|
|
2019-03-25 06:50:13 +00:00
|
|
|
if ['darwin', 'ios'].contains(host_system)
|
|
|
|
objc = meson.get_compiler('objc')
|
|
|
|
if not objc.has_argument('-fobjc-arc')
|
|
|
|
error('ARC is required for building')
|
|
|
|
endif
|
|
|
|
|
|
|
|
vulkan_objc_args += ['-fobjc-arc']
|
|
|
|
|
|
|
|
foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : get_option('vulkan'))
|
|
|
|
quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : get_option('vulkan'))
|
|
|
|
corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : get_option('vulkan'))
|
2019-03-27 06:56:28 +00:00
|
|
|
if foundation_dep.found() and quartzcore_dep.found() and corefoundation_dep.found()
|
|
|
|
optional_deps += [foundation_dep, corefoundation_dep, quartzcore_dep]
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if host_system == 'darwin'
|
2019-03-25 06:50:13 +00:00
|
|
|
cocoa_dep = dependency('appleframeworks', modules : ['Cocoa'], required : get_option('vulkan'))
|
|
|
|
|
2019-03-27 06:56:28 +00:00
|
|
|
if cocoa_dep.found()
|
2019-03-25 06:50:13 +00:00
|
|
|
vulkan_sources += [
|
|
|
|
'cocoa/vkdisplay_cocoa.m',
|
|
|
|
'cocoa/vkwindow_cocoa.m',
|
|
|
|
]
|
2019-03-27 06:56:28 +00:00
|
|
|
optional_deps += [cocoa_dep]
|
2019-03-25 06:50:13 +00:00
|
|
|
have_vulkan_windowing = true
|
|
|
|
vkconf.set10('GST_VULKAN_HAVE_WINDOW_COCOA', 1)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-03-27 06:56:28 +00:00
|
|
|
if host_system == 'ios'
|
|
|
|
uikit_dep = dependency('appleframeworks', modules : ['UIKit'], required : get_option('vulkan'))
|
|
|
|
|
|
|
|
if uikit_dep.found()
|
|
|
|
vulkan_sources += [
|
|
|
|
'ios/vkdisplay_ios.m',
|
|
|
|
'ios/vkwindow_ios.m',
|
|
|
|
]
|
|
|
|
optional_deps += [uikit_dep]
|
|
|
|
have_vulkan_windowing = true
|
|
|
|
vkconf.set10('GST_VULKAN_HAVE_WINDOW_IOS', 1)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-09-09 06:55:23 +00:00
|
|
|
if have_vulkan_windowing
|
|
|
|
configure_file(input : 'vkconfig.h.meson',
|
|
|
|
output : 'vkconfig.h',
|
|
|
|
configuration : vkconf)
|
|
|
|
|
|
|
|
gstvulkan = library('gstvulkan',
|
|
|
|
vulkan_sources,
|
|
|
|
c_args : gst_plugins_bad_args + vulkan_defines,
|
2019-03-25 06:50:13 +00:00
|
|
|
objc_args : gst_plugins_bad_args + vulkan_defines + vulkan_objc_args,
|
2016-09-09 06:55:23 +00:00
|
|
|
link_args : noseh_link_args,
|
|
|
|
include_directories : [configinc],
|
2019-03-27 06:56:28 +00:00
|
|
|
dependencies : [gstvideo_dep, gstbase_dep, vulkan_dep] + optional_deps,
|
2016-09-09 06:55:23 +00:00
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir,
|
|
|
|
)
|
2018-04-24 18:05:30 +00:00
|
|
|
pkgconfig.generate(gstvulkan, install_dir : plugins_pkgconfig_install_dir)
|
2018-10-22 09:30:45 +00:00
|
|
|
plugins += [gstvulkan]
|
2016-09-09 06:55:23 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|