Remove core-video-sys dependency (#2326)
Hasn't been updated in over 2 years - many open PRs, seems abandoned. Is the cause of several duplicate dependencies in our dependency tree!
This commit is contained in:
parent
c532d910c0
commit
40abb526cc
3 changed files with 48 additions and 15 deletions
|
|
@ -16,10 +16,6 @@ use core_foundation::{
|
|||
string::CFString,
|
||||
};
|
||||
use core_graphics::display::{CGDirectDisplayID, CGDisplay, CGDisplayBounds};
|
||||
use core_video_sys::{
|
||||
kCVReturnSuccess, kCVTimeIsIndefinite, CVDisplayLinkCreateWithCGDisplay,
|
||||
CVDisplayLinkGetNominalOutputVideoRefreshPeriod, CVDisplayLinkRelease,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct VideoMode {
|
||||
|
|
@ -228,16 +224,16 @@ impl MonitorHandle {
|
|||
let cv_refresh_rate = unsafe {
|
||||
let mut display_link = std::ptr::null_mut();
|
||||
assert_eq!(
|
||||
CVDisplayLinkCreateWithCGDisplay(self.0, &mut display_link),
|
||||
kCVReturnSuccess
|
||||
ffi::CVDisplayLinkCreateWithCGDisplay(self.0, &mut display_link),
|
||||
ffi::kCVReturnSuccess
|
||||
);
|
||||
let time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(display_link);
|
||||
CVDisplayLinkRelease(display_link);
|
||||
let time = ffi::CVDisplayLinkGetNominalOutputVideoRefreshPeriod(display_link);
|
||||
ffi::CVDisplayLinkRelease(display_link);
|
||||
|
||||
// This value is indefinite if an invalid display link was specified
|
||||
assert!(time.flags & kCVTimeIsIndefinite == 0);
|
||||
assert!(time.flags & ffi::kCVTimeIsIndefinite == 0);
|
||||
|
||||
time.timeScale as i64 / time.timeValue
|
||||
time.time_scale as i64 / time.time_value
|
||||
};
|
||||
|
||||
let monitor = self.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue