Skip to content

chore: release v2.0.0 - #103

Closed
1313 wants to merge 103 commits into
mainfrom
release-plz-2025-11-30T15-34-27Z
Closed

chore: release v2.0.0#103
1313 wants to merge 103 commits into
mainfrom
release-plz-2025-11-30T15-34-27Z

Conversation

@1313

@1313 1313 commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

🤖 New release

  • screencapturekit: 1.2.0 -> 2.0.0
Changelog

2.0.0 - 2025-11-30

Added

  • (examples) enhance memory leak test with comprehensive API coverage
  • (ffi) add optimized batch retrieval and owned strings
  • (examples) add missing API coverage examples
  • (example) refactor metal_overlay with recording/screenshot modules
  • (ffi) add FFI bindings for new APIs
  • (picker) add presentation mode and single window style
  • (cm) add CMTime operations and frame status predicates
  • (stream) add sync clock and filter stream type
  • (config) add capture resolution type support (macOS 14.0+)
  • (filter) add excluding applications filter variant
  • (screenshot) add SCScreenshotConfiguration content type support
  • (async) add async screenshot APIs for macOS 15.2/26.0
  • (stream) add closure-based delegate builders
  • (example) add recording menu option (macOS 15.0+)
  • (example) use macOS 26 screenshot API when available
  • (cg) add CGImage::save_png() with auto-open
  • (example) add screenshot option to metal_overlay
  • (example) enable mic-only capture without video source
  • (example) enhance metal_overlay with synthwave UI
  • (stream) expose as_ptr for internal use
  • (picker) add show_for_stream methods
  • (audio) add audio buffer list access
  • (picker) add SCPickedSource to identify selected content type
  • (audio) add audio input device enumeration API
  • (examples) use SCContentSharingPicker for content selection
  • (examples) preserve aspect ratio and center UI panels
  • (examples) add real audio waveform and vertical gain meters
  • (shareable_content) add missing SDK methods
  • (screenshot) add HDR screenshot example and tests
  • (screenshot) add macOS 26.0 advanced screenshot APIs
  • (async) add async picker example and tests
  • (async) add AsyncSCContentSharingPicker for non-blocking picker UI
  • (recording) add full video codec and file type arrays
  • (config) add CaptureHDRRecordingPreservedSDRHDR10 preset
  • (delegate) add stream active/inactive callbacks (macOS 15.2+)
  • (examples) add metal_overlay example with GPU rendering
  • (examples) integrate new macOS 14.0-15.2 features into examples
  • (picker) add SCContentSharingPicker enhancements for macOS 14.0+
  • (recording) add SCRecordingOutput features for macOS 15.0+
  • (screenshot) add capture_image_in_rect for macOS 15.2+
  • (content) add SCShareableContentInfo for macOS 14.0+
  • (filter) add SCContentFilter properties for macOS 14.0-15.2
  • (config) add new SCStreamConfiguration options for macOS 14.0-15.0
  • (error) add new error types for macOS 14.0+ stream events
  • (config) [breaking] add builder pattern with ::new() and with_* methods

Fixed

  • add macos_13_0 feature gate to synchronization_clock in example
  • add macos_14_0 feature gate to captures_shadows_only tests
  • add feature gates to example for content_rect, point_pixel_scale, and Microphone
  • use rawValue comparison for SCStreamOutputType to fix SDK compatibility
  • add SCREENCAPTUREKIT_HAS_MACOS26_SDK guard for macOS 26+ APIs
  • add macOS version availability guards for Swift APIs
  • guard recording output FFI with compiler version check for macOS 13
  • remove non-existent with_average_bitrate method calls
  • resolve clippy warnings
  • remove non-existent average_bitrate API
  • (swift) implement stub configuration properties
  • (swift) implement stub configuration properties
  • remove dead code and fix test errors
  • (memory) add leak fixes and comprehensive memory tests
  • (audio) correct AudioStreamBasicDescription repr
  • (picker) activate app and cleanup observer before showing
  • (examples) use SCShareableContent instead of blocking picker
  • (examples) update recording_output example to use builder pattern
  • (picker) remove tokio-dependent async methods

