Skip to main content

Module onvif

Module onvif 

Source
Expand description

ONVIF (Profile S MVP): WS-Discovery, a device probe, and PTZ control.

All SOAP is hand-rolled with format! and parsed by substring extraction (no XML crate, per the kernel’s offline-build constraint). Authentication uses a WS-Security UsernameToken with a PasswordDigest = base64(sha1(nonce + created + password)) built from the existing sha1 + base64 crates.

Scope (intentionally narrow): device identification (GetDeviceInformation), service discovery (GetCapabilities, falling back to GetServices), media profiles (GetProfiles), best-effort stream URI (GetStreamUri), and PTZ (ContinuousMove / Stop / GetPresets / GotoPreset). Events, Profile G (recording/replay), Profile T, imaging, and absolute/relative moves are out of scope.

Structs§

DiscoveredOnvifDevice
A device found by WS-Discovery.

Functions§

continuous_move
Continuously pan/tilt/zoom at the given normalized velocities (each clamped to -1.0..=1.0). The motion runs until stop (or the device’s own timeout).
discover
Multicast a WS-Discovery Probe and collect ProbeMatch replies for the configured window.
get_presets
Fetch the camera’s PTZ presets, persist them (upsert + prune stale), and return the current set.
goto_preset
Move the camera to a stored preset by its device token.
load_onvif
Load a camera’s persisted ONVIF profile (404 when the camera has not been probed yet).
probe
Probe a camera’s ONVIF interface and persist the result into camera_onvif.
stop
Stop all PTZ motion (pan/tilt + zoom).