Skip to main content

Crate dahua_camera_core

Crate dahua_camera_core 

Source
Expand description

Shared types for the dahua-camera workspace.

This crate is the centre of the dependency graph. Every other crate depends on it; it depends on none of them. It contains no I/O: no sockets, no files, no spawning. What lives here is either plain data or an abstract port — a trait whose implementations live in the crates above.

Keeping it I/O-free is what allows a consumer to depend on, say, dahua-camera-events without dragging in retina, and what makes every type here cheap to use in a test.

§Contents

ModuleWhat it holds
idCameraId
cameraCameraConfig, CameraStatus, CameraStats, AppConfig
capabilityCapability, CapabilitySet — what a device reports it can do
codecCodecParameters, StreamParams
errorCameraError, Result
eventEvent, EventKind, EventState, Severity, BoundingBox
frameSample (aka Frame) — one encoded access unit
portsCross-crate traits: control, events, configuration

§Nothing is assumed

A CapabilitySet is empty until a probe confirms something. Calls that depend on hardware go through CapabilitySet::require, which refuses with CameraError::CapabilityUnsupported rather than sending a request to a device that may not understand it.

§Safety

Read Event before acting on any detection. Camera IVS/SMD analytics are an operator aid and are not safety-rated. See SAFETY.md at the workspace root.

§Features

  • decode — adds the CameraError::Decode variant. Enabled for you by dahua-camera-rtsp/decode; there is no reason to set it directly.
  • testing — shared test fixtures. A dev-dependency only.

Re-exports§

pub use camera::AppConfig;
pub use camera::CameraConfig;
pub use camera::CameraStats;
pub use camera::CameraStatus;
pub use camera::ServerConfig;
pub use capability::Capability;
pub use capability::CapabilitySet;
pub use codec::CodecParameters;
pub use codec::SharedParams;
pub use codec::StreamParams;
pub use error::CameraError;
pub use error::Result;
pub use event::BoundingBox;
pub use event::Event;
pub use event::EventKind;
pub use event::EventState;
pub use event::Severity;
pub use frame::Frame;
pub use frame::Sample;
pub use frame::SharedSample;
pub use id::CameraId;
pub use ports::UnsupportedControl;
pub use ports::UnsupportedControlFactory;

Modules§

camera
The camera aggregate: how a camera is configured and what state it is in.
capability
What a device actually reports it can do.
codec
H.264 codec parameters carried out of band from the sample data.
error
The error type every layer speaks.
event
Camera analytics events.
frame
Encoded video samples as they travel from the camera to subscribers.
id
The camera identifier.
ports
Traits that cross a crate boundary.
testing
Fixtures shared by every crate’s tests.