internal/pipewire: use custom marshaler when available

This reduces special cases. This change also exposes unmarshalled message size on the wire.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-11-25 04:04:07 +09:00
parent 827dc9e1ba
commit 8f4a3bcf9f
2 changed files with 61 additions and 15 deletions

View File

@@ -76,4 +76,7 @@ type CoreHello struct {
func (c *CoreHello) MarshalBinary() ([]byte, error) { return MarshalAppend(make([]byte, 0, 24), c) }
// UnmarshalBinary satisfies [encoding.BinaryUnmarshaler] via [Unmarshal].
func (c *CoreHello) UnmarshalBinary(data []byte) error { return Unmarshal(data, c) }
func (c *CoreHello) UnmarshalBinary(data []byte) error {
_, err := Unmarshal(data, c)
return err
}