pub struct AnimatedRenderedDecoder {
pub default_color: [u8; 4],
pub font_size_px: f32,
pub side_margin_px: u32,
pub bottom_margin_px: u32,
/* private fields */
}Expand description
Animated subtitle decoder. See module docs.
Fields§
§default_color: [u8; 4]Default text colour when no \c override is active.
font_size_px: f32Nominal font size in pixels passed to the shaper.
side_margin_px: u32Pixel margin between the canvas edge and the text bounding box.
bottom_margin_px: u32Pixel margin between the canvas bottom and the lowest baseline.
Implementations§
Source§impl AnimatedRenderedDecoder
impl AnimatedRenderedDecoder
Sourcepub fn new(
inner: Box<dyn Decoder>,
width: u32,
height: u32,
face: FaceChain,
) -> Self
pub fn new( inner: Box<dyn Decoder>, width: u32, height: u32, face: FaceChain, ) -> Self
Build a new AnimatedRenderedDecoder wrapping inner and
rendering at width × height using face.
Sourcepub fn set_offset_ms(&mut self, offset_ms: i32)
pub fn set_offset_ms(&mut self, offset_ms: i32)
Set the cue-relative time at which the next receive_frame
call will sample the animation. Subsequent calls keep this
offset until it’s changed.
Trait Implementations§
Source§impl Decoder for AnimatedRenderedDecoder
impl Decoder for AnimatedRenderedDecoder
fn codec_id(&self) -> &CodecId
Source§fn send_packet(&mut self, packet: &Packet) -> Result<()>
fn send_packet(&mut self, packet: &Packet) -> Result<()>
Feed one compressed packet. May or may not produce a frame immediately —
call
receive_frame in a loop afterwards.Source§fn receive_frame(&mut self) -> Result<Frame>
fn receive_frame(&mut self) -> Result<Frame>
Pull the next decoded frame, if any. Returns
Error::NeedMore when the
decoder needs another packet.Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Signal end-of-stream. After this,
receive_frame will drain buffered
frames and eventually return Error::Eof.Source§fn reset(&mut self) -> Result<()>
fn reset(&mut self) -> Result<()>
Discard all carry-over state so the decoder can resume from a new
bitstream position without producing stale output. Called by the
player after a container seek. Read more
Source§fn receive_arena_frame(&mut self) -> Result<Arc<FrameInner>, Error>
fn receive_arena_frame(&mut self) -> Result<Arc<FrameInner>, Error>
Pull the next decoded frame as an arena-backed
arena::sync::Frame. Read moreSource§fn set_execution_context(&mut self, _ctx: &ExecutionContext)
fn set_execution_context(&mut self, _ctx: &ExecutionContext)
Advisory: announce the runtime environment (today: a thread budget
for codec-internal parallelism). Called at most once, before the
first
send_packet. Default no-op; codecs that want to run
slice-/GOP-/tile-parallel override this to capture the budget.
Ignoring the hint is always safe — callers must still work with
a decoder that runs serial.Auto Trait Implementations§
impl Freeze for AnimatedRenderedDecoder
impl !RefUnwindSafe for AnimatedRenderedDecoder
impl Send for AnimatedRenderedDecoder
impl !Sync for AnimatedRenderedDecoder
impl Unpin for AnimatedRenderedDecoder
impl UnsafeUnpin for AnimatedRenderedDecoder
impl !UnwindSafe for AnimatedRenderedDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more