Skip to main content

create_decoder_on

Function create_decoder_on 

Source
pub fn create_decoder_on(
    codec: &str,
    info: StreamInfo,
    gpu_index: Option<u32>,
) -> Result<Box<dyn Decoder>>
Expand description

Construct a decoder pinned to a specific gpu_index when one is supplied. None preserves the legacy “pick the first matching adapter” behaviour for one-shot callers (thumbnails, tests, benches) that don’t care about distributing work across physical GPUs.

The pipeline’s per-rung decode pumps should ALWAYS pass Some(idx) so each rung’s decode session lands on a distinct adapter — without this, every QSV session piles onto the first physical Intel card regardless of what the GPU pool’s lease said. See the project memo on QSV multi-adapter session pinning.