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

Method handle_hwram_video_frame

libs/scrap/src/common/codec.rs:761–777  ·  view source on GitHub ↗
(
        decoder: &mut HwRamDecoder,
        frames: &EncodedVideoFrames,
        rgb: &mut ImageRgb,
        i420: &mut Vec<u8>,
    )

Source from the content-addressed store, hash-verified

759 // rgb [in/out] fmt and stride must be set in ImageRgb
760 #[cfg(feature = "hwcodec")]
761 fn handle_hwram_video_frame(
762 decoder: &mut HwRamDecoder,
763 frames: &EncodedVideoFrames,
764 rgb: &mut ImageRgb,
765 i420: &mut Vec<u8>,
766 ) -> ResultType<bool> {
767 let mut ret = false;
768 for h264 in frames.frames.iter() {
769 for image in decoder.decode(&h264.data)? {
770 // TODO: just process the last frame
771 if image.to_fmt(rgb, i420).is_ok() {
772 ret = true;
773 }
774 }
775 }
776 return Ok(ret);
777 }
778
779 #[cfg(feature = "vram")]
780 fn handle_vram_video_frame(

Callers

nothing calls this directly

Calls 3

iterMethod · 0.80
to_fmtMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected