linux x11 rgb565 capture (#8580)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2024-07-03 14:20:41 +08:00
committed by GitHub
parent 6d2e985593
commit d00582e929
7 changed files with 165 additions and 45 deletions

View File

@@ -23,9 +23,10 @@ impl TraitCapturer for Capturer {
fn frame<'a>(&'a mut self, _timeout: Duration) -> io::Result<Frame<'a>> {
let width = self.width();
let height = self.height();
let pixfmt = self.0.display().pixfmt();
Ok(Frame::PixelBuffer(PixelBuffer::new(
self.0.frame()?,
Pixfmt::BGRA,
pixfmt,
width,
height,
)))