linux_wayland_support: init merge, windows build

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-07-07 01:27:21 +08:00
parent 6533b30cac
commit aae6e2b16b
30 changed files with 1902 additions and 656 deletions

View File

@@ -17,6 +17,13 @@ impl Capturer {
})
}
pub fn set_use_yuv(&mut self, use_yuv: bool) {
match self {
Capturer::X11(d) => d.set_use_yuv(use_yuv),
Capturer::WAYLAND(d) => d.set_use_yuv(use_yuv),
}
}
pub fn width(&self) -> usize {
match self {
Capturer::X11(d) => d.width(),
@@ -31,10 +38,10 @@ impl Capturer {
}
}
pub fn frame<'a>(&'a mut self, timeout_ms: u32) -> io::Result<Frame<'a>> {
pub fn frame<'a>(&'a mut self, timeout: Duration) -> io::Result<Frame<'a>> {
match self {
Capturer::X11(d) => d.frame(timeout_ms),
Capturer::WAYLAND(d) => d.frame(timeout_ms),
Capturer::X11(d) => d.frame(timeout),
Capturer::WAYLAND(d) => d.frame(timeout),
}
}
}
@@ -45,7 +52,7 @@ pub enum Display {
}
#[inline]
fn is_wayland() -> bool {
pub fn is_wayland() -> bool {
std::env::var("IS_WAYLAND").is_ok()
|| std::env::var("XDG_SESSION_TYPE") == Ok("wayland".to_owned())
}