internal/pipewire: constants from pipewire/keys.h
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m37s
Test / Sandbox (race detector) (push) Successful in 4m46s
Test / Hpkg (push) Successful in 4m53s
Test / Hakurei (push) Successful in 5m1s
Test / Hakurei (race detector) (push) Successful in 6m13s
Test / Flake checks (push) Successful in 1m22s
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m37s
Test / Sandbox (race detector) (push) Successful in 4m46s
Test / Hpkg (push) Successful in 4m53s
Test / Hakurei (push) Successful in 5m1s
Test / Hakurei (race detector) (push) Successful in 6m13s
Test / Flake checks (push) Successful in 1m22s
These are PipeWire spa_dict keys. Interestingly many keys in the sample are undefined and appear as magic strings in upstream source code. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -14,42 +14,42 @@ func TestClientInfo(t *testing.T) {
|
||||
ID: 34,
|
||||
ChangeMask: pipewire.PW_CLIENT_CHANGE_MASK_PROPS,
|
||||
Properties: &pipewire.SPADict{
|
||||
{Key: "pipewire.protocol", Value: "protocol-native"},
|
||||
{Key: "core.name", Value: "pipewire-0"},
|
||||
{Key: "pipewire.sec.socket", Value: "pipewire-0-manager"},
|
||||
{Key: "pipewire.sec.pid", Value: "1443"},
|
||||
{Key: "pipewire.sec.uid", Value: "1000"},
|
||||
{Key: "pipewire.sec.gid", Value: "100"},
|
||||
{Key: "module.id", Value: "2"},
|
||||
{Key: "object.id", Value: "34"},
|
||||
{Key: "object.serial", Value: "34"},
|
||||
{Key: pipewire.PW_KEY_PROTOCOL, Value: "protocol-native"},
|
||||
{Key: pipewire.PW_KEY_CORE_NAME, Value: "pipewire-0"},
|
||||
{Key: pipewire.PW_KEY_SEC_SOCKET, Value: "pipewire-0-manager"},
|
||||
{Key: pipewire.PW_KEY_SEC_PID, Value: "1443"},
|
||||
{Key: pipewire.PW_KEY_SEC_UID, Value: "1000"},
|
||||
{Key: pipewire.PW_KEY_SEC_GID, Value: "100"},
|
||||
{Key: pipewire.PW_KEY_MODULE_ID, Value: "2"},
|
||||
{Key: pipewire.PW_KEY_OBJECT_ID, Value: "34"},
|
||||
{Key: pipewire.PW_KEY_OBJECT_SERIAL, Value: "34"},
|
||||
}}, nil},
|
||||
|
||||
{"sample*", samplePWContainer[1][3][1], pipewire.ClientInfo{
|
||||
ID: 34,
|
||||
ChangeMask: pipewire.PW_CLIENT_CHANGE_MASK_PROPS,
|
||||
Properties: &pipewire.SPADict{
|
||||
{Key: "pipewire.protocol", Value: "protocol-native"},
|
||||
{Key: "core.name", Value: "pipewire-alice-1443"},
|
||||
{Key: "pipewire.sec.socket", Value: "pipewire-0-manager"},
|
||||
{Key: "pipewire.sec.pid", Value: "1443"},
|
||||
{Key: "pipewire.sec.uid", Value: "1000"},
|
||||
{Key: "pipewire.sec.gid", Value: "100"},
|
||||
{Key: "module.id", Value: "2"},
|
||||
{Key: "object.id", Value: "34"},
|
||||
{Key: "object.serial", Value: "34"},
|
||||
{Key: "remote.intention", Value: "manager"},
|
||||
{Key: "application.name", Value: "pw-container"},
|
||||
{Key: "application.process.binary", Value: "pw-container"},
|
||||
{Key: "application.language", Value: "en_US.UTF-8"},
|
||||
{Key: "application.process.id", Value: "1443"},
|
||||
{Key: "application.process.user", Value: "alice"},
|
||||
{Key: "application.process.host", Value: "nixos"},
|
||||
{Key: "application.process.session-id", Value: "1"},
|
||||
{Key: "window.x11.display", Value: ":0"},
|
||||
{Key: pipewire.PW_KEY_PROTOCOL, Value: "protocol-native"},
|
||||
{Key: pipewire.PW_KEY_CORE_NAME, Value: "pipewire-alice-1443"},
|
||||
{Key: pipewire.PW_KEY_SEC_SOCKET, Value: "pipewire-0-manager"},
|
||||
{Key: pipewire.PW_KEY_SEC_PID, Value: "1443"},
|
||||
{Key: pipewire.PW_KEY_SEC_UID, Value: "1000"},
|
||||
{Key: pipewire.PW_KEY_SEC_GID, Value: "100"},
|
||||
{Key: pipewire.PW_KEY_MODULE_ID, Value: "2"},
|
||||
{Key: pipewire.PW_KEY_OBJECT_ID, Value: "34"},
|
||||
{Key: pipewire.PW_KEY_OBJECT_SERIAL, Value: "34"},
|
||||
{Key: pipewire.PW_KEY_REMOTE_INTENTION, Value: "manager"},
|
||||
{Key: pipewire.PW_KEY_APP_NAME, Value: "pw-container"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_BINARY, Value: "pw-container"},
|
||||
{Key: pipewire.PW_KEY_APP_LANGUAGE, Value: "en_US.UTF-8"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_ID, Value: "1443"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_USER, Value: "alice"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_HOST, Value: "nixos"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_SESSION_ID, Value: "1"},
|
||||
{Key: pipewire.PW_KEY_WINDOW_X11_DISPLAY, Value: ":0"},
|
||||
{Key: "cpu.vm.name", Value: "qemu"},
|
||||
{Key: "log.level", Value: "0"},
|
||||
{Key: "cpu.max-align", Value: "32"},
|
||||
{Key: pipewire.PW_KEY_CPU_MAX_ALIGN, Value: "32"},
|
||||
{Key: "default.clock.rate", Value: "48000"},
|
||||
{Key: "default.clock.quantum", Value: "1024"},
|
||||
{Key: "default.clock.min-quantum", Value: "32"},
|
||||
@@ -66,34 +66,34 @@ func TestClientInfo(t *testing.T) {
|
||||
{Key: "mem.allow-mlock", Value: "true"},
|
||||
{Key: "settings.check-quantum", Value: "false"},
|
||||
{Key: "settings.check-rate", Value: "false"},
|
||||
{Key: "core.version", Value: "1.4.7"},
|
||||
{Key: pipewire.PW_KEY_CORE_VERSION, Value: "1.4.7"},
|
||||
}}, nil},
|
||||
|
||||
{"sample**", samplePWContainer[1][4][1], pipewire.ClientInfo{
|
||||
ID: 34,
|
||||
ChangeMask: pipewire.PW_CLIENT_CHANGE_MASK_PROPS,
|
||||
Properties: &pipewire.SPADict{
|
||||
{Key: "pipewire.protocol", Value: "protocol-native"},
|
||||
{Key: "core.name", Value: "pipewire-alice-1443"},
|
||||
{Key: "pipewire.sec.socket", Value: "pipewire-0-manager"},
|
||||
{Key: "pipewire.sec.pid", Value: "1443"},
|
||||
{Key: "pipewire.sec.uid", Value: "1000"},
|
||||
{Key: "pipewire.sec.gid", Value: "100"},
|
||||
{Key: "module.id", Value: "2"},
|
||||
{Key: "object.id", Value: "34"},
|
||||
{Key: "object.serial", Value: "34"},
|
||||
{Key: "remote.intention", Value: "manager"},
|
||||
{Key: "application.name", Value: "pw-container"},
|
||||
{Key: "application.process.binary", Value: "pw-container"},
|
||||
{Key: "application.language", Value: "en_US.UTF-8"},
|
||||
{Key: "application.process.id", Value: "1443"},
|
||||
{Key: "application.process.user", Value: "alice"},
|
||||
{Key: "application.process.host", Value: "nixos"},
|
||||
{Key: "application.process.session-id", Value: "1"},
|
||||
{Key: "window.x11.display", Value: ":0"},
|
||||
{Key: pipewire.PW_KEY_PROTOCOL, Value: "protocol-native"},
|
||||
{Key: pipewire.PW_KEY_CORE_NAME, Value: "pipewire-alice-1443"},
|
||||
{Key: pipewire.PW_KEY_SEC_SOCKET, Value: "pipewire-0-manager"},
|
||||
{Key: pipewire.PW_KEY_SEC_PID, Value: "1443"},
|
||||
{Key: pipewire.PW_KEY_SEC_UID, Value: "1000"},
|
||||
{Key: pipewire.PW_KEY_SEC_GID, Value: "100"},
|
||||
{Key: pipewire.PW_KEY_MODULE_ID, Value: "2"},
|
||||
{Key: pipewire.PW_KEY_OBJECT_ID, Value: "34"},
|
||||
{Key: pipewire.PW_KEY_OBJECT_SERIAL, Value: "34"},
|
||||
{Key: pipewire.PW_KEY_REMOTE_INTENTION, Value: "manager"},
|
||||
{Key: pipewire.PW_KEY_APP_NAME, Value: "pw-container"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_BINARY, Value: "pw-container"},
|
||||
{Key: pipewire.PW_KEY_APP_LANGUAGE, Value: "en_US.UTF-8"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_ID, Value: "1443"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_USER, Value: "alice"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_HOST, Value: "nixos"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_SESSION_ID, Value: "1"},
|
||||
{Key: pipewire.PW_KEY_WINDOW_X11_DISPLAY, Value: ":0"},
|
||||
{Key: "cpu.vm.name", Value: "qemu"},
|
||||
{Key: "log.level", Value: "0"},
|
||||
{Key: "cpu.max-align", Value: "32"},
|
||||
{Key: pipewire.PW_KEY_CPU_MAX_ALIGN, Value: "32"},
|
||||
{Key: "default.clock.rate", Value: "48000"},
|
||||
{Key: "default.clock.quantum", Value: "1024"},
|
||||
{Key: "default.clock.min-quantum", Value: "32"},
|
||||
@@ -110,8 +110,8 @@ func TestClientInfo(t *testing.T) {
|
||||
{Key: "mem.allow-mlock", Value: "true"},
|
||||
{Key: "settings.check-quantum", Value: "false"},
|
||||
{Key: "settings.check-rate", Value: "false"},
|
||||
{Key: "core.version", Value: "1.4.7"},
|
||||
{Key: "pipewire.access", Value: "unrestricted"},
|
||||
{Key: pipewire.PW_KEY_CORE_VERSION, Value: "1.4.7"},
|
||||
{Key: pipewire.PW_KEY_ACCESS, Value: "unrestricted"},
|
||||
}}, nil},
|
||||
}.run(t)
|
||||
}
|
||||
@@ -121,18 +121,18 @@ func TestClientUpdateProperties(t *testing.T) {
|
||||
|
||||
encodingTestCases[pipewire.ClientUpdateProperties, *pipewire.ClientUpdateProperties]{
|
||||
{"sample", samplePWContainer[0][1][1], pipewire.ClientUpdateProperties{Properties: &pipewire.SPADict{
|
||||
{Key: "remote.intention", Value: "manager"},
|
||||
{Key: "application.name", Value: "pw-container"},
|
||||
{Key: "application.process.binary", Value: "pw-container"},
|
||||
{Key: "application.language", Value: "en_US.UTF-8"},
|
||||
{Key: "application.process.id", Value: "1443"},
|
||||
{Key: "application.process.user", Value: "alice"},
|
||||
{Key: "application.process.host", Value: "nixos"},
|
||||
{Key: "application.process.session-id", Value: "1"},
|
||||
{Key: "window.x11.display", Value: ":0"},
|
||||
{Key: pipewire.PW_KEY_REMOTE_INTENTION, Value: "manager"},
|
||||
{Key: pipewire.PW_KEY_APP_NAME, Value: "pw-container"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_BINARY, Value: "pw-container"},
|
||||
{Key: pipewire.PW_KEY_APP_LANGUAGE, Value: "en_US.UTF-8"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_ID, Value: "1443"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_USER, Value: "alice"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_HOST, Value: "nixos"},
|
||||
{Key: pipewire.PW_KEY_APP_PROCESS_SESSION_ID, Value: "1"},
|
||||
{Key: pipewire.PW_KEY_WINDOW_X11_DISPLAY, Value: ":0"},
|
||||
{Key: "cpu.vm.name", Value: "qemu"},
|
||||
{Key: "log.level", Value: "0"},
|
||||
{Key: "cpu.max-align", Value: "32"},
|
||||
{Key: pipewire.PW_KEY_CPU_MAX_ALIGN, Value: "32"},
|
||||
{Key: "default.clock.rate", Value: "48000"},
|
||||
{Key: "default.clock.quantum", Value: "1024"},
|
||||
{Key: "default.clock.min-quantum", Value: "32"},
|
||||
@@ -149,8 +149,8 @@ func TestClientUpdateProperties(t *testing.T) {
|
||||
{Key: "mem.allow-mlock", Value: "true"},
|
||||
{Key: "settings.check-quantum", Value: "false"},
|
||||
{Key: "settings.check-rate", Value: "false"},
|
||||
{Key: "core.version", Value: "1.4.7"},
|
||||
{Key: "core.name", Value: "pipewire-alice-1443"},
|
||||
{Key: pipewire.PW_KEY_CORE_VERSION, Value: "1.4.7"},
|
||||
{Key: pipewire.PW_KEY_CORE_NAME, Value: "pipewire-alice-1443"},
|
||||
}}, nil},
|
||||
}.run(t)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user