Other

  • update README to match current API
  • add macOS 26 (Tahoe) to build matrix
  • fix formatting in memory leak check example
  • improve doc comments for audio and block buffer modules
  • update documentation to reflect current API
  • update references to renamed memory leak example
  • (test) convert leak test to example for better isolation
  • add note about running memory tests single-threaded
  • fix clippy warnings and format code
  • (swift) use public APIs for filter content extraction
  • (examples) update README with new examples
  • (examples) extract input handling to separate module
  • improve code quality and fix memory leaks
  • add copilot instructions and Apple docs download script
  • (error) replace specific error variants with SCStreamErrorCode
  • (example) split metal_overlay into modules
  • (example) remove unused metal_overlay module files
  • (config) remove get_ prefix from getters
  • (example) modularize metal_overlay example
  • improve metal overlay UX and mic device API
  • (example) improve metal_overlay UX with menu navigation
  • (picker) rename async pick() to show() for consistency
  • (picker) replace blocking API with callback-based API
  • add coverage for missing SDK features
  • (api) remove get_ prefix from non-configuration getters
  • fix clippy warnings in docs and tests
  • (cm) standardize CM/CV type method naming
  • (api) remove deprecated APIs and standardize naming
  • (api) standardize Rust API patterns and naming
  • (swift-bridge) [breaking] standardize API patterns and error handling
  • add version-specific feature testing per macOS runner
  • update README with new APIs and feature flags
  • (picker) add async API documentation and improve examples
  • update README and Cargo.toml for new features
  • fix clippy doc_markdown warnings and update examples
  • update documentation to use builder pattern API
  • fix build badge workflow filename
  • use major version only in README examples

Added

  • Memory Leak Example - 15_memory_leak_check.rs for comprehensive memory leak testing with leaks
  • New Examples - 12_stream_updates.rs, 13_advanced_config.rs, 14_app_capture.rs
  • Batch FFI Retrieval - Optimized batch retrieval functions for displays, windows, and applications
  • Comprehensive Memory Tests - Tests covering audio, microphone, filters, and all content types

Changed

  • Input Module - Extracted input handling from metal_overlay to reusable module
  • Swift FFI Boundary - Moved parsing/validation logic to Swift side for cleaner Rust code
  • Owned Strings - Changed FFI string functions to return owned strings where appropriate

Fixed

  • Memory leak fixes in stream lifecycle and content filter creation
  • Removed dead code and stub implementations
  • Fixed clippy warnings across codebase
  • Corrected non-existent API method calls


This PR was generated with release-plz.

1313 added 30 commits November 28, 2025 17:06
Add fluent builder API to SCStreamConfiguration:
- Add ::new() constructor as alias for ::default()
- Add with_* builder methods for all setters (e.g., with_width, with_height)
- Update set_* methods to return &mut Self for chaining

Update all examples, tests, and documentation to use new pattern:
- Examples now use SCStreamConfiguration::new().with_width(1920).with_height(1080)
- Update README.md code examples
- Update doc examples in lib.rs, async_api.rs, screenshot_manager.rs
- Update stream module documentation

