From 10ff276da187868be1fa136ffd41ee2904c2cea8 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 26 Nov 2025 16:17:38 +0900 Subject: [PATCH] internal/pipewire: additional Client::Info test case This message follows the other Client::Info event before it. No idea why. Signed-off-by: Ophestra --- internal/pipewire/client_test.go | 44 ++++++++++++++++++ internal/pipewire/header_test.go | 6 +++ internal/pipewire/pipewire_test.go | 5 ++ .../testdata/15-recvmsg00-message03-header | Bin 0 -> 16 bytes .../testdata/16-recvmsg00-message03-POD | Bin 0 -> 1952 bytes 5 files changed, 55 insertions(+) create mode 100644 internal/pipewire/testdata/15-recvmsg00-message03-header create mode 100644 internal/pipewire/testdata/16-recvmsg00-message03-POD diff --git a/internal/pipewire/client_test.go b/internal/pipewire/client_test.go index c9d790c..69a9547 100644 --- a/internal/pipewire/client_test.go +++ b/internal/pipewire/client_test.go @@ -24,6 +24,50 @@ func TestClientInfo(t *testing.T) { {Key: "object.id", Value: "34"}, {Key: "object.serial", Value: "34"}, }}}, nil}, + + {"sample*", []byte(recvmsg00Message03POD), pipewire.ClientInfo{ + ID: 34, + ChangeMask: pipewire.PW_CLIENT_CHANGE_MASK_PROPS, + Props: &pipewire.SPADict{NItems: 38, Items: []pipewire.SPADictItem{ + {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: "cpu.vm.name", Value: "qemu"}, + {Key: "log.level", Value: "0"}, + {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"}, + {Key: "default.clock.max-quantum", Value: "2048"}, + {Key: "default.clock.quantum-limit", Value: "8192"}, + {Key: "default.clock.quantum-floor", Value: "4"}, + {Key: "default.video.width", Value: "640"}, + {Key: "default.video.height", Value: "480"}, + {Key: "default.video.rate.num", Value: "25"}, + {Key: "default.video.rate.denom", Value: "1"}, + {Key: "clock.power-of-two-quantum", Value: "true"}, + {Key: "link.max-buffers", Value: "64"}, + {Key: "mem.warn-mlock", Value: "false"}, + {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"}, + }}}, nil}, }.run(t) } diff --git a/internal/pipewire/header_test.go b/internal/pipewire/header_test.go index 0618988..20f7ded 100644 --- a/internal/pipewire/header_test.go +++ b/internal/pipewire/header_test.go @@ -53,6 +53,12 @@ func TestHeader(t *testing.T) { Size: 0x1f0, Sequence: 2, FileCount: 0, }, nil}, + {"PW_CLIENT_EVENT_INFO*", []byte(recvmsg00Message03Header), pipewire.Header{ + ID: pipewire.PW_ID_CLIENT, + Opcode: pipewire.PW_CLIENT_EVENT_INFO, + Size: 0x7a0, Sequence: 3, FileCount: 0, + }, nil}, + {"PW_SECURITY_CONTEXT_METHOD_CREATE", []byte{ // Id 3, 0, 0, 0, diff --git a/internal/pipewire/pipewire_test.go b/internal/pipewire/pipewire_test.go index 9511e2f..bfdc571 100644 --- a/internal/pipewire/pipewire_test.go +++ b/internal/pipewire/pipewire_test.go @@ -41,4 +41,9 @@ var ( recvmsg00Message02Header string //go:embed testdata/14-recvmsg00-message02-POD recvmsg00Message02POD string + + //go:embed testdata/15-recvmsg00-message03-header + recvmsg00Message03Header string + //go:embed testdata/16-recvmsg00-message03-POD + recvmsg00Message03POD string ) diff --git a/internal/pipewire/testdata/15-recvmsg00-message03-header b/internal/pipewire/testdata/15-recvmsg00-message03-header new file mode 100644 index 0000000000000000000000000000000000000000..0964c8a09addcbcdeceda518aa249269a0f3046e GIT binary patch literal 16 ScmZQ%U|?9l&cMLT009691pur7 literal 0 HcmV?d00001 diff --git a/internal/pipewire/testdata/16-recvmsg00-message03-POD b/internal/pipewire/testdata/16-recvmsg00-message03-POD new file mode 100644 index 0000000000000000000000000000000000000000..be7157ce5e5906c20f96295131027cf3012f67db GIT binary patch literal 1952 zcmbQi&cMLOz`(!)#Yzkiz`?-4z{J=2_ zm*gks=RoBJVDeC5-Mqw-%(7GlE~t2Neo?AkUSe)4RJ{mP9A=(wVoqjqs;;4li7{9O zy1ZU-YO-E&esXqd30PhjUB7{DZem_ydTJ3^nn4gv9<0A0GX)|G@iWLjFblD&FU6wX zz`y`x23Gay2=$_?E zoCs2i9BmA|Pn7*tl_X~7K|)*_DvqqLpeR2%wYXR>DKjszs1jl$F8!id^yehz zrI#kAgOdyoR6aE?J~UV_G{jBU0&Ji-R2-YVpg;ztZIJ(9@hpi)eQ7boFCc^2VCq20 zl7WE%pT3OzVo0K7U|@jh%ge0DFJ@q1kcXLr6rQkfDNZde&dkr#1-TQJ4h%t-GcYi~ z(sy}gUP^wsUWK8dUP@+hK~5qx9AWWn1x}3&46yJ?E-2M2%SA*P%>RX{xuqbZVfis9 zKV2^;wJa5sW-tbWoy!*=r0lG!IfMX329wru$j3WjO4^;JqrHOeZrMb|u2xPCJfe|>ROJP-?o0+GJ&;xQmy1Q`b zORPZC2MZq~0~2t9lEG>p)Gpne%-l>!RKxUH7+Qiu0>8erocw%9!2}Cuu;&;U7+~cb zEIi6GQ&RKw$}>|+GC)`1ei~5w*ynIj;ffd610ZXs2{11u$g8cH-BHjEn-IDTr)BuNtTS-wV zIEBEi8;j} zgJJa%NL^x1PJTI5A-esr@F`9$Dap)BFV;)WNKMX0xEYq8Vdlc(3r#&JK*8=sR}U-i Z!1Z5QY7r>IgA~Hl8S0tnnKLjj003%AT%!O0 literal 0 HcmV?d00001