Skip to content

Commit 82e9a07

Browse files
committed
v0.6.1: cargo update
1 parent f040e0d commit 82e9a07

File tree

8 files changed

+123
-104
lines changed

8 files changed

+123
-104
lines changed

Cargo.lock

Lines changed: 102 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["zbl", "zbl_py"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.6.0"
6+
version = "0.6.1"
77

88
[profile.release]
99
strip = true

zbl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ once_cell = "1"
1111
log = "0.4"
1212

1313
[dependencies.windows]
14-
version = "0.56"
14+
version = "0.58"
1515
features = [
1616
"Foundation",
1717
"Graphics_Capture",

zbl/examples/simple.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::time::Instant;
1+
use std::{os::raw::c_void, time::Instant};
22

33
use clap::Parser;
44
use opencv::{
@@ -29,7 +29,7 @@ fn main() {
2929
window.print_info();
3030
Box::new(window) as Box<dyn Capturable>
3131
} else if let Some(window_handle) = args.window_handle {
32-
let window = Window::new(HWND(window_handle));
32+
let window = Window::new(HWND(window_handle as *mut c_void));
3333
window.print_info();
3434
Box::new(window) as Box<dyn Capturable>
3535
} else if let Some(display_id) = args.display_id {

zbl/src/capture/display.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::{
22
collections::HashMap,
3+
ptr::null_mut,
34
sync::{
45
mpsc::{sync_channel, Receiver, SyncSender},
56
RwLock,
@@ -47,7 +48,13 @@ extern "system" fn enum_monitor(monitor: HMONITOR, _: HDC, _: *mut RECT, state:
4748
fn enumerate_displays() -> Result<Box<Vec<Result<Display>>>> {
4849
let displays = Box::into_raw(Default::default());
4950
unsafe {
50-
EnumDisplayMonitors(HDC(0), None, Some(enum_monitor), LPARAM(displays as isize)).ok()?;
51+
EnumDisplayMonitors(
52+
HDC(null_mut()),
53+
None,
54+
Some(enum_monitor),
55+
LPARAM(displays as isize),
56+
)
57+
.ok()?;
5158
Ok(Box::from_raw(displays))
5259
}
5360
}
@@ -104,11 +111,11 @@ impl Capturable for Display {
104111
OBJECT_DESTROYED_USER_DATA
105112
.write()
106113
.unwrap()
107-
.insert(self.handle.0, (self.handle.0, sender));
114+
.insert(self.handle.0 as isize, (self.handle.0 as isize, sender));
108115
receiver
109116
}
110117

111118
fn get_raw_handle(&self) -> isize {
112-
self.handle.0
119+
self.handle.0 as isize
113120
}
114121
}

zbl/src/capture/window.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ extern "system" fn object_destroyed_cb(
5050
) {
5151
if id_object == 0 && id_child == 0 && handle != HWND::default() {
5252
let has_been_closed = if let Ok(handles) = OBJECT_DESTROYED_USER_DATA.read() {
53-
if let Some((window_handle, tx)) = handles.get(&this.0) {
54-
if *window_handle == handle.0 {
53+
if let Some((window_handle, tx)) = handles.get(&(this.0 as isize)) {
54+
if *window_handle == handle.0 as isize {
5555
tx.send(()).ok();
5656
true
5757
} else {
@@ -299,12 +299,12 @@ impl Capturable for Window {
299299
)
300300
};
301301
if let Ok(mut handles) = OBJECT_DESTROYED_USER_DATA.write() {
302-
handles.insert(hook_id.0, (self.handle.0, sender));
302+
handles.insert(hook_id.0 as isize, (self.handle.0 as isize, sender));
303303
}
304304
receiver
305305
}
306306

307307
fn get_raw_handle(&self) -> isize {
308-
self.handle.0
308+
self.handle.0 as isize
309309
}
310310
}

zbl_py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "zbl"
33
description = "real-time window capture library based on D3D11 and Windows.Graphics.Capture"
4-
version = "0.6.0"
4+
version = "0.6.1"
55
readme = "../README.md"
66
requires-python = ">=3.8"
77
license = { file = "../LICENSE.txt" }

zbl_py/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ impl Capture {
160160
)?)
161161
} else if let Some(handle) = window_handle {
162162
Ok(Self::from_capturable(
163-
Box::new(::zbl::Window::new(HWND(handle as isize))) as Box<dyn ::zbl::Capturable>,
163+
Box::new(::zbl::Window::new(HWND(handle as *mut c_void)))
164+
as Box<dyn ::zbl::Capturable>,
164165
is_cursor_capture_enabled,
165166
is_border_required,
166167
cpu_access,

0 commit comments

Comments
 (0)