diff options
Diffstat (limited to 'internal/pipewire/client.go')
| -rw-r--r-- | internal/pipewire/client.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/pipewire/client.go b/internal/pipewire/client.go index 0dce269b..0847ac0a 100644 --- a/internal/pipewire/client.go +++ b/internal/pipewire/client.go @@ -46,6 +46,14 @@ type ClientInfo struct { Props *SPADict } +// Size satisfies [KnownSize] with a value computed at runtime. +func (c *ClientInfo) Size() Word { + return SizePrefix + + Size(SizeInt) + + Size(SizeLong) + + c.Props.Size() +} + // MarshalBinary satisfies [encoding.BinaryMarshaler] via [Marshal]. func (c *ClientInfo) MarshalBinary() ([]byte, error) { return Marshal(c) } @@ -58,6 +66,9 @@ type ClientUpdateProperties struct { Props *SPADict } +// Size satisfies [KnownSize] with a value computed at runtime. +func (c *ClientUpdateProperties) Size() Word { return SizePrefix + c.Props.Size() } + // MarshalBinary satisfies [encoding.BinaryMarshaler] via [Marshal]. func (c *ClientUpdateProperties) MarshalBinary() ([]byte, error) { return Marshal(c) } |
