cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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
cat
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