pub struct FrameLimits { /* private fields */ }Expand description
What one decoded frame may cost.
Carried by every session that decodes frames and handed to the
conversion that copies them. See the module docs for why the
seats are finite and how Self::max_pixels reaches libavcodec as
well as this crate.
Implementations§
Source§impl FrameLimits
impl FrameLimits
Sourcepub const fn new() -> Self
pub const fn new() -> Self
The defaults: DEFAULT_MAX_PIXELS and
DEFAULT_MAX_FRAME_BYTES.
Sourcepub const fn max_pixels(&self) -> u64
pub const fn max_pixels(&self) -> u64
Most pixels one decoded frame may have.
Also written to AVCodecContext.max_pixels when a decoder is
opened from these limits, so libavcodec refuses an oversized
picture before allocating it.
Sourcepub const fn max_frame_bytes(&self) -> usize
pub const fn max_frame_bytes(&self) -> usize
Most bytes one decoded frame’s planes may export, together.
Sourcepub const fn max_image_side_data_bytes(&self) -> usize
pub const fn max_image_side_data_bytes(&self) -> usize
The ceiling on side data one decoded still may carry.
Sourcepub const fn with_max_pixels(self, value: u64) -> Self
pub const fn with_max_pixels(self, value: u64) -> Self
Sets the pixel ceiling (consuming builder).
Sourcepub const fn with_max_frame_bytes(self, value: usize) -> Self
pub const fn with_max_frame_bytes(self, value: usize) -> Self
Sets the per-frame byte ceiling (consuming builder).
Sourcepub const fn with_max_image_side_data_bytes(self, value: usize) -> Self
pub const fn with_max_image_side_data_bytes(self, value: usize) -> Self
Sets the decoded-still side-data ceiling (consuming builder).
Sourcepub const fn set_max_pixels(&mut self, value: u64) -> &mut Self
pub const fn set_max_pixels(&mut self, value: u64) -> &mut Self
Sets the pixel ceiling in place.
Sourcepub const fn set_max_frame_bytes(&mut self, value: usize) -> &mut Self
pub const fn set_max_frame_bytes(&mut self, value: usize) -> &mut Self
Sets the per-frame byte ceiling in place.
Sourcepub const fn set_max_image_side_data_bytes(&mut self, value: usize) -> &mut Self
pub const fn set_max_image_side_data_bytes(&mut self, value: usize) -> &mut Self
Sets the decoded-still side-data ceiling in place.
Trait Implementations§
Source§impl Clone for FrameLimits
impl Clone for FrameLimits
Source§fn clone(&self) -> FrameLimits
fn clone(&self) -> FrameLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more