internal/pipewire: preallocate for footer

This is useful during serialisation.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-12-02 03:06:27 +09:00
parent 91aaabaa1b
commit 647aa9d02f
2 changed files with 21 additions and 2 deletions

View File

@@ -81,6 +81,12 @@ type FooterCoreGeneration struct {
RegistryGeneration Long `json:"registry_generation"`
}
// Size satisfies [KnownSize] with a constant value.
func (fcg FooterCoreGeneration) Size() Word {
return SizePrefix +
Size(SizeLong)
}
// The FooterClientGeneration indicates to the server what is the last
// registry generation number the client has processed.
//
@@ -91,6 +97,12 @@ type FooterClientGeneration struct {
ClientGeneration Long `json:"client_generation"`
}
// Size satisfies [KnownSize] with a constant value.
func (fcg FooterClientGeneration) Size() Word {
return SizePrefix +
Size(SizeLong)
}
// A CoreInfo event is emitted by the server upon connection
// with the more information about the server.
type CoreInfo struct {