Signatures from this revision · bodies omitted
Trait methodszencodec::encode::Encoder
pub trait Encoder: Sized {
type Error: core::error::Error + Send + Sync + 'static;
fn begin_declared(
&mut self,
_declaration: &crate::encode::EncodeDeclaration<'_>,
) -> Result<crate::encode::EncodePlan, Self::Error>;
fn begin_output(
&mut self,
width: u32,
height: u32,
descriptor: PixelDescriptor,
access: crate::output_patch::OutputAccess,
) -> Result<crate::encode::OutputTiming, Self::Error>;
fn pull_rows(
&mut self,
_rows: &mut dyn crate::encode::EncodeRows,
_pulse: Option<&dyn crate::Pulse>,
) -> Result<crate::encode::PullProgress, Self::Error>;
fn finish_output(self) -> Result<crate::output_patch::OutputFinish<EncodeOutput>, Self::Error>;
}
Selected methods · 11 more in the full contract.
Required methods: reject, encode. Other methods have defaults; read them before relying on their behavior.
Read defaults, imports and full contract ↗Inherent methodszencodec::encode::OutputTiming
impl OutputTiming {
pub const fn with_patches(mut self) -> Self;
pub const fn patches_at_finish(&self) -> bool;
}
Selected methods · 3 more in the full contract.
Read defaults, imports and full contract ↗Inherent methodszencodec_media::staged::StagedEncode (std)
impl<E: VideoEncoder, M: Muxer, D: Destination, R: OperationPolicy> StagedEncode<E, M, D, R> {
pub fn new(
encoder: E,
mux: M,
destination: D,
resolver: R,
storage: StorageBudget,
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<Self, At<Failure>>;
pub fn with_staging(
encoder: E,
mux: M,
destination: D,
resolver: R,
staging: Staging,
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<Self, At<Failure>>;
pub fn with_policy_set(mut self, preset: PolicySet) -> Self;
pub fn report(&self) -> &OperationReport;
pub fn is_failed(&self) -> bool;
pub fn push(
&mut self,
input: Frame,
pulse: Option<&dyn zencodec::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 zencodec::Pulse>,
) -> Result<(), At<Failure>>;
pub fn finish(mut self, pulse: Option<&dyn zencodec::Pulse>) -> Result<Completed, At<Failure>>;
}
Selected methods · 2 more in the full contract.
Read defaults, imports and full contract ↗Function · zencodec-io feature: stdzencodec_io::row_encode::encode (std)
pub fn encode<E: Encoder, S: Source, W: Write, R: OperationPolicy>(
encoder: E,
source: S,
writer: W,
resolver: R,
options: Options,
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<Completed, At<Failure>>;
pub fn encode_to_destination<E: Encoder, S: Source, D: Destination, R: OperationPolicy>(
encoder: E,
source: S,
writer: D,
resolver: R,
options: Options,
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<Completed, At<Failure>>;
Selected methods · 11 more in the full contract.
Read defaults, imports and full contract ↗Trait methods · zencodec-io feature: stdzencodec_io::row_encode::Source
pub trait Source {
type Error: Error + Send + Sync + 'static;
fn description(&self) -> Description;
fn mechanism(&self) -> OutputSource;
fn read_rows(
&mut self,
first: u32,
rows: PixelSliceMut<'_>,
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<(), Self::Error>;
}
Selected methods · 3 more in the full contract.
Required methods: description, read_rows. Other methods have defaults; read them before relying on their behavior.
Read defaults, imports and full contract ↗Type definition · zencodec-io feature: stdzencodec_io::row_encode::Description
pub struct Description {
/// Width in samples.
pub width: u32,
/// Total rows.
pub height: u32,
/// Complete sample descriptor accepted by the configured encoder.
pub descriptor: PixelDescriptor,
/// Original color context carried on every source and encoder row view.
pub color_context: Option<Arc<ColorContext>>,
/// Optional assertion about current canonical samples, checked before push.
/// `Some` is strict: unsupported layouts refuse before startup, including
/// full-storage CMYK claims. `None` does not restrict sample depth.
/// It does not prove the encoder preserves samples or bound native memory.
pub exact_depth: Option<ExactDepth>,
}
Read defaults, imports and full contract ↗Inherent methods · zencodec-io feature: stdzencodec_io::row_encode::Raster
impl<'a> Raster<'a> {
pub const fn new(pixels: PixelSlice<'a>) -> Self;
}
Read defaults, imports and full contract ↗Inherent methods · zencodec-io feature: stdzencodec_io::row_encode::Options
impl Options {
pub fn new(storage: StorageBudget, max_output_bytes: u64) -> Self;
pub fn with_batch_rows(mut self, rows: NonZeroU32) -> Self;
pub fn with_policy_set(mut self, preset: PolicySet) -> Self;
pub fn with_disk_staging(
mut self,
mut file: File,
replay_bytes: NonZeroUsize,
) -> io::Result<Self>;
}
Selected methods · 1 more in the full contract.
Read defaults, imports and full contract ↗Type definition · zencodec-io feature: stdzencodec_io::row_encode::Failure
pub struct Failure {
/// Boundary that failed.
pub stage: Stage,
/// Confirmed destination appends, including partial writes.
pub emitted: u64,
/// Confirmed overwritten bytes, separate from appended extent.
pub patched_bytes: u64,
/// Bounded policy history, including after later source/codec/I/O failure.
pub report: Box<OperationReport>,
cause: Cause,
}
Read defaults, imports and full contract ↗Functionzencodec::operation::resolve_output_schedule
pub fn resolve_output_schedule<R: OperationPolicy + ?Sized>(
facts: OutputScheduleFacts,
offers: &[OutputScheduleOffer],
resolver: &mut R,
preset: PolicySet,
pulse: Option<&dyn crate::Pulse>,
) -> Result<(usize, DecisionRecord), At<PolicyFailure>>;
Read defaults, imports and full contract ↗Type definitionzencodec::operation::OutputScheduleOffer
pub struct OutputScheduleOffer {
/// Mechanism executed if this route is selected.
pub schedule: OutputSchedule,
/// Actual compressed-output store; None means no staging evidence.
pub staging: Option<super::StagingFacts>,
/// Qualified upper bound on all route-retained memory during destination
/// waits: source, codec, conversion, metadata, scratch and compressed data.
/// Include caller input retained by the route's borrows. Excludes unrelated
/// caller state and the destination's own allocations. None is unknown.
/// This is not peak-operation memory, disk use, or a measured estimate.
pub wait_retained_upper_bound: Option<u64>,
}
Read defaults, imports and full contract ↗Type definitionzencodec::operation::OutputScheduleFacts
pub struct OutputScheduleFacts {
/// Actual configured encoder's byte availability after begin.
pub timing: OutputTiming,
/// Actual source acquisition/ownership mechanism.
pub source: OutputSource,
}
Read defaults, imports and full contract ↗Inherent methodszencodec::operation::PolicySet
impl PolicySet {
pub const fn new() -> Self;
pub const fn prefer_lossless(mut self, enabled: bool) -> Self;
pub const fn require_metadata(mut self, treatment: MetadataTransfer) -> Self;
pub const fn allow_opaque_profiles(mut self, allowed: bool) -> Self;
pub const fn with_workspace_limit(mut self, bytes: u64) -> Self;
pub const fn allow_assumed_chroma_siting(mut self, allowed: bool) -> Self;
pub const fn require_extended_range(mut self, required: bool) -> Self;
pub const fn require_output_schedule(mut self, schedule: super::OutputSchedule) -> Self;
pub const fn with_output_wait_limit(mut self, bytes: u64) -> Self;
}
Selected methods · 6 more in the full contract.
Read defaults, imports and full contract ↗Inherent methodszencodec_media::staging::Staging (std)
impl Staging {
pub fn memory(budget: StorageBudget) -> Self;
pub fn disk(mut file: File, limits: DiskLimits, replay: StorageBudget) -> Result<Self, Cause>;
pub fn facts(&self) -> StagingFacts;
}
Selected methods · 4 more in the full contract.
Read defaults, imports and full contract ↗Type definitionzencodec_media::staging::DiskLimits
pub struct DiskLimits {
/// Total packet and addition bytes appended after the scratch origin.
pub max_bytes: u64,
/// Maximum number of staged packets.
pub max_packets: usize,
/// Maximum side-data entries on each packet, including empty entries.
pub max_additions_per_packet: usize,
}
Read defaults, imports and full contract ↗Type definitionzencodec_media::staged::Failure
pub struct Failure {
/// Failed boundary.
pub stage: Stage,
/// Confirmed destination appends, excluding spool writes and patch overwrites.
/// Failed final patches can also leave partial overwrites; inspect the cause.
pub emitted: u64,
/// Decisions up to this failure.
pub report: Box<OperationReport>,
cause: Cause,
}
Read defaults, imports and full contract ↗Trait methodszencodec_media::session::VideoEncoder::output_fidelity
pub trait VideoEncoder {
type Error: core::error::Error + Send + Sync + 'static;
fn output_config(&self) -> Option<&CodecConfig>;
fn output_fidelity(&self) -> Option<zencodec::encode::Fidelity>;
}
Selected methods · 3 more in the full contract.
Required methods: send, receive, end_input, output_config. Other methods have defaults; read them before relying on their behavior.
Read defaults, imports and full contract ↗Type definitionzencodec_media::staged::Refusal
pub enum Refusal {
/// Encoder cannot declare its container configuration before input.
ConfigurationUnavailable,
/// Configuration does not describe video.
VideoConfigurationRequired,
/// Conversion's bounded facts disagree with its full target.
OfferMismatch,
/// Conversion returned different interpretation or timing.
ConversionMismatch,
/// Encoder promised pending output but did not return a packet.
ReceivePendingWithoutPacket,
/// Encoder ended before the caller finished input.
EarlyEnd,
/// Encoder changed the configuration or fidelity bound at preparation.
ConfigurationChanged,
/// Encoder requested input after end_input.
InputAfterEnd,
/// Encoder returned an empty or taken packet.
EmptyPacket,
/// Operation previously failed or unwound.
Terminal,
/// No input frame completed policy admission. Empty output is unsupported.
NoAdmittedFrames,
/// The legacy preset setter was called after input had been accepted.
PolicyChangedAfterInput,
}
Read defaults, imports and full contract ↗Trait methodszencodec_media::container::Muxer
pub trait Muxer {
type Error: core::error::Error + Send + Sync + 'static;
fn begin_exact_timing(
&mut self,
tracks: &[TrackInfo],
hint: MuxHint,
) -> Result<MuxTiming, SessionError<Self::Error>>;
fn write_packet(
&mut self,
packet: Packet,
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<(), SessionError<Self::Error>>;
}
Selected methods · 5 more in the full contract.
Required methods: begin, write_packet, pending_output, consume_output, take_output, finish. Other methods have defaults; read them before relying on their behavior.
Read defaults, imports and full contract ↗Inherent methodszencodec_media::output::PreparedOutput (std)
impl<M: Muxer, D: Destination> PreparedOutput<M, D> {
pub fn new(
mux: M,
destination: D,
tracks: &[TrackInfo],
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<Self, Failure>;
pub const fn timing(&self) -> MuxTiming;
pub fn facts(&self) -> DestinationFacts;
pub fn publish(self, pulse: Option<&dyn zencodec::Pulse>) -> Result<Output<M, D>, Failure>;
}
Selected methods · 1 more in the full contract.
Read defaults, imports and full contract ↗Inherent methodszencodec_media::output::Output (std)
impl<M: Muxer, D: Destination> Output<M, D> {
pub fn new(
mux: M,
destination: D,
tracks: &[TrackInfo],
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<Self, Failure>;
pub fn with_container_timing(
mux: M,
destination: D,
tracks: &[TrackInfo],
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<Self, Failure>;
pub fn facts(&self) -> DestinationFacts;
pub const fn stats(&self) -> &Stats;
pub fn send(
&mut self,
packet: Packet,
pulse: Option<&dyn zencodec::Pulse>,
) -> Result<(), Failure>;
pub fn finish(mut self, pulse: Option<&dyn zencodec::Pulse>) -> Result<Stats, Failure>;
}
Selected methods · 6 more in the full contract.
Read defaults, imports and full contract ↗Inherent methodszencodec_io::destination::SeekBack (std; also re-exported by media)
impl<W: Write + Seek> SeekBack<W> {
pub fn new(mut writer: W) -> io::Result<Self>;
}
Read defaults, imports and full contract ↗