mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 06:00:33 +02:00
Include and smoke-test PipeWire video adapter factories
This commit is contained in:
1 parent
060cf9cd57
commit
2466c5aa14
2 files changed
+12
-2
No files matched your search
+5
-2
@@ -57,7 +57,9 @@ def build(destination):
|
|||||||
libdir = plugin_dir.parent
|
libdir = plugin_dir.parent
|
||||||
for relative in ('pipewire-0.3/libpipewire-module-protocol-native.so',
|
for relative in ('pipewire-0.3/libpipewire-module-protocol-native.so',
|
||||||
'pipewire-0.3/libpipewire-module-client-node.so',
|
'pipewire-0.3/libpipewire-module-client-node.so',
|
||||||
'spa-0.2/support/libspa-support.so'):
|
'pipewire-0.3/libpipewire-module-adapter.so',
|
||||||
|
'spa-0.2/support/libspa-support.so',
|
||||||
|
'spa-0.2/videoconvert/libspa-videoconvert.so'):
|
||||||
source = libdir / relative
|
source = libdir / relative
|
||||||
if not source.is_file():
|
if not source.is_file():
|
||||||
raise SystemExit('Missing PipeWire runtime library: ' + str(source))
|
raise SystemExit('Missing PipeWire runtime library: ' + str(source))
|
||||||
@@ -68,10 +70,11 @@ def build(destination):
|
|||||||
config = destination / 'share' / 'pipewire'
|
config = destination / 'share' / 'pipewire'
|
||||||
config.mkdir(parents=True, exist_ok=True)
|
config.mkdir(parents=True, exist_ok=True)
|
||||||
(config / 'client.conf').write_text(
|
(config / 'client.conf').write_text(
|
||||||
'context.spa-libs = { support.* = support/libspa-support }\n'
|
'context.spa-libs = { support.* = support/libspa-support video.convert.* = videoconvert/libspa-videoconvert }\n'
|
||||||
'context.modules = [\n'
|
'context.modules = [\n'
|
||||||
' { name = libpipewire-module-protocol-native }\n'
|
' { name = libpipewire-module-protocol-native }\n'
|
||||||
' { name = libpipewire-module-client-node }\n'
|
' { name = libpipewire-module-client-node }\n'
|
||||||
|
' { name = libpipewire-module-adapter }\n'
|
||||||
']\n')
|
']\n')
|
||||||
copied = set()
|
copied = set()
|
||||||
while pending:
|
while pending:
|
||||||
|
|||||||
@@ -186,6 +186,9 @@ for name, ret, args in [
|
|||||||
('pw_main_loop_new', C.c_void_p, [C.c_void_p]),
|
('pw_main_loop_new', C.c_void_p, [C.c_void_p]),
|
||||||
('pw_main_loop_get_loop', C.c_void_p, [C.c_void_p]),
|
('pw_main_loop_get_loop', C.c_void_p, [C.c_void_p]),
|
||||||
('pw_context_new', C.c_void_p, [C.c_void_p, C.c_void_p, C.c_size_t]),
|
('pw_context_new', C.c_void_p, [C.c_void_p, C.c_void_p, C.c_size_t]),
|
||||||
|
('pw_context_find_factory', C.c_void_p, [C.c_void_p, C.c_char_p]),
|
||||||
|
('pw_context_load_spa_handle', C.c_void_p, [C.c_void_p, C.c_char_p, C.c_void_p]),
|
||||||
|
('pw_unload_spa_handle', C.c_int, [C.c_void_p]),
|
||||||
('pw_context_destroy', None, [C.c_void_p]),
|
('pw_context_destroy', None, [C.c_void_p]),
|
||||||
('pw_main_loop_destroy', None, [C.c_void_p])]:
|
('pw_main_loop_destroy', None, [C.c_void_p])]:
|
||||||
fn = getattr(lib, name)
|
fn = getattr(lib, name)
|
||||||
@@ -195,6 +198,10 @@ loop = lib.pw_main_loop_new(None)
|
|||||||
assert loop, 'bundled SPA loop support did not load'
|
assert loop, 'bundled SPA loop support did not load'
|
||||||
context = lib.pw_context_new(lib.pw_main_loop_get_loop(loop), None, 0)
|
context = lib.pw_context_new(lib.pw_main_loop_get_loop(loop), None, 0)
|
||||||
assert context, 'bundled PipeWire client modules did not load'
|
assert context, 'bundled PipeWire client modules did not load'
|
||||||
|
assert lib.pw_context_find_factory(context, b'adapter'), 'video adapter factory is missing'
|
||||||
|
handle = lib.pw_context_load_spa_handle(context, b'video.convert', None)
|
||||||
|
assert handle, 'bundled SPA video converter did not load'
|
||||||
|
lib.pw_unload_spa_handle(handle)
|
||||||
lib.pw_context_destroy(context)
|
lib.pw_context_destroy(context)
|
||||||
lib.pw_main_loop_destroy(loop)
|
lib.pw_main_loop_destroy(loop)
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in new issue
Block a user