2022-06-03 15:39:50 +00:00
|
|
|
wl_protocol_dir = wayland['deps'][2].get_variable(pkgconfig: 'pkgdatadir', internal: 'pkgdatadir')
|
2022-05-18 14:35:53 +00:00
|
|
|
protocols = [[wl_protocol_dir, 'stable/presentation-time/presentation-time.xml'],
|
|
|
|
[wl_protocol_dir, 'stable/viewporter/viewporter.xml'],
|
|
|
|
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
|
2021-11-07 19:28:16 +00:00
|
|
|
[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'],
|
2022-05-18 14:35:53 +00:00
|
|
|
[wl_protocol_dir, 'unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml'],
|
2021-11-07 19:28:16 +00:00
|
|
|
[wl_protocol_dir, 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml']]
|
|
|
|
wl_protocols_source = []
|
|
|
|
wl_protocols_headers = []
|
|
|
|
|
2023-08-20 20:40:58 +00:00
|
|
|
foreach v: ['1.27', '1.31', '1.32']
|
|
|
|
features += {'wayland-protocols-' + v.replace('.', '-'):
|
|
|
|
wayland['deps'][2].version().version_compare('>=' + v)}
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
if features['wayland-protocols-1-27']
|
2022-11-16 01:52:56 +00:00
|
|
|
protocols += [[wl_protocol_dir, 'staging/content-type/content-type-v1.xml'],
|
|
|
|
[wl_protocol_dir, 'staging/single-pixel-buffer/single-pixel-buffer-v1.xml']]
|
wayland: add support for content-type protocol
The content-type protocol allows mpv to send compositor a hint about the
type of content being displayed on its surface so it could potentially
make some sort of optimization. Fundamentally, this is pretty simple but
since this requires a very new wayland-protocols version (1.27), we have
to mess with the build to add a new define and add a bunch of if's in
here. The protocol itself exposes 4 different types of content: none,
photo, video, and game.
To do that, let's add a new option (wayland-content-type) that lets
users control what hint to send to the compossitor. Since the previous
commit adds a VOCTRL that notifies us about the content being displayed,
we can also add an auto value to this option. As you'd expect, the
compositor hint would be set to photo if mpv's core detects an image,
video for other things, and it is set to none for the special case of
forcing a window when there is not a video track. For completion's sake,
game is also allowed as a value for this option, but in practice there
shouldn't be a reason to use that.
2022-11-15 21:51:45 +00:00
|
|
|
endif
|
2023-08-20 20:40:58 +00:00
|
|
|
if features['wayland-protocols-1-31']
|
2023-01-23 20:16:43 +00:00
|
|
|
protocols += [[wl_protocol_dir, 'staging/fractional-scale/fractional-scale-v1.xml']]
|
|
|
|
endif
|
2023-08-20 20:40:58 +00:00
|
|
|
if features['wayland-protocols-1-32']
|
2023-05-19 22:07:25 +00:00
|
|
|
protocols += [[wl_protocol_dir, 'staging/cursor-shape/cursor-shape-v1.xml'],
|
|
|
|
[wl_protocol_dir, 'unstable/tablet/tablet-unstable-v2.xml']] # required by cursor-shape
|
|
|
|
endif
|
|
|
|
|
2021-11-07 19:28:16 +00:00
|
|
|
foreach p: protocols
|
|
|
|
xml = join_paths(p)
|
|
|
|
wl_protocols_source += custom_target(xml.underscorify() + '_c',
|
|
|
|
input: xml,
|
|
|
|
output: '@BASENAME@.c',
|
|
|
|
command: [wayland['scanner'], 'private-code', '@INPUT@', '@OUTPUT@'],
|
|
|
|
)
|
|
|
|
wl_protocols_headers += custom_target(xml.underscorify() + '_h',
|
|
|
|
input: xml,
|
|
|
|
output: '@BASENAME@.h',
|
|
|
|
command: [wayland['scanner'], 'client-header', '@INPUT@', '@OUTPUT@'],
|
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
lib_client_protocols = static_library('protocols',
|
|
|
|
wl_protocols_source + wl_protocols_headers,
|
|
|
|
dependencies: wayland['deps'][0])
|
|
|
|
|
|
|
|
client_protocols = declare_dependency(link_with: lib_client_protocols,
|
|
|
|
sources: wl_protocols_headers)
|
|
|
|
|
|
|
|
dependencies += [client_protocols, wayland['deps']]
|
|
|
|
|
2023-07-23 22:54:35 +00:00
|
|
|
sources += files('wayland_common.c')
|