e7a665e043
internal/pipewire: handle Core::Error
...
This event is not encountered in the pw-container sample, but already has existing sample from an excerpt.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-12-02 06:16:18 +09:00
af741f20a0
internal/pipewire: implement client context
...
This consumes the entire sample, is validated to send identical messages and correctly handle received messages.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-12-02 06:03:21 +09:00
39c6716fb0
internal/pipewire: use correct types in header
...
This was written when the protocol was still barely understood, so none of the types here are correct and match the rest of the protocol. This change corrects these types.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-12-02 03:32:10 +09:00
7bc73afadd
internal/pipewire: wrap EOF error for deserialisation
...
The io.ErrUnexpectedEOF error can be returned from multiple places. This change eases error handling.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-12-02 03:19:37 +09:00
647aa9d02f
internal/pipewire: preallocate for footer
...
This is useful during serialisation.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-12-02 03:06:27 +09:00
91aaabaa1b
internal/pipewire: benchmarks against Gob and JSON
...
Performance does not matter for the use case of this library, but it is still interesting to know.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-30 12:13:46 +09:00
3d4c7cdd9e
internal/pipewire: implement Core::Error
...
Sample was captured from pw-cli.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-30 01:39:39 +09:00
4fd6d6c037
internal/pipewire: implement Core::Ping, Core::Pong
...
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-29 23:25:29 +09:00
de3fc7ba38
internal/pipewire: implement SecurityContext::Create
...
This is finally the thing we are after.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-29 16:46:39 +09:00
5a5c4705dd
internal/pipewire: implement Registry::Bind
...
This change also adds test cases for messages before this one.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-29 03:01:53 +09:00
f703aa20a5
internal/pipewire: implement client generation footer
...
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-29 02:55:30 +09:00
5c12425d48
internal/pipewire: implement Registry::Global
...
Dealing with this event reawakened my burning hatred for OOP.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-28 02:32:45 +09:00
cbe86dc4f0
internal/pipewire: add json struct tags
...
These match the names found in documentation.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-28 01:33:32 +09:00
d08a1081bd
internal/pipewire: do not store spa_dict fields
...
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-28 01:25:18 +09:00
72a2601d74
internal/pipewire: store sample iovec continuously
...
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-28 00:35:10 +09:00
1dab87aaf0
internal/pipewire: add missing constants
...
These did not appear useful at first since it was assumed to be filenames for loading modules.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 21:28:16 +09:00
2bafde99e3
internal/pipewire: shorten test data filenames
...
These were getting very annoying to type.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 20:06:01 +09:00
91efeb101a
internal/pipewire: spa_dict size nil check
...
This fixes serialisation of NULL spa_dict.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 02:51:36 +09:00
dcb22a61c0
internal/pipewire: require appending marshaler
...
This eliminates all non-reflect allocations.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 02:33:19 +09:00
e028a61fc1
internal/pipewire: preallocate for known size
...
This is still not efficient by any means, but it should eliminate most non-reflect allocation (all allocation if PODMarshaler is not used).
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 02:26:31 +09:00
73987be7d4
internal/pipewire: size without serialisation
...
This is required to achieve zero allocation (other than reflect).
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 02:17:38 +09:00
563b5e66fc
internal/pipewire: simplify spa_dict appends
...
This change uses the (somewhat) newly exposed MarshalAppend which improves readability.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 01:52:13 +09:00
2edcfe1e68
internal/pipewire: define size constants
...
This gets rid of magic numbers in marshal/unmarshal.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-27 00:54:56 +09:00
2698ca00e8
internal/pipewire: implement Core::Done
...
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-26 19:02:21 +09:00
1d0143386d
internal/pipewire: optional final trailing garbage check
...
Omitting the check is only useful for custom unmarshaler.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-26 18:50:39 +09:00
a55c209099
internal/pipewire: additional Client::Info test case
...
This appears to add *one single entry* compared to the message before it. The inefficiency of this protocol is beyond imagination.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-26 16:28:57 +09:00
10ff276da1
internal/pipewire: additional Client::Info test case
...
This message follows the other Client::Info event before it. No idea why.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-26 16:17:38 +09:00
fd4d379b67
internal/pipewire: implement Client::Info
...
Everything is already supported, as usual.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-26 16:05:46 +09:00
77f5b89a41
internal/pipewire: implement Core::BoundProps
...
Very straightforward type, everything is already supported.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 18:40:19 +09:00
14e33f17e5
internal/pipewire: check nil marshaler
...
NULL values have special case in the format. This check ensures correctness serialising nil pointers.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 18:36:08 +09:00
cfeb7818eb
internal/pipewire: implement Core::Info and generation footer
...
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-25 15:16:12 +09:00
05391da556
internal/pipewire: implement footer
...
The POD itself is serialised without requiring a special case, however its presence is only indicated by the difference in size recorded in the header and payload.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 15:11:22 +09:00
463f8836e6
internal/pipewire: implement Long type
...
Thankfully no special case here.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 15:05:37 +09:00
2e465c94da
internal/pipewire: implement Id type
...
This is, in fact, just a glorified Int type.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 15:01:58 +09:00
26009fd3f7
internal/pipewire: slice at POD boundary
...
This prevents incorrectly reading trailing data as part of the current POD.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 14:58:56 +09:00
2d7b896a8c
internal/pipewire: bounds check against wire size
...
This covers cases where wire size is not known ahead of time.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 13:42:31 +09:00
a0eb010aab
internal/pipewire: spa_dict trailing garbage within POD
...
This performs the check within the bounds of the POD only. This was not caught since spa_dict was only used as the final struct field until now.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 13:39:02 +09:00
b1b27ac1df
internal/pipewire: zero size before validation
...
Leftover values from previous invocations cause incorrect behaviour here.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 12:21:37 +09:00
fc3d78fe01
internal/pipewire: implement Core::Sync
...
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-25 08:52:06 +09:00
591637264a
internal/pipewire: implement Core::GetRegistry
...
This struct is entirely supported, so this change is very straightforward.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 08:34:19 +09:00
e77652bf89
internal/pipewire: move test data to files
...
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-25 08:09:10 +09:00
88d3e46413
internal/pipewire: implement Client::UpdateProperties
...
This is the second message on the captured sample.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 04:16:11 +09:00
e51e81bb22
internal/pipewire: implement spa_dict type
...
This is a terrible type that defies the type system. It is implemented on the concrete type to avoid special cases.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 04:08:52 +09:00
8f4a3bcf9f
internal/pipewire: use custom marshaler when available
...
This reduces special cases. This change also exposes unmarshalled message size on the wire.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 04:05:22 +09:00
827dc9e1ba
internal/pipewire: implement string type
...
This is still NUL terminated strings, and an extra NUL character on an 8-byte string does cause an extra 7 bytes of padding.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 04:00:59 +09:00
d92de1c709
internal/pipewire: check for trailing garbage
...
This is useful during development.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 01:59:29 +09:00
5bcafcf734
internal/pipewire: implement Core::Hello
...
This implements enough types to correctly marshal and unmarshal Core::Hello.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-25 01:20:30 +09:00
9f7b0c2f46
internal/pipewire: add type constants
...
This change also centralises encoding testing.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-24 22:00:09 +09:00
3e87187c4c
internal/pipewire: implement message header
...
Test cases are from interactions between pw-container and PipeWire. Results are validated against corresponding body.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-23 16:20:35 +09:00
b651d95e77
workflows: do not duplicate on pulls
...
This condition causes two runs to be created on a pull, as gitea does not check whether a run has already been created for the current commit.
Signed-off-by: Ophestra <cat@gensokyo.uk >
2025-11-19 06:59:32 +09:00