30 lines
952 B
Diff
30 lines
952 B
Diff
--- src/capture/wayland.rs
|
|
+++ src/capture/wayland.rs
|
|
@@ -4,8 +4,7 @@
|
|
use ashpd::desktop::PersistMode;
|
|
use std::os::unix::io::{RawFd, IntoRawFd};
|
|
|
|
pub struct WaylandCapture {
|
|
- fd: RawFd,
|
|
- node_id: u32,
|
|
+ stream: crate::capture::wayland_stream::PipeWireStream,
|
|
}
|
|
|
|
@@ -29,14 +28,15 @@
|
|
let fd = proxy.open_pipe_wire_remote(&session, Default::default()).await?;
|
|
|
|
- Ok(Self {
|
|
- fd: fd.into_raw_fd(),
|
|
- node_id,
|
|
- })
|
|
+ let stream = crate::capture::wayland_stream::PipeWireStream::new(node_id, fd.into_raw_fd())?;
|
|
+ Ok(Self { stream })
|
|
}
|
|
}
|
|
|
|
impl FrameSource for WaylandCapture {
|
|
fn next_frame(&mut self) -> Result<Frame, Box<dyn std::error::Error + Send + Sync>> {
|
|
- Err("Wayland/Pipewire frame extraction not fully implemented yet".into())
|
|
+ self.stream.next_frame().map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>)
|
|
}
|
|
}
|