Skip to main content

StagedEncode

Struct StagedEncode 

Source
pub struct StagedEncode<E, M, D, R> { /* private fields */ }
Expand description

An owned, fixed-configuration video-to-container operation.

Failure or unwind makes it terminal and drops encoder, staged packets and private destination preparation. Push may write an explicit disk spool, but neither push nor drop writes the final destination. Finish consumes the operation and releases native state before the first destination write. No implicit segmentation, timing rewrite or fallback is performed.

Implementations§

Source§

impl<E: VideoEncoder, M: Muxer, D: Destination, R: OperationPolicy> StagedEncode<E, M, D, R>

Source

pub fn new( encoder: E, mux: M, destination: D, resolver: R, storage: StorageBudget, pulse: Option<&dyn Pulse>, ) -> Result<Self, At<Failure>>

Retain the encoder and prepare exact-timing output from its actual config. This single-video-track operation requires configuration before input. Unknown explicit workspace bounds refuse before reading encoder config or preparing the muxer. Supplied encoder/mux/store construction has already happened and is outside this admission boundary.

Source

pub fn with_staging( encoder: E, mux: M, destination: D, resolver: R, staging: Staging, pulse: Option<&dyn Pulse>, ) -> Result<Self, At<Failure>>

Retain an explicit compressed store. Disk staging may block while the encoder is alive; policy sees the selected mechanism before accepting each frame.

Source

pub fn with_policy_set(self, preset: PolicySet) -> Self

👎Deprecated:

Pass PolicySet or BoundPolicy as the operation policy argument

Preset consulted when the resolver returns UsePreset. During migration, these requirements and the policy argument both apply. A bound policy supplies preferences in place of these. Call before the first accepted frame. Calling it afterward makes the next push or finish refuse without publishing the staged output.

Source

pub fn report(&self) -> &OperationReport

Bounded decisions, including after a terminal failure.

Source

pub fn is_failed(&self) -> bool

Whether failure or unwind has made this operation unusable.

Source

pub fn push( &mut self, input: Frame, pulse: Option<&dyn Pulse>, ) -> Result<(), At<Failure>>

Send the exact held picture without conversion or timing changes. Prepared encoder fidelity is disclosed; native workspace remains unqualified.

Source

pub fn push_converted( &mut self, input: Frame, target: &FrameInterpretation, conversion: FrameConversionOffer, execute: impl FnOnce(Frame) -> Result<Frame, Cause>, pulse: Option<&dyn Pulse>, ) -> Result<(), At<Failure>>

Retain this input and selected converter through policy, then execute once. target is the complete required interpretation; timing comes from the offer. Output must match both exactly before reaching the encoder. The closure owns its prepared conversion/reservations; it must not publish.

Source

pub fn finish(self, pulse: Option<&dyn Pulse>) -> Result<Completed, At<Failure>>

Drain, release all owned encoder state, then publish the retained output. Writer failure may leave partial bytes; its concrete output failure and confirmed append count remain in the error chain. No retry is performed. An operation with no admitted input frames refuses before draining; empty-container publication has no supported admission route.

Auto Trait Implementations§

§

impl<E, M, D, R> Freeze for StagedEncode<E, M, D, R>
where R: Freeze, E: Freeze, D: Freeze, M: Freeze,

§

impl<E, M, D, R> RefUnwindSafe for StagedEncode<E, M, D, R>

§

impl<E, M, D, R> Send for StagedEncode<E, M, D, R>
where R: Send, E: Send, D: Send, M: Send,

§

impl<E, M, D, R> Sync for StagedEncode<E, M, D, R>
where R: Sync, E: Sync, D: Sync, M: Sync,

§

impl<E, M, D, R> Unpin for StagedEncode<E, M, D, R>
where R: Unpin, E: Unpin, D: Unpin, M: Unpin,

§

impl<E, M, D, R> UnsafeUnpin for StagedEncode<E, M, D, R>

§

impl<E, M, D, R> UnwindSafe for StagedEncode<E, M, D, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.