pub(crate) fn teardown_capture(
cap: &mut WlCapture,
) -> (Option<JoinHandle<()>>, Option<JoinHandle<Option<FrameEncoder>>>)Expand description
Tear down a capture’s encode/delivery threads and pools, returning both join handles as
(deliver, encode) for the caller to place. NEITHER is joined here: this runs on the
calloop thread, which also dispatches Wayland clients and input, and either thread can be
parked behind a consumer still inside Python. A restart hands each handle to its
successor thread, which joins it off the event loop — the encode successor inheriting the
readback hardware session, the deliver successor keeping stripes in capture order across
the restart — and a plain stop hands both to the reaper. The zero-copy session (if any)
is left on the capture for the caller to reuse or drop, and so are the host frames its
thread may still be reading (release_host_inflight).