Skip to content

Commit 1cb8d90

Browse files
1313Copilot
andcommitted
Merge migrate-to-apple-cf: phase 1-5 + v3.0.0
Long-pending migration of CMSampleBuffer/CVPixelBuffer/IOSurface/ CMTime/CMBlockBuffer/CMFormatDescription helpers into the new apple-cf crate, plus extraction of Metal interop into the new apple-metal crate. screencapturekit::metal::MetalDevice::as_apple_metal() bridges the SCK Metal renderer to the lightweight apple-metal crate without an extra retain. screencapturekit::apple_metal re-exports apple-metal for downstream code. Verified: lib tests pass, full build succeeds against apple-cf v0.2 + apple-metal v0.1.1. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2 parents 3e296de + 9292b14 commit 1cb8d90

48 files changed

Lines changed: 675 additions & 6343 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "screencapturekit"
3-
version = "2.1.0"
3+
version = "3.0.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
homepage = "https://github.com/doom-fish/screencapturekit-rs"
@@ -59,6 +59,8 @@ macos_15_2 = ["macos_15_0"]
5959
macos_26_0 = ["macos_15_2"]
6060

6161
[dependencies]
62+
apple-cf = { path = "../apple-cf-rs", version = "0.2", default-features = false, features = ["cg", "iosurface", "dispatch", "cv", "cm"] }
63+
apple-metal = { path = "../apple-metal-rs", version = "0.1.1", default-features = false, features = ["iosurface"] }
6264

6365
[dev-dependencies]
6466
png = "0.18"

examples/04_pixel_access.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//! - Direct slice access
99
1010
use screencapturekit::cv::{CVPixelBufferLockFlags, PixelBufferCursorExt};
11+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
1112
use screencapturekit::prelude::*;
1213
use std::io::{Read, Seek, SeekFrom};
1314
use std::sync::atomic::{AtomicUsize, Ordering};

examples/06_iosurface.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//! - Locking and reading `IOSurface` data
88
99
use screencapturekit::cm::IOSurfaceLockOptions;
10+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
1011
use screencapturekit::cv::PixelBufferCursorExt;
1112
use screencapturekit::prelude::*;
1213
use std::sync::atomic::{AtomicUsize, Ordering};

examples/15_memory_leak_check.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use screencapturekit::{
3232
SCStream,
3333
},
3434
};
35+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
3536
use std::{
3637
process::Command,
3738
sync::{

examples/16_full_metal_app/capture.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::sync::atomic::{AtomicUsize, Ordering};
66
use std::sync::{Arc, Mutex};
77

88
use screencapturekit::cm::IOSurface;
9+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
910
use screencapturekit::metal::{pixel_format, IOSurfaceInfo};
1011
use screencapturekit::prelude::*;
1112

examples/17_metal_textures.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
//! See `16_full_metal_app` for a complete windowed application.
1313
1414
use screencapturekit::metal::{
15-
MTLPixelFormat, MetalDevice, MetalRenderPipelineDescriptor, MetalRenderPipelineState, Uniforms,
16-
SHADER_SOURCE,
15+
IOSurfaceMetalExt, MTLPixelFormat, MetalDevice, MetalRenderPipelineDescriptor,
16+
MetalRenderPipelineState, Uniforms, SHADER_SOURCE,
1717
};
18+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
1819
use screencapturekit::prelude::*;
1920
use std::sync::atomic::{AtomicUsize, Ordering};
2021
use std::sync::Arc;

examples/18_wgpu_integration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#![allow(clippy::needless_pass_by_ref_mut)]
1414

1515
use screencapturekit::cv::CVPixelBufferLockFlags;
16+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
1617
use screencapturekit::prelude::*;
1718
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
1819
use std::sync::{Arc, Mutex};

examples/19_ffmpeg_encoding.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#![allow(clippy::cast_precision_loss)]
2121

2222
use screencapturekit::cv::CVPixelBufferLockFlags;
23+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
2324
use screencapturekit::prelude::*;
2425
use std::io::Write;
2526
use std::process::{Child, Command, Stdio};

examples/20_egui_viewer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use eframe::egui;
1515
use screencapturekit::cv::CVPixelBufferLockFlags;
16+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
1617
use screencapturekit::prelude::*;
1718
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
1819
use std::sync::{Arc, Mutex};

examples/21_bevy_streaming.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use bevy::prelude::*;
1919
use bevy::render::render_resource::{Extent3d, TextureDimension, TextureFormat};
2020
use screencapturekit::cv::CVPixelBufferLockFlags;
21+
use screencapturekit::cm::{CMSampleBufferExt, CMSampleBufferSCExt};
2122
use screencapturekit::prelude::*;
2223
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
2324
use std::sync::{Arc, Mutex};

0 commit comments

Comments
 (0)