2019-03-01 08:56:24 +00:00
|
|
|
wl_req = '>= 1.15'
|
2018-07-27 13:29:23 +00:00
|
|
|
wl_client_dep = dependency('wayland-client', version: wl_req, required: get_option('wayland'))
|
2023-09-04 18:39:36 +00:00
|
|
|
libdrm_dep = dependency('libdrm', version: '>= 2.4.98', required: get_option('wayland'))
|
2022-06-26 16:44:33 +00:00
|
|
|
wl_proto_req = '>= 1.26'
|
2024-01-23 11:47:31 +00:00
|
|
|
wl_protocol_dep = dependency('wayland-protocols', version: wl_proto_req, required: get_option('wayland'))
|
2018-07-27 13:29:23 +00:00
|
|
|
wl_scanner = find_program('wayland-scanner', required: get_option('wayland'))
|
|
|
|
# Also used in ext/wayland
|
2016-11-17 04:15:18 +00:00
|
|
|
use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.found() and libdrm_dep.found()
|
2016-11-15 20:46:17 +00:00
|
|
|
|
2016-11-17 04:15:18 +00:00
|
|
|
if use_wayland
|
2023-11-03 01:41:15 +00:00
|
|
|
wl_sources = files([
|
2022-01-04 14:20:41 +00:00
|
|
|
'gstwlbuffer.c',
|
|
|
|
'gstwlcontext.c',
|
|
|
|
'gstwldisplay.c',
|
|
|
|
'gstwllinuxdmabuf.c',
|
|
|
|
'gstwlshmallocator.c',
|
|
|
|
'gstwlvideobufferpool.c',
|
|
|
|
'gstwlvideoformat.c',
|
|
|
|
'gstwlwindow.c',
|
2023-11-03 01:41:15 +00:00
|
|
|
])
|
2022-01-04 14:20:41 +00:00
|
|
|
|
2023-11-03 01:41:15 +00:00
|
|
|
wl_headers = files([
|
2022-01-04 14:20:41 +00:00
|
|
|
'gstwl_fwd.h',
|
|
|
|
'gstwlbuffer.h',
|
|
|
|
'gstwlcontext.h',
|
|
|
|
'gstwldisplay.h',
|
|
|
|
'gstwllinuxdmabuf.h',
|
|
|
|
'gstwlshmallocator.h',
|
|
|
|
'gstwlvideobufferpool.h',
|
|
|
|
'gstwlvideoformat.h',
|
|
|
|
'gstwlwindow.h',
|
|
|
|
'wayland.h',
|
|
|
|
'wayland-prelude.h',
|
2023-11-03 01:41:15 +00:00
|
|
|
])
|
2022-01-04 14:20:41 +00:00
|
|
|
|
|
|
|
protocols_datadir = wl_protocol_dep.get_variable('pkgdatadir')
|
|
|
|
|
|
|
|
protocol_defs = [
|
2023-11-03 01:41:15 +00:00
|
|
|
['viewporter', 'stable', ],
|
|
|
|
['linux-dmabuf', 'unstable', 'v1', ],
|
|
|
|
['fullscreen-shell', 'unstable', 'v1', ],
|
2022-06-26 16:44:33 +00:00
|
|
|
['xdg-shell', 'stable', ],
|
|
|
|
['single-pixel-buffer', 'staging', 'v1' ],
|
2022-01-04 14:20:41 +00:00
|
|
|
]
|
|
|
|
protocols_files = []
|
|
|
|
|
|
|
|
foreach protodef: protocol_defs
|
2023-11-03 01:41:15 +00:00
|
|
|
proto_name = protodef.get(0)
|
|
|
|
proto_stability = protodef.get(1)
|
|
|
|
if proto_stability == 'stable'
|
|
|
|
output_base = proto_name
|
2023-11-03 13:47:44 +00:00
|
|
|
elif proto_stability == 'staging'
|
|
|
|
proto_version = protodef.get(2)
|
|
|
|
output_base = f'@proto_name@-@proto_version@'
|
2023-11-03 01:41:15 +00:00
|
|
|
else
|
|
|
|
proto_version = protodef.get(2)
|
|
|
|
output_base = f'@proto_name@-@proto_stability@-@proto_version@'
|
|
|
|
endif
|
|
|
|
input = protocols_datadir / proto_stability / proto_name / f'@output_base@.xml'
|
2022-01-04 14:20:41 +00:00
|
|
|
|
2023-11-03 01:41:15 +00:00
|
|
|
protocols_files += [custom_target(f'@output_base@ client header',
|
|
|
|
input: input,
|
|
|
|
output: f'@output_base@-client-protocol.h',
|
|
|
|
command: [
|
|
|
|
wl_scanner,
|
|
|
|
'client-header',
|
|
|
|
'@INPUT@', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
)]
|
2022-01-04 14:20:41 +00:00
|
|
|
|
2023-11-03 01:41:15 +00:00
|
|
|
protocols_files += [custom_target(f'@output_base@ source',
|
|
|
|
input: input,
|
|
|
|
output: f'@output_base@-protocol.c',
|
|
|
|
command: [
|
|
|
|
wl_scanner,
|
2023-11-03 13:53:35 +00:00
|
|
|
'private-code',
|
2023-11-03 01:41:15 +00:00
|
|
|
'@INPUT@', '@OUTPUT@',
|
|
|
|
],
|
|
|
|
)]
|
2022-01-04 14:20:41 +00:00
|
|
|
endforeach
|
|
|
|
|
|
|
|
extra_c_args = [
|
|
|
|
'-DGST_USE_UNSTABLE_API',
|
|
|
|
'-DBUILDING_GST_WL',
|
|
|
|
'-DG_LOG_DOMAIN="GStreamer-Wayland"',
|
|
|
|
'-D_GNU_SOURCE'
|
|
|
|
]
|
|
|
|
|
2024-05-22 11:28:39 +00:00
|
|
|
if wl_client_dep.version().version_compare('>= 1.22.91')
|
|
|
|
extra_c_args += [ '-DHAVE_WL_EVENT_QUEUE_NAME' ]
|
|
|
|
endif
|
|
|
|
|
2016-11-17 04:15:18 +00:00
|
|
|
gstwayland = library('gstwayland-' + api_version,
|
2022-01-04 14:20:41 +00:00
|
|
|
wl_sources + protocols_files,
|
|
|
|
c_args : gst_plugins_bad_args + extra_c_args,
|
2016-11-17 04:15:18 +00:00
|
|
|
include_directories : [configinc, libsinc],
|
|
|
|
version : libversion,
|
|
|
|
soversion : soversion,
|
2020-10-12 11:12:07 +00:00
|
|
|
darwin_versions : osxversion,
|
2016-11-17 04:15:18 +00:00
|
|
|
install : true,
|
2022-01-04 14:20:41 +00:00
|
|
|
dependencies : [gst_dep, gstallocators_dep, gstvideo_dep, libdrm_dep,
|
2023-05-26 17:38:13 +00:00
|
|
|
wl_client_dep]
|
2016-11-17 04:15:18 +00:00
|
|
|
)
|
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
pkg_name = 'gstreamer-wayland-1.0'
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries += [[pkg_name, {'lib': gstwayland}]]
|
2018-04-07 20:33:47 +00:00
|
|
|
pkgconfig.generate(gstwayland,
|
|
|
|
libraries : [gst_dep, gstvideo_dep],
|
|
|
|
variables : pkgconfig_variables,
|
|
|
|
subdirs : pkgconfig_subdirs,
|
2020-06-27 04:39:00 +00:00
|
|
|
name : pkg_name,
|
2018-04-07 20:33:47 +00:00
|
|
|
description : 'GStreamer Wayland support',
|
|
|
|
)
|
|
|
|
|
2016-11-17 04:15:18 +00:00
|
|
|
gstwayland_dep = declare_dependency(link_with : gstwayland,
|
|
|
|
include_directories : [libsinc],
|
2022-01-04 14:20:41 +00:00
|
|
|
dependencies : [gst_dep, gstallocators_dep, gstvideo_dep, libdrm_dep,
|
2023-05-26 17:38:13 +00:00
|
|
|
wl_client_dep])
|
2018-04-07 20:33:47 +00:00
|
|
|
|
2022-01-04 14:20:41 +00:00
|
|
|
install_headers(wl_headers, subdir: 'gstreamer-1.0/gst/wayland')
|
2020-06-27 04:39:00 +00:00
|
|
|
meson.override_dependency(pkg_name, gstwayland_dep)
|
2016-11-17 04:15:18 +00:00
|
|
|
endif
|