pub struct PerTrack {
pub stream_index: usize,
pub decoder: Box<dyn FrameDecoder>,
pub filter_graph: FilterGraph,
pub encoder: Box<dyn FrameEncoder>,
pub flushed: bool,
pub encoded_bytes: u64,
pub encoded_frames: u64,
/* private fields */
}Expand description
One logical media track wired through decode → filter → encode.
Created by the caller with concrete decoder, filter graph, and encoder
implementations, then handed to MultiTrackExecutor::add_track.
Fields§
§stream_index: usizeThe stream index in the output muxer for packets from this track.
decoder: Box<dyn FrameDecoder>Decoder for this track.
filter_graph: FilterGraphFilter graph applied between decode and encode.
encoder: Box<dyn FrameEncoder>Encoder for this track.
flushed: booltrue when the decoder has reported EOF and the encoder has been flushed.
encoded_bytes: u64Accumulated encoded-bytes count (public for stats queries).
encoded_frames: u64Accumulated encoded-frame count (public for stats queries).
Implementations§
Source§impl PerTrack
impl PerTrack
Sourcepub fn new(
stream_index: usize,
decoder: Box<dyn FrameDecoder>,
filter_graph: FilterGraph,
encoder: Box<dyn FrameEncoder>,
) -> Self
pub fn new( stream_index: usize, decoder: Box<dyn FrameDecoder>, filter_graph: FilterGraph, encoder: Box<dyn FrameEncoder>, ) -> Self
Create a new PerTrack with the given stream index, decoder,
filter graph, and encoder.
Sourcepub fn new_typed(
stream_index: usize,
decoder: Box<dyn FrameDecoder>,
filter_graph: FilterGraph,
encoder: Box<dyn FrameEncoder>,
is_audio: bool,
) -> Self
pub fn new_typed( stream_index: usize, decoder: Box<dyn FrameDecoder>, filter_graph: FilterGraph, encoder: Box<dyn FrameEncoder>, is_audio: bool, ) -> Self
Create a new PerTrack whose track type is known at construction.
Use this constructor when the stream kind (audio vs video) is
available from the container’s StreamInfo before decoding starts,
so that flush_encoder emits packets with the correct type even if
no frames were decoded (e.g., a very short audio track).
Auto Trait Implementations§
impl Freeze for PerTrack
impl !RefUnwindSafe for PerTrack
impl Send for PerTrack
impl !Sync for PerTrack
impl Unpin for PerTrack
impl UnsafeUnpin for PerTrack
impl !UnwindSafe for PerTrack
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
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>
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>
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