Skip to main content

BorrowedVideoFrameBuilder

Struct BorrowedVideoFrameBuilder 

Source
pub struct BorrowedVideoFrameBuilder<'buf> { /* private fields */ }
Expand description

Builder for a borrowed uncompressed video frame. No pixels or metadata are copied.

Implementations§

Source§

impl<'buf> BorrowedVideoFrameBuilder<'buf>

Source

pub fn line_stride(self, stride: i32) -> Self

Set first-plane stride in bytes. Zero selects the packed stride.

Source

pub fn frame_rate(self, numerator: i32, denominator: i32) -> Self

Set the positive frame-rate numerator and denominator.

Source

pub fn picture_aspect_ratio(self, ratio: f32) -> Self

Set a finite nonnegative aspect ratio; zero selects square pixels.

Source

pub fn scan_type(self, scan_type: ScanType) -> Self

Select progressive, interlaced, or field scanning.

Source

pub fn timecode(self, timecode: i64) -> Self

Set the timecode in 100 ns units, including literal zero.

Source

pub fn metadata(self, metadata: &'buf CStr) -> Self

Borrow NUL-terminated UTF-8 metadata, validated when built.

Source

pub fn timestamp(self, timestamp: i64) -> Self

Set the SDK timestamp, including literal zero.

Source

pub fn build(self) -> Result<BorrowedVideoFrame<'buf>>

Validate dimensions, stride, initialized slice extent, headers, and metadata. Successful construction allocates nothing. Invalid layout/header values or metadata exceeding the 4 MiB cap return Error::InvalidFrame; invalid metadata UTF-8 returns Error::InvalidUtf8. The input slices remain borrowed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.