BREAKING CHANGE: set_* methods now return &mut Self instead of ()
This enables method chaining but may affect code that relied on unit return type
- Update doc examples to use SCStreamConfiguration::new() with with_* methods
- Improve lib.rs crate-level documentation with feature flags table
- Add html_root_url for docs.rs
- Update audio configuration examples
- Update screenshot_manager examples
- Update error module examples
- Add UserDeclined error for user permission denial
- Add MicrophoneCaptureFailed error with detail message
- Add SystemStoppedStream error for system-initiated stops
- Add comprehensive tests for all error variants
- Add capturesShadowsOnly (macOS 14.0+)
- Add ignoresShadowsDisplay (macOS 14.0+)
- Add ignoreGlobalClipDisplay/SingleWindow (macOS 14.0+)
- Add showsMouseClicks (macOS 15.0+)
- Add SCStreamConfigurationPreset for HDR configurations (macOS 15.0+)
- Add from_preset() constructor for preset-based configs
- Add comprehensive tests for all new configuration options
- Add SCShareableContentStyle enum (None, Window, Display, Application)
- Add get_style() for filter type inspection (macOS 14.0+)
- Add get_point_pixel_scale() for Retina scaling (macOS 14.0+)
- Add get/set_include_menu_bar() (macOS 14.2+)
- Add get_included_displays/windows/applications() (macOS 15.2+)
- Add From<i32> impl for SCShareableContentStyle
- Add tests for all new content filter features
- Add SCShareableContentInfo struct with style, scale, rect, pixel_size
- Add for_filter() constructor to get info from SCContentFilter
- Add pixel_size() helper for calculating actual pixel dimensions
- Add content_rect getter from SCContentFilter
- Add point_pixel_scale getter from SCContentFilter
- Add Clone, Debug, Send, Sync impls
- Add comprehensive tests for SCShareableContentInfo
- Add capture_image_in_rect() for capturing specific screen regions
- Uses CGRect to specify capture area
- Returns CGImage like existing capture methods
- Add tests for region capture functionality
- Add cg_init helper for headless test environments
- Add SCRecordingOutputFileType enum (MP4, MOV)
- Add get/set_video_codec() for codec selection
- Add get/set_output_file_type() for format selection
- Add available_video_codecs_count() for codec enumeration
- Add available_output_file_types_count() for format enumeration
- Add recorded_duration() to get CMTime of recording
- Add recorded_file_size() to get bytes written
- Add Debug impl for SCRecordingOutputConfiguration
- Add tests for all recording output features
- Add SCPickerResult for accessing picked displays/windows/applications
- Add displays() to get picked SCDisplay objects
- Add windows() to get picked SCWindow objects
- Add applications() to get picked SCRunningApplication objects
- Add pixel_size() helper for calculating pixel dimensions
- Add comprehensive FFI bindings for picker result access
- Fix doc examples to use window() instead of windows() builder
- Add backticks around type names (IOSurface, CMSampleBuffer, etc.)
- Fix CMTime usage in configuration example
- Fix temporary value lifetime in window capture example
- Fix exclude_windows type annotation in filter example
- Update module descriptions with proper formatting
- 01_basic_capture: Add filter scale info, shadow/clip options, mouse clicks
- 05_screenshot: Add SCShareableContentInfo display, region capture (15.2+)
- 07_list_content: Add pixel size/scale display, filter style info
- 10_recording_output: Add codec/file type selection, duration/size stats
- 11_content_picker: Minor formatting improvements
- Add Metal-based screen capture overlay application
- Implement bitmap font rendering for overlay text
- Add audio waveform visualization with VU meter
- Add interactive keyboard navigation menu
- Document data structure alignment for Rust/Metal interop
- Add macos_15_2 feature flag for new screenshot API
- Document new macOS version feature flags
- Update feature documentation in README
- Add stream_did_become_active() callback for window reopen events
- Add stream_did_become_inactive() callback for all windows closed
- Improve documentation for video effect callbacks (macOS 14.0+)
- Add HDR10 recording preset that preserves SDR range during playback
- Add tests for all presets including the new HDR recording preset
- Add available_video_codecs() returning Vec<SCRecordingOutputCodec>
- Add available_output_file_types() returning Vec<SCRecordingOutputFileType>
- Add get_available_video_codec_at() FFI function
- Add get_available_output_file_type_at() FFI function
- Add comprehensive tests for array retrieval methods
The pick_async() and pick_filter_async() methods used tokio which is only
a dev-dependency. Remove these methods since they cannot work without
tokio as a regular dependency.

Users can wrap the sync methods in their own async runtime if needed.
Add async wrapper for the content sharing picker that doesn't block the executor:
- AsyncSCContentSharingPicker with pick() and pick_filter() methods
- AsyncPickerFuture returning SCPickerOutcome
- AsyncPickerFilterFuture returning SCPickerFilterOutcome
- Uses AsyncCompletion with waker-based signaling (truly non-blocking)

