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>
impl<'buf> BorrowedVideoFrameBuilder<'buf>
Sourcepub fn line_stride(self, stride: i32) -> Self
pub fn line_stride(self, stride: i32) -> Self
Set first-plane stride in bytes. Zero selects the packed stride.
Sourcepub fn frame_rate(self, numerator: i32, denominator: i32) -> Self
pub fn frame_rate(self, numerator: i32, denominator: i32) -> Self
Set the positive frame-rate numerator and denominator.
Sourcepub fn picture_aspect_ratio(self, ratio: f32) -> Self
pub fn picture_aspect_ratio(self, ratio: f32) -> Self
Set a finite nonnegative aspect ratio; zero selects square pixels.
Sourcepub fn scan_type(self, scan_type: ScanType) -> Self
pub fn scan_type(self, scan_type: ScanType) -> Self
Select progressive, interlaced, or field scanning.
Sourcepub fn timecode(self, timecode: i64) -> Self
pub fn timecode(self, timecode: i64) -> Self
Set the timecode in 100 ns units, including literal zero.
Sourcepub fn metadata(self, metadata: &'buf CStr) -> Self
pub fn metadata(self, metadata: &'buf CStr) -> Self
Borrow NUL-terminated UTF-8 metadata, validated when built.
Sourcepub fn build(self) -> Result<BorrowedVideoFrame<'buf>>
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§
impl<'buf> Freeze for BorrowedVideoFrameBuilder<'buf>
impl<'buf> RefUnwindSafe for BorrowedVideoFrameBuilder<'buf>
impl<'buf> Send for BorrowedVideoFrameBuilder<'buf>
impl<'buf> Sync for BorrowedVideoFrameBuilder<'buf>
impl<'buf> Unpin for BorrowedVideoFrameBuilder<'buf>
impl<'buf> UnsafeUnpin for BorrowedVideoFrameBuilder<'buf>
impl<'buf> UnwindSafe for BorrowedVideoFrameBuilder<'buf>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more