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>
impl<E: VideoEncoder, M: Muxer, D: Destination, R: OperationPolicy> StagedEncode<E, M, D, R>
Sourcepub fn new(
encoder: E,
mux: M,
destination: D,
resolver: R,
storage: StorageBudget,
pulse: Option<&dyn Pulse>,
) -> Result<Self, At<Failure>>
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.
Sourcepub fn with_staging(
encoder: E,
mux: M,
destination: D,
resolver: R,
staging: Staging,
pulse: Option<&dyn Pulse>,
) -> Result<Self, At<Failure>>
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.
Sourcepub fn with_policy_set(self, preset: PolicySet) -> Self
👎Deprecated: Pass PolicySet or BoundPolicy as the operation policy argument
pub fn with_policy_set(self, preset: PolicySet) -> Self
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.
Sourcepub fn report(&self) -> &OperationReport
pub fn report(&self) -> &OperationReport
Bounded decisions, including after a terminal failure.
Sourcepub fn push(
&mut self,
input: Frame,
pulse: Option<&dyn Pulse>,
) -> Result<(), At<Failure>>
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.
Sourcepub 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>>
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.
Sourcepub fn finish(self, pulse: Option<&dyn Pulse>) -> Result<Completed, At<Failure>>
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.