pub struct MultiTrackExecutor<M: Muxer> { /* private fields */ }Expand description
Frame-level multi-track decode → filter → encode executor with DTS-ordered muxing.
§Usage
use oximedia_transcode::multi_track::{MultiTrackExecutor, PerTrack};
use oximedia_transcode::pipeline_context::{FilterGraph, Frame};
// Supply concrete FrameDecoder / FrameEncoder implementations:
let mut executor = MultiTrackExecutor::new(muxer);
executor.add_track(PerTrack::new(0, decoder0, FilterGraph::new(), encoder0));
executor.add_track(PerTrack::new(1, decoder1, FilterGraph::new(), encoder1));
let stats = executor.execute(&streams).await?;Implementations§
Source§impl<M: Muxer> MultiTrackExecutor<M>
impl<M: Muxer> MultiTrackExecutor<M>
Sourcepub fn set_flush_interval(&mut self, n: u64)
pub fn set_flush_interval(&mut self, n: u64)
Overrides the heap flush interval (default: 30 steps).
Sourcepub fn into_muxer(self) -> M
pub fn into_muxer(self) -> M
Consumes the executor and returns the inner muxer.
Sourcepub fn stats(&self) -> &MultiTrackStats
pub fn stats(&self) -> &MultiTrackStats
Returns the accumulated execution statistics.
Sourcepub async fn step(&mut self) -> Result<bool>
pub async fn step(&mut self) -> Result<bool>
Perform one step of the pipeline: attempt to decode one frame from every active track, filter and encode it, then push the result onto the DTS heap.
Periodically drains the heap to the muxer based on the minimum active DTS (safe-drain strategy).
Returns true if at least one track produced an encoded packet this
step, false when all tracks are exhausted.
§Errors
Propagates errors from the filter graph, encoder, or muxer.
Sourcepub async fn execute(
&mut self,
streams: &[StreamInfo],
) -> Result<MultiTrackStats>
pub async fn execute( &mut self, streams: &[StreamInfo], ) -> Result<MultiTrackStats>
Execute the full pipeline end-to-end.
- Registers
streamswith the muxer and writes the header. - Calls
stepin a loop until all tracks are exhausted. - Flushes each track’s encoder.
- Drains the remaining heap to the muxer in DTS order.
- Writes the muxer trailer.
Returns accumulated MultiTrackStats.
§Errors
Returns an error if any stage (filter, encode, mux header/packet/trailer) fails.
Auto Trait Implementations§
impl<M> Freeze for MultiTrackExecutor<M>where
M: Freeze,
impl<M> !RefUnwindSafe for MultiTrackExecutor<M>
impl<M> Send for MultiTrackExecutor<M>
impl<M> !Sync for MultiTrackExecutor<M>
impl<M> Unpin for MultiTrackExecutor<M>where
M: Unpin,
impl<M> UnsafeUnpin for MultiTrackExecutor<M>where
M: UnsafeUnpin,
impl<M> !UnwindSafe for MultiTrackExecutor<M>
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