This is at a point considered to be already "within" the container. Daemons internal to the container can be started here.
Signed-off-by: Ophestra <cat@gensokyo.uk>
These are for #26. None of them are implemented yet. This fixes up test cases for the change to happen. Existing source code and JSON configuration continue to have the same effect. Existing flags get its EPulse bit replaced by EPipeWire.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Tests for this Op happens to be the best out of everything due to the robust infrastructure offered by internal/pipewire.
This is now ready to use in internal/outcome for implementing #26.
Signed-off-by: Ophestra <cat@gensokyo.uk>
There is currently no known message that will get the PipeWire server to emit this event. It should be handled regardless.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This adds checking of FileCount while writing a message. Message encoding is relocated to an exported method to be used externally, probably for test stubbing.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This behaviour is a bit messy and checks what appears to be a windows-specific environment variable for some reason. Keeping everything intact regardless to match upstream behaviour.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This sets up close pipe and socket internally, and exposes the resulting pathname socket and close_fd cleanup as an io.Closer.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This is not guaranteed to have completed after a roundtrip. This is leftover from when Roundtrip also sent and waited for sync.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This should not be handled on every receive as it could cause valid (though impossible in current upstream implementation) messages to be rejected and raise a protocol error.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This change fixes handling of non-fatal errors during a roundtrip as there can be multiple receive calls per roundtrip.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This name is more correct since it does not roundtrip, but receives messages. This is also more consistent with the method on event proxies.
Signed-off-by: Ophestra <cat@gensokyo.uk>
The PipeWire protocol does not work with Go abstractions. This change makes relevant methods call sendmsg/recvmsg directly.
Signed-off-by: Ophestra <cat@gensokyo.uk>
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>
These are mostly small formatting changes, with the biggest change being to UnexpectedEOFError where its kind is now described as part of the error type.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This should make things easier to navigate, and possible to fully automatically generate the constants in the future.
Signed-off-by: Ophestra <cat@gensokyo.uk>
These errors are recoverable and should not terminate event handling. Only terminate event handling for protocol errors or inconsistent state that makes further event handling impossible.
Signed-off-by: Ophestra <cat@gensokyo.uk>
These proxies (with special cases documented in the implementation) are only safe for use after acknowledgement from the server.
Signed-off-by: Ophestra <cat@gensokyo.uk>
This consumes the entire sample, is validated to send identical messages and correctly handle received messages.
Signed-off-by: Ophestra <cat@gensokyo.uk>
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>
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>
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>
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>