pub fn select_frame_encoder(
settings: &mut CaptureSettings,
source: FrameSource,
prior: Option<FrameEncoder>,
tag: &str,
) -> Option<FrameEncoder>Expand description
Choose and build the full-frame encoder of a session, or None when the CPU path
(software::encode_cpu) serves it: JPEG, or H.264 through the build’s software encoder. One ladder for X11, Wayland zero-copy, and Wayland readback, so the three
cannot pick differently for the same settings:
- Unless software encoding is forced (
use_cpu, or encode node-1), the hardware backend the encode node’s driver selects — NVENC on the NVIDIA driver, VA-API otherwise, and on a Jetson the vendor V4L2 encoder before either, since that board publishes no render node driver to select on. A compatible NVENC session handed over inprioris reconfigured in place instead of rebuilt. A hardware refusal is logged and falls through. - A dmabuf source stops here: software cannot read dmabufs, and the caller’s readback path then runs this ladder again with host frames.
- The software encoder of the codec, except JPEG and H.264, whose software path is the CPU path’s.
- Where the codec has no path at all, the other video codecs this host serves, the encode
node’s hardware ones before the build’s software ones, software H.264 among the latter,
and JPEG only past all of them.
settings.codecnames what came up.