Requires: macos_14_0 + async features
- Add Example 5 to 08_async.rs demonstrating AsyncSCContentSharingPicker
- Shows non-blocking picker with result handling
- Add tests for async picker types and Future implementation
Add SCScreenshotConfiguration and SCScreenshotOutput for advanced screenshots:
- SCScreenshotConfiguration with builder pattern for HDR/SDR control
- SCScreenshotDisplayIntent enum (Canonical, Local)
- SCScreenshotDynamicRange enum (SDR, HDR, BothSDRAndHDR)
- SCScreenshotOutput with sdr_image(), hdr_image(), file_url()
- SCScreenshotManager::capture_screenshot() and capture_screenshot_in_rect()
- Swift bridge functions for all new APIs

Requires: macos_26_0 feature flag
- Update 05_screenshot.rs with macOS 26.0 HDR capture demo
- Demonstrate SCScreenshotConfiguration builder pattern
- Show SDR and HDR image extraction from SCScreenshotOutput
- Add 11 new tests for screenshot configuration and capture
- Add macos_26_0 feature flag documentation
- Document SCScreenshotConfiguration and SCScreenshotDynamicRange types
- Update examples table with async picker and HDR screenshot features
- Add run commands for new feature combinations
Test appropriate feature flags for each macOS version:
- macOS 13: async,macos_13_0
- macOS 14: async,macos_14_4
- macOS 15: async,macos_15_2

Ensures APIs are tested on matching OS versions.
- Remove redundant dispatch_queue_*_bridge suffix aliases
- Organize iosurface_* compatibility aliases with deprecation comments
- Standardize error handling to use SCBridgeError consistently
- Add userData parameter to sc_shareable_content_get callbacks
- Add userData parameter to sc_shareable_content_get_current_process_displays
- Update Rust FFI declarations to match new callback signatures
- Clean up redundant return statements in stub functions

BREAKING CHANGE: sc_shareable_content_get and
sc_shareable_content_get_current_process_displays callbacks now include
userData parameter for consistency with other async APIs
- Deprecate duplicate CVPixelBuffer getters (get_width, get_height, etc.)
  in favor of cleaner names (width, height, io_surface)
- Convert SCRecordingOutputConfiguration from setter to builder pattern
  (set_* -> with_*) for consistency with other configuration types
- Add Clone implementation for DispatchQueue
- Add Debug derive for CVPixelBuffer
- Add null checks in Drop implementations for SCDisplay, SCStream,
  SCContentFilter for safety
- Add doc comment for SCShareableContent::applications()
- Add dispatch_queue_retain FFI declaration
- Update tests to use non-deprecated method names

The deprecated methods are kept for backward compatibility but marked
with #[deprecated] attributes pointing to the preferred alternatives.
- Remove duplicate CVPixelBuffer getters (get_width, get_height, etc.)
- Remove duplicate IOSurface getters (get_width, get_height, etc.)
- Remove SCContentFilter::build() alias for builder()
- Remove SCContentSharingPicker::show() alias for pick()
- Remove SCContentSharingPickerResult and SCPickResult type aliases
- Update all documentation examples to use new method names
- CMSampleBuffer: remove get_ prefix from getters
  (image_buffer, frame_status, presentation_timestamp, duration,
   num_samples, audio_buffer_list, data_buffer, decode_timestamp,
   output_presentation_timestamp, sample_size, total_sample_size,
   format_description, sample_timing_info, sample_timing_info_array)

- CMFormatDescription: rename get_media_type/get_media_subtype to
  media_type_raw/media_subtype_raw, remove get_extensions -> extensions

- AudioBuffer: get_data_byte_size -> data_byte_size

- AudioBufferList: remove get_number_buffers (use num_buffers),
  get_buffer -> buffer

- IOSurface (cm module): already had width/height/bytes_per_row

- Update all examples, tests, and documentation
1313 added 26 commits November 30, 2025 12:44
Previously empty stub implementations now properly call ScreenCaptureKit:

- set/getIncludesChildWindows (macOS 14.2+)
- set/getPresenterOverlayPrivacyAlertSetting (macOS 14.0+)
- set/getIgnoresShadowsSingleWindow (macOS 14.0+)

These properties now correctly delegate to the underlying
SCStreamConfiguration with proper version checks.
Use SCContentFilter.includedWindows/Displays/Applications on macOS 15.2+
instead of relying on KVC which is fragile and may break with SDK updates.

