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

Method next

libs/scrap/src/common/aom.rs:442–460  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

440impl<'a> Iterator for EncodeFrames<'a> {
441 type Item = EncodeFrame<'a>;
442 fn next(&mut self) -> Option<Self::Item> {
443 loop {
444 unsafe {
445 let pkt = aom_codec_get_cx_data(self.ctx, &mut self.iter);
446 if pkt.is_null() {
447 return None;
448 } else if (*pkt).kind == aom_codec_cx_pkt_kind::AOM_CODEC_CX_FRAME_PKT {
449 let f = &(*pkt).data.frame;
450 return Some(Self::Item {
451 data: slice::from_raw_parts(f.buf as _, f.sz as _),
452 key: (f.flags & AOM_FRAME_IS_KEY) != 0,
453 pts: f.pts,
454 });
455 } else {
456 // Ignore the packet.
457 }
458 }
459 }
460 }
461}
462
463pub struct AomDecoder {

Callers 1

primaryMethod · 0.45

Calls 2

ImageClass · 0.70
is_nullMethod · 0.45

Tested by

no test coverage detected