rgb [in/out] fmt and stride must be set in ImageRgb
(
decoder: &mut VpxDecoder,
vpxs: &EncodedVideoFrames,
rgb: &mut ImageRgb,
chroma: &mut Option<Chroma>,
)
| 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( |