Falls back to KVC on older macOS versions for compatibility.
- Implement colorMatrix getter/setter (was stub)
- Implement ignoreShadowsDisplay (was stub, maps to correct API)
- Add color_matrix() getter to Rust SCStreamConfiguration

These properties now properly delegate to ScreenCaptureKit APIs.
Remove with_average_bitrate() from SCRecordingOutputConfiguration as
the underlying Apple API does not have an averageBitrate property.

This was dead code - the Swift stub did nothing.
- Add FFI data structures (FFIRect, FFIDisplayData, FFIWindowData, FFIApplicationData)
- Add batch retrieval functions for displays, windows, applications
- Add owned string functions (sc_window_get_title_owned, etc.)
- Add ffi_string_owned helper for efficient string transfer
- Swift allocates strings with strdup, Rust frees with sc_free_string
- Reduces FFI calls for shareable content retrieval
- Add backticks to doc comments for FFI function names
- Use #[doc(hidden)] for padding fields instead of underscore prefix
- Replace redundant closure with method reference in colors.rs
SCRecordingOutputConfiguration doesn't support bitrate settings directly.
Bitrate is controlled by video compression settings in AVFoundation.
- Add module-level clippy allows for complex UI/rendering code
- Fix doc-markdown issues (backticks around code terms)
- Fix implicit clone issues (use .clone() instead of .to_vec())
- Fix cast precision/truncation issues where appropriate
- Fix map_unwrap_or -> is_some_and pattern
- Fix manual_let_else pattern
- Fix unreadable_literal with separators
- Fix unused variables with underscore prefix
- Fix collection_is_never_read with assertion
- Apply swiftformat to Swift bridge code
- Run cargo fmt on all Rust code
- Move leak_test.rs to examples/memory_leak_check.rs
- No longer requires --test-threads=1 since it runs as standalone process
- Better output formatting with emojis and progress
- Update memory_tests.rs header to reference the new example
- Memory tests can now run in parallel without issues
- Test all filter types: display exclude/include windows, display
  exclude/include applications, single window capture
- Add audio and microphone (macOS 15+) capture testing
- Exercise all SCShareableContent property access
- Test multiple configuration variations
- Use SharedHandler wrapper to share handler across output types
- Track and report sample counts per output type
- Add examples 12-15 to README.md examples list
- Add examples 10-15 to lib.rs documentation
- Update CHANGELOG with recent changes
- Document memory leak example, batch FFI, and Swift boundary improvements
- Add #available checks for macOS 15.0+ APIs (SCRecordingOutput, microphone)
- Add #available checks for macOS 14.0+ APIs (screenshot, content picker)
- Add #available checks for macOS 14.2+ APIs (menu bar, presenter overlay)
- Add #available checks for macOS 13.0+ APIs (audio capture)
- Update Package.swift to target macOS 12.3 as minimum
- Fixes CI build failures on macOS 13 (Ventura)
- SCScreenshotConfiguration and related types only exist in macOS 26+ SDK
- Split SDK detection to support both macOS 15 and macOS 26 SDK checks
- Ensures CI builds on older macOS versions without compilation errors
…ibility

The .microphone case was only added in macOS 15.0, causing compile errors
on older SDKs. Using rawValue == 2 allows compilation on any SDK while
still correctly handling the microphone output type at runtime.
…, and Microphone

- content_rect() requires macos_14_2 feature
- point_pixel_scale() requires macos_14_0 feature
- Add wildcard match arm for non-macos_15_0 builds to handle Microphone variant
- Fix method names: presentation_timestamp(), image_buffer(), io_surface()
- Fix IOSurface methods: width(), height() (not get_*)
- Add macOS 26.0 (Tahoe) to platform requirements
@1313
1313 force-pushed the release-plz-2025-11-30T15-34-27Z branch from 7f98471 to e87ed1e Compare November 30, 2025 15:39
@1313 1313 closed this Nov 30, 2025
@1313
1313 deleted the release-plz-2025-11-30T15-34-27Z branch May 18, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant