Skip to main content

Module sink

Module sink 

Source
Expand description

What a capture hands its consumer, and the traits a consumer implements to receive it. What a capture hands its consumer, and the traits a consumer implements to receive it: the encoded frames of a capture ([FrameSink]), the pointer’s image as it changes ([CursorSink]), the clipboard a client application copies to ([ClipboardSink]), and the selection of an application compositor watched from outside ([SelectionWatch]).

Every sink is called on a thread pixelflux owns and never on a capture or compositor thread: a capture’s deliver thread hands frames one batch at a time with one batch in flight, so a consumer that blocks holds the encoder back by exactly one frame and loses none; cursor images come from the wl-cursor worker or the X11 cursor monitor, clipboard contents from a reader thread per copy. The Python bridge implements each trait by taking the GIL and calling the registered callable; a Rust host implements it directly, or hands a closure, which every trait here accepts.

Re-exports§

pub use crate::encoders::reference::Reference;
pub use crate::encoders::software::EncodedStripe as Frame;
pub use crate::encoders::software::FrameTiming;

Structs§

CursorImage
The pointer’s image as the compositor or the X server shows it.

Traits§

ClipboardSink
A consumer of what client applications copy to the compositor’s clipboard.
CursorSink
A consumer of cursor images.
FrameSink
A consumer of the frames a capture encodes.
SelectionWatch
A consumer of the selection changes of an application compositor watched over its own socket (ScreenCapture::clipboard_watch_app).