aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire/core_test.go
AgeCommit message (Collapse)Author
2025-12-14internal/pipewire: implement Core::DestroyOphestra
This change also implements pending destructible check on Sync. Destruction method should always be implemented as a wrapper of destructible.destroy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: do not emit None for spa_dictOphestra
Turns out the PipeWire server does not expect a value of type None here at all. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: implement Core::CreateObjectOphestra
Nothing uses this right now, this would have to be called by wrapper methods on Registry that would search the objects Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-13internal/pipewire: implement Core::RemoveIdOphestra
This is emitted by the server when a proxy id is removed for any reason. Currently, the only path for this to be emitted is when a global object is destroyed while some proxy is still bound to it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: implement Registry::DestroyOphestra
This requires error handling infrastructure in Core that does not yet exist, so it is not exported for now. It has been manually tested via linkname against PipeWire. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: implement Registry::GlobalRemoveOphestra
This is emitted by PipeWire when a global object disappears, because PipeWire insists that all clients that had called Core::GetRegistry must constantly sync its local registry state with the remote. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: seq access method for consumeOphestra
This improves readability as the offset is not immediately obvious. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-05internal/pipewire: constants from pipewire/keys.hOphestra
These are PipeWire spa_dict keys. Interestingly many keys in the sample are undefined and appear as magic strings in upstream source code. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-04internal/pipewire: use type name in error stringsOphestra
This provides more useful messages for protocol errors. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-02internal/pipewire: implement client contextOphestra
This consumes the entire sample, is validated to send identical messages and correctly handle received messages. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-30internal/pipewire: implement Core::ErrorOphestra
Sample was captured from pw-cli. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-29internal/pipewire: implement Core::Ping, Core::PongOphestra
I could not get the server to produce these events, however I am confident enough with the implementation to do it by hand. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-29internal/pipewire: implement SecurityContext::CreateOphestra
This is finally the thing we are after. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-29internal/pipewire: implement Registry::BindOphestra
This change also adds test cases for messages before this one. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-29internal/pipewire: implement client generation footerOphestra
This corresponds with the core generation footer and seem to be the only other possible footer type. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-28internal/pipewire: implement Registry::GlobalOphestra
Dealing with this event reawakened my burning hatred for OOP. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-28internal/pipewire: add json struct tagsOphestra
These match the names found in documentation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-28internal/pipewire: do not store spa_dict fieldsOphestra
This is effectively a poor man's slice, it is entirely unnecessary here and can be handled internally. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-28internal/pipewire: store sample iovec continuouslyOphestra
This removes the need for manual splitting. The understanding of the format is robust enough to allow this to happen anyway. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-27internal/pipewire: shorten test data filenamesOphestra
These were getting very annoying to type. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-26internal/pipewire: implement Core::DoneOphestra
The message in the sample does not correspond to any known method call. The spec does not mention what to do with messages like this, but all existing usage code simply drops it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::BoundPropsOphestra
Very straightforward type, everything is already supported. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::Info and generation footerOphestra
These are not directly related but are first encountered on the same message in the capture. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::SyncOphestra
Once again, already entirely supported, the offset is not yet fully verified but makes intuitive sense. Will verify this on future occurrences of the message. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::GetRegistryOphestra
This struct is entirely supported, so this change is very straightforward. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: move test data to filesOphestra
These get very big later on, and would be painful to represent as the compound literal. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::HelloOphestra
This implements enough types to correctly marshal and unmarshal Core::Hello. Signed-off-by: Ophestra <cat@gensokyo.uk>