pub struct MicCapturePipeline {
cancel: Arc<AtomicBool>,
handle: Option<JoinHandle<()>>,
}Expand description
Mic-pipeline worker handle. Owns the spawned thread and a
cooperative cancel flag; Drop cancels + joins so a panicking
caller can never leave a zombie gst child behind.
Fields§
§cancel: Arc<AtomicBool>§handle: Option<JoinHandle<()>>Implementations§
Source§impl MicCapturePipeline
impl MicCapturePipeline
Sourcepub fn spawn(
app: AppHandle,
mic_id: String,
native_id: String,
mixer: Option<SharedAudioMixer>,
) -> Result<Self, MicError>
pub fn spawn( app: AppHandle, mic_id: String, native_id: String, mixer: Option<SharedAudioMixer>, ) -> Result<Self, MicError>
Spawn the worker thread. Returns immediately; the worker
transitions [MicLifecycle] to Running once
next_chunk() first succeeds (after any macOS permission
prompt resolves).
mixer controls whether the worker forwards samples into the
recorder’s shared [AudioMixer]. Pass None for preview
(meter only — what the picker uses); pass Some(mixer) for
recording. Mirror of the SCK system-audio
start
vs. start_with_mixer
split. Without this distinction, preview samples accumulate
in the mixer and contaminate the next recording.
§Errors
Returns Err only if the OS refuses to spawn a thread
(effectively never happens). gst-side errors are handled
inside the worker — the worker logs via tracing::error!
and resets the lifecycle to Idle so the UI shows a recovery
state.
Trait Implementations§
Source§impl Drop for MicCapturePipeline
impl Drop for MicCapturePipeline
Auto Trait Implementations§
impl Freeze for MicCapturePipeline
impl !RefUnwindSafe for MicCapturePipeline
impl Send for MicCapturePipeline
impl Sync for MicCapturePipeline
impl Unpin for MicCapturePipeline
impl UnsafeUnpin for MicCapturePipeline
impl !UnwindSafe for MicCapturePipeline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more