Skip to main content

Module pipewire

Module pipewire 

Source
Expand description

PipeWire sink: the camera as a Video/Source node.

Where a PipeWire daemon is reachable, the same frames that feed the interposer ring are also offered as a PipeWire camera node, which PipeWire-native consumers (GStreamer pipewiresrc, portal-aware applications) link to directly and which pipewire-v4l2 exposes as a V4L2 device to plain libc consumers. libpipewire-0.3 is loaded at run time and the SPA pods are built by hand, so pixelflux keeps no build-time or load-time dependency on PipeWire and the sink simply stays off where the library or the daemon is absent.

The stream is the graph driver: every published frame is copied into the node’s latest-frame slot and one graph cycle is triggered; the process callback then fills whatever buffer the consumers negotiated (memfd-backed, mapped for us) from that slot. The library binding and the pod encoding live in crate::pipewire, shared with the portal screen capture.

StructsΒ§

PipeWireSink
Shared πŸ”’
State shared with the stream callbacks (handed to PipeWire as the listener’s user data).

FunctionsΒ§

buffers_pod πŸ”’
SPA_PARAM_Buffers answered once the format is chosen: memfd (or plain memory) buffers of exactly one frame.
format_pod πŸ”’
SPA_PARAM_EnumFormat: one video format at the device size and rate β€” raw with the given SPA pixel format, or video/mjpg for the MJPEG device (spa_format None).
meta_pod πŸ”’
on_param_changed πŸ”’ ⚠
on_process πŸ”’ ⚠
on_state_changed πŸ”’ ⚠
spa_video_format πŸ”’