pub struct TranscodeContext {
pub decoder: Box<dyn FrameDecoder>,
pub filter_graph: FilterGraph,
pub encoder: Box<dyn FrameEncoder>,
}Expand description
Wires a FrameDecoder, FilterGraph, and FrameEncoder together into
a single execute loop.
§Execute loop
while !decoder.eof() {
frame = decoder.decode_next()
filtered = filter_graph.apply(frame)
encoded = encoder.encode_frame(filtered)
accumulate stats
}
encoder.flush()Fields§
§decoder: Box<dyn FrameDecoder>The frame decoder (source).
filter_graph: FilterGraphThe filter graph applied between decode and encode.
encoder: Box<dyn FrameEncoder>The frame encoder (sink).
Implementations§
Source§impl TranscodeContext
impl TranscodeContext
Sourcepub fn new(
decoder: Box<dyn FrameDecoder>,
filter_graph: FilterGraph,
encoder: Box<dyn FrameEncoder>,
) -> Self
pub fn new( decoder: Box<dyn FrameDecoder>, filter_graph: FilterGraph, encoder: Box<dyn FrameEncoder>, ) -> Self
Creates a new context.
Sourcepub fn execute(&mut self) -> Result<TranscodeStats>
pub fn execute(&mut self) -> Result<TranscodeStats>
Execute the full decode → filter → encode pipeline loop.
Returns TranscodeStats containing per-frame counts, byte totals,
and wall-clock timing.
§Errors
Returns an error if encoding or filter operations fail.
Auto Trait Implementations§
impl Freeze for TranscodeContext
impl !RefUnwindSafe for TranscodeContext
impl Send for TranscodeContext
impl !Sync for TranscodeContext
impl Unpin for TranscodeContext
impl UnsafeUnpin for TranscodeContext
impl !UnwindSafe for TranscodeContext
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> 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