Skip to main content

PreviewDiagnostics

Struct PreviewDiagnostics 

Source
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: AtomicU64

Number of frames the worker has pulled from gst since the current session started. Resets on each start_preview.

§source_width: AtomicU32

Source frame width in pixels (as reported by gst’s caps negotiation). 0 until first frame.

§source_height: AtomicU32

Source frame height in pixels. 0 until first frame.

§source_fps_hundredths: AtomicU32

Source 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

Source

pub fn reset(&self)

Reset all counters. Called on every start_preview so the user sees a fresh ticker per session.

Source

pub fn record_frame(&self)

Record that one frame just arrived. Worker thread calls this on every successful next_frame().

Source

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.

Source

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).

Source

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

Source§

fn default() -> PreviewDiagnostics

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,