pub struct PreviewDiagnostics {
pub frames_received: AtomicU64,
pub source_width: AtomicU32,
pub source_height: AtomicU32,
pub source_fps_hundredths: AtomicU32,
pub first_frame_dump_path: Mutex<Option<PathBuf>>,
}Expand description
Tauri-managed diagnostic counters for the camera pipeline.
All counters reset on start_preview so the user gets a
fresh-from-zero ticker each session — easier to eyeball “the
number is going up” without comparing against a baseline.
Fields§
§frames_received: AtomicU64Number of frames the worker has pulled from gst since the
current session started. Resets on each start_preview.
source_width: AtomicU32Source frame width in pixels (as reported by gst’s caps
negotiation). 0 until first frame.
source_height: AtomicU32Source frame height in pixels. 0 until first frame.
source_fps_hundredths: AtomicU32Source framerate × 100 (encoded as integer for atomic
storage; 30 fps → 3000, 29.97 → 2997). 0 until known.
first_frame_dump_path: Mutex<Option<PathBuf>>Path of the first-frame PNG dump, if one has been written
this session. None until first frame dumps successfully.
Implementations§
Source§impl PreviewDiagnostics
impl PreviewDiagnostics
Sourcepub fn reset(&self)
pub fn reset(&self)
Reset all counters. Called on every start_preview so the
user sees a fresh ticker per session.
Sourcepub fn record_frame(&self)
pub fn record_frame(&self)
Record that one frame just arrived. Worker thread calls this
on every successful next_frame().
Sourcepub fn record_source(&self, width: u32, height: u32, fps: f64)
pub fn record_source(&self, width: u32, height: u32, fps: f64)
Record the source dims + fps once they’re known (after the gst caps negotiation completes — practically, on opening the stream). Cheap to call repeatedly with the same values.
Sourcepub fn try_claim_dump_slot(&self, path: PathBuf) -> bool
pub fn try_claim_dump_slot(&self, path: PathBuf) -> bool
Set the first-frame dump path (one-shot). Returns true on
the first call (caller should encode + write the PNG),
false on subsequent calls (already dumped this session).
Sourcepub fn snapshot(&self) -> DiagnosticsSnapshot
pub fn snapshot(&self) -> DiagnosticsSnapshot
Read a serialisable snapshot. The IPC command returns this; Leptos polls every 500ms.
Trait Implementations§
Source§impl Default for PreviewDiagnostics
impl Default for PreviewDiagnostics
Source§fn default() -> PreviewDiagnostics
fn default() -> PreviewDiagnostics
Auto Trait Implementations§
impl !Freeze for PreviewDiagnostics
impl RefUnwindSafe for PreviewDiagnostics
impl Send for PreviewDiagnostics
impl Sync for PreviewDiagnostics
impl Unpin for PreviewDiagnostics
impl UnsafeUnpin for PreviewDiagnostics
impl UnwindSafe for PreviewDiagnostics
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().