Skip to content

Commit

Permalink
attempt at using size ofr LinuxDmabuf event
Browse files Browse the repository at this point in the history
  • Loading branch information
russelltg committed Feb 16, 2024
1 parent 816ce14 commit 3c31b53
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,15 @@ impl Dispatch<ZwlrScreencopyFrameV1, ()> for State {
zwlr_screencopy_frame_v1::Event::BufferDone => {}
zwlr_screencopy_frame_v1::Event::LinuxDmabuf {
format,
width,
height,
width: dmabuf_width,
height: dmabuf_height,
} => {
match &state.enc {
EncConstructionStage::None => unreachable!(
"Oops, somehow created a screencopy frame without initial enc state stuff?"
),
EncConstructionStage::EverythingButFormat { output, x, y, w, h } => {
eprintln!("dmabuf={dmabuf_width}x{dmabuf_height} outupt={}x{}", output.size_pixels.0, output.size_pixels.1);
state.enc = EncConstructionStage::Complete(
match EncState::new(
&state.args,
Expand All @@ -529,7 +530,7 @@ impl Dispatch<ZwlrScreencopyFrameV1, ()> for State {
.expect("Unknown fourcc"),
),
output.refresh,
output.size_pixels,
(dmabuf_width as i32, dmabuf_height as i32),
(*x, *y),
(*w, *h),
Arc::clone(&state.sigusr1_flag),
Expand Down Expand Up @@ -571,8 +572,8 @@ impl Dispatch<ZwlrScreencopyFrameV1, ()> for State {
);

let buf = dma_params.create_immed(
width as i32,
height as i32,
dmabuf_width as i32,
dmabuf_height as i32,
format,
zwp_linux_buffer_params_v1::Flags::empty(),
qhandle,
Expand Down

0 comments on commit 3c31b53

Please sign in to comment.