Skip to main content

Crate animacamos_core

Crate animacamos_core 

Source
Expand description

§animacamos-core

Platform-neutral core primitives for real-time video / camera applications.

This crate defines the fundamental contract shared by any application that captures, transports, or outputs video frames in real time:

  • Session — a logical video session with a lifecycle.
  • Device — a source or sink device descriptor.
  • VideoFormat — width / height / pixel format / frame rate.
  • VideoFrame — a single decoded frame + timing + sequence.
  • FrameHub — a low-latency, latest-frame-wins fan-out for frames.
  • CameraOutput — the trait a platform backend implements.
  • CoreEvent / EventBus — a tiny event system.
  • CoreError — the public error type.

The core is deliberately agnostic: it has no dependency on WebRTC, signaling, Tauri, a UI framework, a specific OS, or any concrete virtual camera implementation. It only defines the contract.

§Example

use animacamos_core::{Session, VideoFormat, PixelFormat, FrameHub, VideoFrame};

let mut session = Session::new();
session.connect().unwrap();
assert_eq!(session.state(), animacamos_core::SessionState::Connecting);

let hub = FrameHub::new();
let fmt = VideoFormat::new(1920, 1080, PixelFormat::I420, 30).unwrap();
let frame = VideoFrame::new(fmt, vec![0u8; 1920 * 1080 * 3 / 2], 0).unwrap();
hub.publish(frame);

Re-exports§

pub use device::Device;
pub use device::DeviceKind;
pub use device::DeviceMetadata;
pub use error::CoreError;
pub use error::Result;
pub use events::CoreEvent;
pub use events::EventBus;
pub use events::EventSubscription;
pub use format::PixelFormat;
pub use format::VideoFormat;
pub use frame::VideoFrame;
pub use hub::FrameHub;
pub use hub::FrameHubStats;
pub use output::CameraCapabilities;
pub use output::CameraOutput;
pub use output::CameraOutputStatus;
pub use output::FrameCounters;
pub use session::Session;
pub use session::SessionId;
pub use session::SessionState;

Modules§

device
Device — a source or sink descriptor.
error
Public error type for the core.
events
A tiny event system: EventBus + CoreEvent.
format
VideoFormat — width / height / pixel format / frame rate.
frame
VideoFrame — a single decoded frame + timing + sequence.
hub
FrameHub — a low-latency, latest-frame-wins fan-out for video frames.
output
CameraOutput — the trait a platform backend implements.
session
Session — a logical video session with a lifecycle.

Constants§

VERSION
Library version as a static string.