pub struct VideoFrameBuilder { /* private fields */ }Expand description
Builder for configuring a VideoFrame with ergonomic method chaining
Implementations§
Source§impl VideoFrameBuilder
impl VideoFrameBuilder
Sourcepub fn resolution(self, width: i32, height: i32) -> Self
pub fn resolution(self, width: i32, height: i32) -> Self
Set the video resolution. Width must be positive and even; height must be positive (and even for 4:2:0 formats).
Sourcepub fn pixel_format(self, pixel_format: PixelFormat) -> Self
pub fn pixel_format(self, pixel_format: PixelFormat) -> Self
Set the pixel format
Sourcepub fn frame_rate(self, numerator: i32, denominator: i32) -> Self
pub fn frame_rate(self, numerator: i32, denominator: i32) -> Self
Set the frame rate as a fraction (e.g., 30000/1001 for 29.97fps)
Sourcepub fn aspect_ratio(self, ratio: f32) -> Self
pub fn aspect_ratio(self, ratio: f32) -> Self
Set the picture aspect ratio
Sourcepub fn scan_type(self, scan_type: ScanType) -> Self
pub fn scan_type(self, scan_type: ScanType) -> Self
Set the scan type (progressive, interlaced, etc.)
Sourcepub fn timecode(self, tc: i64) -> Self
pub fn timecode(self, tc: i64) -> Self
Set the timecode in 100 ns units (or the SDK synthesis sentinel).
Sourcepub fn timestamp(self, ts: i64) -> Self
pub fn timestamp(self, ts: i64) -> Self
Set the timestamp field in 100 ns units. This field is filled by the SDK on receive.
Sourcepub fn data(self, data: Vec<u8>) -> Self
pub fn data(self, data: Vec<u8>) -> Self
Supply owned pixels without an intermediate zero-filled allocation.
build requires exactly the validated layout size and retains this
allocation unchanged. Use data_mut on the resulting frame for reuse.
Sourcepub fn build(self) -> Result<VideoFrame>
pub fn build(self) -> Result<VideoFrame>
Build the video frame.
Defaults to 1920x1080 BGRA, 60/1 fps, 16:9 picture aspect ratio, progressive scan, synthesized timecode, and zero-filled pixels.
Trait Implementations§
Source§impl Clone for VideoFrameBuilder
impl Clone for VideoFrameBuilder
Source§fn clone(&self) -> VideoFrameBuilder
fn clone(&self) -> VideoFrameBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more