Skip to content

Commit 9610b64

Browse files
committed
feat!: 3.0 is here with video capture support
1 parent 322e2c6 commit 9610b64

File tree

5 files changed

+63
-4
lines changed

5 files changed

+63
-4
lines changed

.github/workflows/release-plz.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release-plz
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
release-plz-release:
14+
name: Release-plz release
15+
runs-on: macos-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
22+
- name: Install Rust toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
- name: Run release-plz
25+
uses: release-plz/[email protected]
26+
with:
27+
command: release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
30+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31+
32+
release-plz-pr:
33+
name: Release-plz PR
34+
runs-on: macos-latest
35+
concurrency:
36+
group: release-plz-${{ github.ref }}
37+
cancel-in-progress: false
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
44+
- name: Install Rust toolchain
45+
uses: dtolnay/rust-toolchain@stable
46+
- name: Run release-plz
47+
uses: release-plz/[email protected]
48+
with:
49+
command: release-pr
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
52+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ ci = []
2727

2828

2929
[dependencies]
30-
core-media-rs = { version = "0.2.2" }
31-
core-utils-rs = { version = "0.2.2" }
30+
core-media-rs = { version = "0.3" }
31+
core-video-rs = { version = "0.3" }
32+
core-utils-rs = { version = "0.3" }
3233
objc = { version = "0.2", features = ["exception"] }
3334
block2 = "0.5"
3435
dispatch = "0.2"

src/output/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
pub mod sc_stream_frame_info;
2+
3+
pub use core_media_rs::cm_sample_buffer::{CMSampleBuffer, CMSampleBufferRef};
4+
pub use core_video_rs::cv_pixel_buffer::{lock::*, CVPixelBuffer, CVPixelBufferRef};

src/stream/internal/stream.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ use super::{
2626

2727
#[repr(C)]
2828
pub struct __SCStreamRef(c_void);
29+
2930
extern "C" {
3031
pub fn SCStreamGetTypeID() -> CFTypeID;
3132
}
32-
pub type SCStreamRef = *mut __SCStreamRef;
3333

34+
pub type SCStreamRef = *mut __SCStreamRef;
3435
#[allow(clippy::module_name_repetitions)]
3536
pub struct SCStream(SCStreamRef);
3637

3738
impl_TCFType!(SCStream, SCStreamRef, SCStreamGetTypeID);
3839

40+
unsafe impl Send for SCStream {}
41+
3942
impl Drop for SCStream {
4043
fn drop(&mut self) {
4144
unsafe {

tests/leak_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ mod leak_tests {
5959
stream
6060
};
6161
stream.start_capture().ok();
62-
thread::sleep(std::time::Duration::from_millis(5000));
62+
thread::sleep(std::time::Duration::from_millis(500));
6363
stream.stop_capture().ok();
6464
// Force drop of sc_stream
6565
drop(stream);

0 commit comments

Comments
 (0)