Added
- (async) implement futures::Stream for AsyncSCStream and recording events
- (async) multi-output AsyncSCStream (capture A/V from one stream)
- (async) [breaking] propagate stop errors in AsyncSCStream; consolidate stop delegate
- (async) [breaking] make AsyncSCStream lifecycle methods truly async
Fixed
- (stream) surface failed output-handler registration instead of dropping it silently
Other
- (deps-dev) raise bitflags cap to <2.14 (fixes fresh-resolve to 2.13.0)
- (readme) update for v8 async API
- (examples) add audio+video multi-output showcase; apply rustfmt
- restore Recall.ai sponsor banner and update v6 references to v7
Changed
-
[breaking]
AsyncSCStream::start_capture,stop_capture,update_configuration,
andupdate_content_filterare now genuinely async: they return a
StreamControlFuture(resolving toResult<(), SCError>) that you.await,
instead of blocking the calling thread on a condition variable. Awaiting them
parks the task via itsWakerand resumes from the Swift completion callback,
so they no longer stall single-threaded/current-thread executors. This makes
the async surface fully waker-based and consistent with the underlying Swift
Task { try await … }entry points.Migration: add
.await(e.g.stream.start_capture().await?). For a
blocking call, use the synchronousSCStreamdirectly via
stream.inner().start_capture(). -
AsyncSCStreamnow installs a stream delegate so that whenScreenCaptureKit
stops the stream with an error (display disconnected, permission revoked, …)
the sample iterator is closed —next().awaitresolves toNoneinstead of
pending forever — and the error is recorded (seetake_error).AsyncSCStream::new
likewise no longer silently swallows a failed output-handler registration: it
closes the stream and records the error. -
The stream engine now dispatches a single canonical stop callback,
SCStreamDelegateTrait::did_stop_with_error, on an error stop. It no longer
also callsstream_did_stopfor the same event (the previous behavior fired
both).StreamCallbacks::on_stopkeeps working (it is now driven by
did_stop_with_error).
Added
async_api::StreamControlFuture— theSendfuture returned by the
AsyncSCStreamlifecycle methods.AsyncSCStream::take_error— returns theSCErrorthat stopped the stream,
if any, afternext()reports the iterator closed.- Multi-output async capture:
AsyncSCStream::add_output_typeregisters an
additional output type (e.g. add audio to a screen stream), and
AsyncSCStream::next_typed/try_next_typed(plus theNextSampleTyped
future) yield each sample together with itsSCStreamOutputTypeso audio and
video can be captured from one stream and told apart. futures::Streamintegration (enabled by theasyncfeature, via a new
optionalfutures-coredependency):AsyncSCStream::frames/
frames_typedandAsyncSCRecordingOutput::eventsreturn
futures_core::Streams (SampleStream,TypedSampleStream,
RecordingEventStream) so captures plug into theStreamExtcombinator
ecosystem (map,filter,take,for_each,collect, …).
Deprecated
SCStreamDelegateTrait::stream_did_stop—ScreenCaptureKitonly reports
stops viadid_stop_with_error, which is now the single source of truth;
the engine no longer invokesstream_did_stop. Implementdid_stop_with_error
instead.