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

Method frame

libs/scrap/src/common/wayland.rs:44–61  ·  view source on GitHub ↗
(&'a mut self, timeout: Duration)

Source from the content-addressed store, hash-verified

42
43impl TraitCapturer for Capturer {
44 fn frame<'a>(&'a mut self, timeout: Duration) -> io::Result<Frame<'a>> {
45 match self.1.capture(timeout.as_millis() as _).map_err(map_err)? {
46 PixelProvider::BGR0(w, h, x) => Ok(Frame::PixelBuffer(PixelBuffer::new(
47 x,
48 crate::Pixfmt::BGRA,
49 w,
50 h,
51 ))),
52 PixelProvider::RGB0(w, h, x) => Ok(Frame::PixelBuffer(PixelBuffer::new(
53 x,
54 crate::Pixfmt::RGBA,
55 w,
56 h,
57 ))),
58 PixelProvider::NONE => Err(std::io::ErrorKind::WouldBlock.into()),
59 _ => Err(map_err("Invalid data")),
60 }
61 }
62}
63
64pub struct Display(pipewire::PipeWireCapturable);

Callers

nothing calls this directly

Calls 3

map_errFunction · 0.85
captureMethod · 0.80
PixelBufferClass · 0.70

Tested by

no test coverage detected