MCPcopy Create free account
hub / github.com/Recordscript/recordscript / handle_vpxs_video_frame

Method handle_vpxs_video_frame

libs/scrap/src/common/codec.rs:706–730  ·  view source on GitHub ↗

rgb [in/out] fmt and stride must be set in ImageRgb

(
        decoder: &mut VpxDecoder,
        vpxs: &EncodedVideoFrames,
        rgb: &mut ImageRgb,
        chroma: &mut Option<Chroma>,
    )

Source from the content-addressed store, hash-verified

704
705 // rgb [in/out] fmt and stride must be set in ImageRgb
706 fn handle_vpxs_video_frame(
707 decoder: &mut VpxDecoder,
708 vpxs: &EncodedVideoFrames,
709 rgb: &mut ImageRgb,
710 chroma: &mut Option<Chroma>,
711 ) -> ResultType<bool> {
712 let mut last_frame = vpxcodec::Image::new();
713 for vpx in vpxs.frames.iter() {
714 for frame in decoder.decode(&vpx.data)? {
715 drop(last_frame);
716 last_frame = frame;
717 }
718 }
719 for frame in decoder.flush()? {
720 drop(last_frame);
721 last_frame = frame;
722 }
723 if last_frame.is_null() {
724 Ok(false)
725 } else {
726 *chroma = Some(last_frame.chroma());
727 last_frame.to(rgb);
728 Ok(true)
729 }
730 }
731
732 // rgb [in/out] fmt and stride must be set in ImageRgb
733 fn handle_av1s_video_frame(

Callers

nothing calls this directly

Calls 6

iterMethod · 0.80
decodeMethod · 0.45
flushMethod · 0.45
is_nullMethod · 0.45
chromaMethod · 0.45
toMethod · 0.45

Tested by

no test coverage detected