Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP image-capture-source / image-copy-capture #470

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ thiserror = "1.0.30"
wayland-backend = "0.3.0"
wayland-client = "0.31.1"
wayland-cursor = "0.31.0"
wayland-protocols = { version = "0.32.1", features = ["client", "staging", "unstable"] }
wayland-protocols = { version = "0.32.4", features = ["client", "staging", "unstable"] }
wayland-protocols-wlr = { version = "0.3.1", features = ["client"] }
wayland-scanner = "0.31.0"
wayland-csd-frame = "0.3.0"
Expand Down
83 changes: 83 additions & 0 deletions examples/image_copy_capture.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
use smithay_client_toolkit::{
delegate_image_copy_capture,
image_copy_capture::{
BufferConstraints, Frame, ImageCopyCaptureHandler, ImageCopyCaptureState,
ImageCopyFrameData, ImageCopyFrameDataExt, ImageCopySessionData, ImageCopySessionDataExt,
},
};
use wayland_client::{Connection, QueueHandle, WEnum};
use wayland_protocols::ext::image_copy_capture::v1::client::{
ext_image_copy_capture_cursor_session_v1, ext_image_copy_capture_frame_v1,

Check warning on line 10 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (stable)

unused imports: `ext_image_copy_capture_cursor_session_v1` and `ext_image_copy_capture_manager_v1`

Check warning on line 10 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (beta)

unused imports: `ext_image_copy_capture_cursor_session_v1` and `ext_image_copy_capture_manager_v1`
ext_image_copy_capture_manager_v1, ext_image_copy_capture_session_v1,
};

struct State {
image_copy_capture_state: ImageCopyCaptureState,
}

struct SessionData {
session_data: ImageCopySessionData,
}

impl ImageCopySessionDataExt for SessionData {
fn image_copy_session_data(&self) -> &ImageCopySessionData {
&self.session_data
}
}

struct FrameData {
frame_data: ImageCopyFrameData,
}

impl ImageCopyFrameDataExt for FrameData {
fn image_copy_frame_data(&self) -> &ImageCopyFrameData {
&self.frame_data
}
}

struct CursorSessionData {}

fn main() {}

impl ImageCopyCaptureHandler for State {
fn image_copy_capture_state(&mut self) -> &mut ImageCopyCaptureState {
&mut self.image_copy_capture_state
}

fn buffer_constraints(
&mut self,
conn: &Connection,

Check warning on line 49 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (stable)

unused variable: `conn`

Check warning on line 49 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (beta)

unused variable: `conn`
qh: &QueueHandle<Self>,

Check warning on line 50 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (stable)

unused variable: `qh`

Check warning on line 50 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (beta)

unused variable: `qh`
session: &ext_image_copy_capture_session_v1::ExtImageCopyCaptureSessionV1,

Check warning on line 51 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (stable)

unused variable: `session`

Check warning on line 51 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (beta)

unused variable: `session`
constraints: BufferConstraints,

Check warning on line 52 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (stable)

unused variable: `constraints`

Check warning on line 52 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (beta)

unused variable: `constraints`
) {
}

fn stopped(
&mut self,
conn: &Connection,

Check warning on line 58 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (stable)

unused variable: `conn`

Check warning on line 58 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (beta)

unused variable: `conn`
qh: &QueueHandle<Self>,

Check warning on line 59 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (stable)

unused variable: `qh`

Check warning on line 59 in examples/image_copy_capture.rs

View workflow job for this annotation

GitHub Actions / test (beta)

unused variable: `qh`
session: &ext_image_copy_capture_session_v1::ExtImageCopyCaptureSessionV1,
) {
}

fn ready(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
image_copy_frame: &ext_image_copy_capture_frame_v1::ExtImageCopyCaptureFrameV1,
frame: Frame,
) {
}

fn failed(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
image_copy_frame: &ext_image_copy_capture_frame_v1::ExtImageCopyCaptureFrameV1,
reason: WEnum<ext_image_copy_capture_frame_v1::FailureReason>,
) {
}
}

delegate_image_copy_capture!(State, session: [SessionData], frame: [FrameData], cursor_session: [CursorSessionData]);
5 changes: 3 additions & 2 deletions src/dmabuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use wayland_protocols::wp::linux_dmabuf::zv1::client::{

// Workaround until `libc` updates to FreeBSD 12 ABI
#[cfg(target_os = "freebsd")]
type dev_t = u64;
pub(crate) type dev_t = u64;
#[cfg(not(target_os = "freebsd"))]
use libc::dev_t;
pub(crate) use libc::dev_t;

/// A preference tranche of dmabuf formats
#[derive(Debug)]
Expand All @@ -42,6 +42,7 @@ impl Default for DmabufFeedbackTranche {

/// A single dmabuf format/modifier pair
// Must have correct representation to be able to mmap format table
#[derive(Clone)]
#[repr(C)]
pub struct DmabufFormat {
/// Fourcc format
Expand Down
Loading
Loading