diff --git a/CHANGELOG.md b/CHANGELOG.md index c1300ab..7da60b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.2] - 2023-12-15 +### Fixed + - #31: Fix segfault due to bad refcount + ## [0.2.1] - 2023-12-15 ### Fixed - Cargo dependency mistake @@ -27,7 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial commit with prototype version -[unreleased]: https://github.com/svtlabs/screencapturekit-rs/compare/v0.2.1...HEAD +[unreleased]: https://github.com/svtlabs/screencapturekit-rs/compare/v0.2.2...HEAD +[0.2.2]: https://github.com/svtlabs/screencapturekit-rs/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/svtlabs/screencapturekit-rs/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/svtlabs/screencapturekit-rs/compare/v0.1.0...v0.2.0 [0.0.1]: https://github.com/svtlabs/screencapturekit-rs/releases/tag/v0.1.0 diff --git a/Cargo.toml b/Cargo.toml index 80e575f..fd77cde 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,6 @@ authors = ["Per Johansson "] homepage = "https://doom.fish" edition = "2021" rust-version = "1.75" -version = "0.2.1" +version = "0.2.2" keywords = ["screencapture", "screencapturekit", "macos"] license = "MIT OR Apache-2.0" diff --git a/screencapturekit/examples/segfault.rs b/screencapturekit/examples/segfault.rs deleted file mode 100644 index f1f0d80..0000000 --- a/screencapturekit/examples/segfault.rs +++ /dev/null @@ -1,77 +0,0 @@ -use std::{path::PathBuf, thread, time}; - -use screencapturekit::{ - cm_sample_buffer::CMSampleBuffer, - sc_content_filter::{InitParams, SCContentFilter}, - sc_error_handler::StreamErrorHandler, - sc_output_handler::{SCStreamOutputType, StreamOutput}, - sc_shareable_content::SCShareableContent, - sc_stream::SCStream, - sc_stream_configuration::SCStreamConfiguration, -}; -use screencapturekit_sys::os_types::geometry::{CGPoint, CGRect, CGSize}; - -struct ErrorHandler; -impl StreamErrorHandler for ErrorHandler { - fn on_error(&self) { - println!("Error!"); - } -} - -pub struct Capturer {} - -impl Capturer { - pub fn new() -> Self { - println!("Capturer initialized"); - Capturer {} - } -} - -impl StreamErrorHandler for Capturer { - fn on_error(&self) { - eprintln!("ERROR!"); - } -} - -impl StreamOutput for Capturer { - fn did_output_sample_buffer(&self, sample: CMSampleBuffer, of_type: SCStreamOutputType) { - println!("New frame recvd"); - } -} -fn main() { - println!("Starting"); - - let content = SCShareableContent::current(); - let displays = content.displays; - - let display = displays.first().unwrap_or_else(|| { - panic!("Main display not found"); - }); - let display = display.to_owned(); - - let width = display.width; - let height = display.height; - - let params = InitParams::Display(display); - let filter = SCContentFilter::new(params); - - let stream_config = SCStreamConfiguration { - width, - height, - ..Default::default() - }; - - let mut stream = SCStream::new(filter, stream_config, ErrorHandler); - let capturer = Capturer::new(); - stream.add_output(capturer, SCStreamOutputType::Screen); - - stream.start_capture(); - - let ten_millis = time::Duration::from_millis(10000); - - thread::sleep(ten_millis); - - stream.stop_capture(); - - println!("Ended"); -}