aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-12-14 05:35:27 +0900
committerOphestra <cat@gensokyo.uk>2025-12-14 05:37:21 +0900
commitffbec828e17da38211e74499fb1fc537ec24bd1a (patch)
tree6de23d3c81a36bfe6695681fd610a19a8451d216 /internal/pipewire
parentde0467a65ef15108cd6d6513e3ed07b7704f3819 (diff)
internal/pipewire: move Core wrapper methods under Core
These do not belong under Context, and is an early implementation limitation that carried over. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pipewire')
-rw-r--r--internal/pipewire/core.go18
-rw-r--r--internal/pipewire/pipewire.go2
2 files changed, 10 insertions, 10 deletions
diff --git a/internal/pipewire/core.go b/internal/pipewire/core.go
index ff13eab2..80bd217f 100644
--- a/internal/pipewire/core.go
+++ b/internal/pipewire/core.go
@@ -424,10 +424,10 @@ func (c *CoreHello) MarshalBinary() ([]byte, error) { return Marshal(c) }
// UnmarshalBinary satisfies [encoding.BinaryUnmarshaler] via [Unmarshal].
func (c *CoreHello) UnmarshalBinary(data []byte) error { return Unmarshal(data, c) }
-// coreHello queues a [CoreHello] message for the PipeWire server.
-// This method should not be called directly, the New function queues this message.
-func (ctx *Context) coreHello() error {
- return ctx.writeMessage(
+// hello queues a [CoreHello] message for the PipeWire server.
+// This method should not be called directly, the [New] function queues this message.
+func (core *Core) hello() error {
+ return core.ctx.writeMessage(
PW_ID_CORE,
&CoreHello{PW_VERSION_CORE},
)
@@ -463,12 +463,12 @@ func (c *CoreSync) MarshalBinary() ([]byte, error) { return Marshal(c) }
// UnmarshalBinary satisfies [encoding.BinaryUnmarshaler] via [Unmarshal].
func (c *CoreSync) UnmarshalBinary(data []byte) error { return Unmarshal(data, c) }
-// coreSync queues a [CoreSync] message for the PipeWire server.
+// sync queues a [CoreSync] message for the PipeWire server.
// This is not safe to use directly, callers should use Sync instead.
-func (ctx *Context) coreSync(id Int) error {
- return ctx.writeMessage(
+func (core *Core) sync(id Int) error {
+ return core.ctx.writeMessage(
PW_ID_CORE,
- &CoreSync{id, CoreSyncSequenceOffset + Int(ctx.sequence)},
+ &CoreSync{id, CoreSyncSequenceOffset + Int(core.ctx.sequence)},
)
}
@@ -485,7 +485,7 @@ const (
// Sync queues a [CoreSync] message for the PipeWire server and initiates a Roundtrip.
func (core *Core) Sync() error {
core.done = false
- if err := core.ctx.coreSync(roundtripSyncID); err != nil {
+ if err := core.sync(roundtripSyncID); err != nil {
return err
}
deadline := time.Now().Add(syncTimeout)
diff --git a/internal/pipewire/pipewire.go b/internal/pipewire/pipewire.go
index 92a5dbc2..35d380fc 100644
--- a/internal/pipewire/pipewire.go
+++ b/internal/pipewire/pipewire.go
@@ -122,7 +122,7 @@ func New(conn Conn, props SPADict) (*Context, error) {
}
ctx.nextId = Int(len(ctx.proxy))
- if err := ctx.coreHello(); err != nil {
+ if err := ctx.core.hello(); err != nil {
return nil, err
}
if err := ctx.clientUpdateProperties(props); err != nil {