Make SCStreamOutput protocol accessible in Rust
This commit is contained in:
parent
45519cdd27
commit
d91f26d016
2 changed files with 2 additions and 9 deletions
|
@ -2,9 +2,11 @@ fn main() {
|
||||||
println!("cargo:rustc-link-lib=framework=ScreenCaptureKit");
|
println!("cargo:rustc-link-lib=framework=ScreenCaptureKit");
|
||||||
println!("cargo:rustc-link-lib=framework=CoreMedia");
|
println!("cargo:rustc-link-lib=framework=CoreMedia");
|
||||||
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=12.3");
|
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET=12.3");
|
||||||
|
println!("cargo:rustc-link-arg=-ObjC");
|
||||||
|
|
||||||
cc::Build::new()
|
cc::Build::new()
|
||||||
.file("src/dummy.m")
|
.file("src/dummy.m")
|
||||||
.define("MACOSX_DEPLOYMENT_TARGET", "12.3")
|
.define("MACOSX_DEPLOYMENT_TARGET", "12.3")
|
||||||
|
.flag("-ObjC")
|
||||||
.compile("dummy");
|
.compile("dummy");
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,16 +33,7 @@ fn main() {
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
||||||
|
|
||||||
let block = ConcreteBlock::new(move |content: id, error: id| {
|
let block = ConcreteBlock::new(move |content: id, error: id| {
|
||||||
println!(
|
|
||||||
"got response with shareable content {:?} {:?} {:?}",
|
|
||||||
content,
|
|
||||||
error,
|
|
||||||
string_from_objc(msg_send![error, localizedDescription]),
|
|
||||||
);
|
|
||||||
|
|
||||||
let displays: id = msg_send![content, displays];
|
let displays: id = msg_send![content, displays];
|
||||||
if let Some(display) = (0..displays.count())
|
if let Some(display) = (0..displays.count())
|
||||||
.map(|ix| displays.objectAtIndex(ix))
|
.map(|ix| displays.objectAtIndex(ix))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue