pub struct SegmentSpec {
pub index: u32,
pub start_ms: u64,
pub duration_ms: u64,
pub codec: String,
pub frame_data: Vec<u8>,
pub width: u32,
pub height: u32,
}Expand description
A specification for one segment in a parallel encode batch.
The caller describes the segment (start/duration/codec) and provides raw pixel/sample data. The encoder executes each spec independently, which allows rayon to encode all segments concurrently.
Fields§
§index: u32Zero-based segment index.
start_ms: u64Start time in milliseconds.
duration_ms: u64Duration in milliseconds.
codec: StringCodec identifier string (e.g. "av1", "vp9").
frame_data: Vec<u8>Raw frame data for this segment (RGBA bytes, row-major).
width: u32Frame width in pixels.
height: u32Frame height in pixels.
Implementations§
Source§impl SegmentSpec
impl SegmentSpec
Sourcepub fn new(
index: u32,
start_ms: u64,
duration_ms: u64,
codec: impl Into<String>,
frame_data: Vec<u8>,
width: u32,
height: u32,
) -> Self
pub fn new( index: u32, start_ms: u64, duration_ms: u64, codec: impl Into<String>, frame_data: Vec<u8>, width: u32, height: u32, ) -> Self
Creates a new segment specification.
Sourcepub fn expected_frame_bytes(&self) -> usize
pub fn expected_frame_bytes(&self) -> usize
Expected byte length for the RGBA frame data.
Sourcepub fn frame_data_valid(&self) -> bool
pub fn frame_data_valid(&self) -> bool
Returns true if the frame data matches the expected dimensions.
Trait Implementations§
Source§impl Clone for SegmentSpec
impl Clone for SegmentSpec
Source§fn clone(&self) -> SegmentSpec
fn clone(&self) -> SegmentSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SegmentSpec
impl RefUnwindSafe for SegmentSpec
impl Send for SegmentSpec
impl Sync for SegmentSpec
impl Unpin for SegmentSpec
impl UnsafeUnpin for SegmentSpec
impl UnwindSafe for SegmentSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more