moq_video/resize.rs
1//! Frame resizing options.
2
3use crate::{Device, Output};
4
5/// Options for [`Frame::resize`](crate::Frame::resize).
6///
7/// Build with `Config::default()` and set fields, so future options stay
8/// additive.
9#[derive(Clone, Debug, Default, PartialEq, Eq)]
10#[non_exhaustive]
11pub struct Config {
12 /// Where the scaled pixels live.
13 ///
14 /// [`Output::Native`] scales a GPU surface on its own device, downloading
15 /// and scaling on the CPU only when the device refuses. [`Output::Cpu`]
16 /// downloads first and always scales on the CPU. [`Output::Render`] is
17 /// `Native` for a surface `render::Renderer` imports and `Cpu` otherwise.
18 pub output: Output,
19 /// The render node that scales a DMA-BUF. [`Device::Auto`] (the default)
20 /// uses the node the VA-API codecs share; name the encoder's node so the
21 /// scaled buffer imports into it without a copy. Every other surface scales
22 /// on the device that holds it, so this names nothing for them.
23 pub device: Device,
24}