pub struct CameraPipeline {
cancel: Arc<AtomicBool>,
handle: Option<JoinHandle<()>>,
}Expand description
Camera-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 CameraPipeline
impl CameraPipeline
Sourcepub fn spawn(app: AppHandle, camera_id: String) -> Result<Self, CameraError>
pub fn spawn(app: AppHandle, camera_id: String) -> Result<Self, CameraError>
Spawn the worker thread for the camera identified by
camera_id (M-CAM.4 — was hard-coded to the OS default
device in M-CAM.3). Returns immediately; the worker
transitions the preview lifecycle to Running once
next_frame() succeeds (after any macOS permission prompt
resolves). An empty camera_id keeps the legacy “OS default”
behaviour so the picker can start without a selection.
§Errors
Returns Err only if the OS refuses to spawn a thread (which
effectively never happens). gst-side errors are handled inside
the worker — the worker logs via tracing::error! and
advances the lifecycle back to Idle so the UI shows a
recovery state.
Trait Implementations§
Source§impl Drop for CameraPipeline
impl Drop for CameraPipeline
Auto Trait Implementations§
impl Freeze for CameraPipeline
impl !RefUnwindSafe for CameraPipeline
impl Send for CameraPipeline
impl Sync for CameraPipeline
impl Unpin for CameraPipeline
impl UnsafeUnpin for CameraPipeline
impl !UnwindSafe for CameraPipeline
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