aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire/header.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-10-27 20:13:13 +0900
committerOphestra <cat@gensokyo.uk>2026-10-27 20:13:13 +0900
commitea29e6bad114306b78820cb674863a9bf3041fa5 (patch)
treeda87b09d5b3b57d6744db90b697124c5d4569e8d /internal/pipewire/header.go
parent672cf9abcac6f25abfdd2541cae6455c6da38fc3 (diff)
internal/pipewire: re-format for readability
This package was the first somewhat large piece of code that was primarily written using the built-in display of my laptop. The experience had been deeply unpleasant due to the awkward 3:2 aspect ratio not working well with my setup, which almost always involved having the implementation and tests side-by-side. This experience is what provoked me to re-instate the 80-column limit that I had long resented and rejected. This package however predates the formal re-instating of this limit, and was never updated. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire/header.go')
-rw-r--r--internal/pipewire/header.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/pipewire/header.go b/internal/pipewire/header.go
index 3aecfb7d..a627db24 100644
--- a/internal/pipewire/header.go
+++ b/internal/pipewire/header.go
@@ -8,14 +8,17 @@ import (
const (
// SizeHeader is the fixed size of [Header].
SizeHeader = 16
- // SizeMax is the largest value of [Header.Size] that can be represented in its 3-byte segment.
+ // SizeMax is the largest value of [Header.Size] that can be represented in
+ // its 3-byte segment.
SizeMax = 0x00ffffff
)
var (
- // ErrSizeRange indicates that the value of [Header.Size] cannot be represented in its 3-byte segment.
+ // ErrSizeRange indicates that the value of [Header.Size] cannot be
+ // represented in its 3-byte segment.
ErrSizeRange = errors.New("size out of range")
- // ErrBadHeader indicates that the header slice does not have length [HeaderSize].
+ // ErrBadHeader indicates that the header slice does not have length
+ // [SizeHeader].
ErrBadHeader = errors.New("incorrect header size")
)
@@ -26,6 +29,7 @@ type Header struct {
// The opcode on the resource/proxy interface.
Opcode byte `json:"opcode"`
// The size of the payload and optional footer of the message.
+ //
// Note: this value is only 24 bits long in the format.
Size uint32 `json:"size"`
// An increasing sequence number for each message.