#[non_exhaustive]pub struct Frame {
pub timestamp: Timestamp,
pub surface: Surface,
}Expand description
One raw (uncompressed) video frame: the pixels plus when they are shown.
The currency of the crate’s raw side: capture sources and
decode produce these, and
encode::Encoder::encode consumes them,
handing back the compressed encode::Encoded.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.timestamp: TimestampPresentation timestamp. It rides through the encoder with the picture, so a backend that buffers or reorders still stamps each packet with the time of the frame it actually encoded. Capture streams use a monotonic timeline private to that stream; turnkey publishing maps it to the broadcast clock.
surface: SurfaceThe pixels, and where they currently live.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn resize(&self, size: Size, config: &Config) -> Result<Frame, Error>
pub fn resize(&self, size: Size, config: &Config) -> Result<Frame, Error>
A copy of this frame scaled to exactly size (both dimensions even and
non-zero), preserving the timestamp. GPU-backed surfaces scale on the GPU
and stay there unless config says otherwise. The exact-size operation;
decode::Config::scale_hint is the
best-effort request that lets a decoder with a hardware scaler skip it.