(&'a mut self, timeout: Duration)
| 42 | |
| 43 | impl 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 | |
| 64 | pub struct Display(pipewire::PipeWireCapturable); |
nothing calls this directly
no test coverage detected