pub struct DecoderLimits { /* private fields */ }Expand description
What opening and running one decoder may spend.
Composes FrameLimits — what the frames it produces may cost —
with the two things a decoder spends before it has produced
anything: copying the caller’s codec parameters into an
AVCodecContext, and copying the caller’s compressed bytes into an
AVPacket.
Taken at open by every decoder session in this crate, for the
reason FrameLimits gives: half of it is written into an
AVCodecContext whose ceilings cannot move after avcodec_open2.
Implementations§
Source§impl DecoderLimits
impl DecoderLimits
Sourcepub const fn frame(&self) -> FrameLimits
pub const fn frame(&self) -> FrameLimits
What one decoded frame may cost.
Sourcepub const fn max_codec_parameter_bytes(&self) -> usize
pub const fn max_codec_parameter_bytes(&self) -> usize
Most heap bytes the codec parameters this decoder is opened from may hold.
Enforced at the choke point every road into libavcodec passes through, so a decoder cannot be opened over parameters nobody measured.
Sourcepub const fn max_packet_bytes(&self) -> usize
pub const fn max_packet_bytes(&self) -> usize
Most compressed bytes one packet handed to a stream decoder may carry.
Sourcepub const fn packet_limits(&self) -> PacketLimits
pub const fn packet_limits(&self) -> PacketLimits
Self::max_packet_bytes as the PacketLimits the boundary
conversions take, so the send leg and the receive leg are handed
the same seat rather than two numbers that could drift.
Sourcepub const fn max_image_input_bytes(&self) -> usize
pub const fn max_image_input_bytes(&self) -> usize
Most compressed bytes one image decode may be handed. See
DEFAULT_MAX_IMAGE_INPUT_BYTES for why this is its own seat.
Sourcepub const fn with_frame(self, value: FrameLimits) -> Self
pub const fn with_frame(self, value: FrameLimits) -> Self
Sets the frame ceilings (consuming builder).
Sourcepub const fn with_max_codec_parameter_bytes(self, value: usize) -> Self
pub const fn with_max_codec_parameter_bytes(self, value: usize) -> Self
Sets the codec-parameter ceiling (consuming builder).
Sourcepub const fn with_max_packet_bytes(self, value: usize) -> Self
pub const fn with_max_packet_bytes(self, value: usize) -> Self
Sets the per-packet ceiling (consuming builder).
Sourcepub const fn with_max_image_input_bytes(self, value: usize) -> Self
pub const fn with_max_image_input_bytes(self, value: usize) -> Self
Sets the image-input ceiling (consuming builder).
Sourcepub const fn set_frame(&mut self, value: FrameLimits) -> &mut Self
pub const fn set_frame(&mut self, value: FrameLimits) -> &mut Self
Sets the frame ceilings in place.
Sourcepub const fn set_max_codec_parameter_bytes(&mut self, value: usize) -> &mut Self
pub const fn set_max_codec_parameter_bytes(&mut self, value: usize) -> &mut Self
Sets the codec-parameter ceiling in place.
Sourcepub const fn set_max_packet_bytes(&mut self, value: usize) -> &mut Self
pub const fn set_max_packet_bytes(&mut self, value: usize) -> &mut Self
Sets the per-packet ceiling in place.
Sourcepub const fn set_max_image_input_bytes(&mut self, value: usize) -> &mut Self
pub const fn set_max_image_input_bytes(&mut self, value: usize) -> &mut Self
Sets the image-input ceiling in place.
Trait Implementations§
Source§impl Clone for DecoderLimits
impl Clone for DecoderLimits
Source§fn clone(&self) -> DecoderLimits
fn clone(&self) -> DecoderLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more