Skip to content

IDeviceEventStreams

Interface in Oadm.Sdk.Devices · Oadm.Sdk.dll

Opens the event stream of a managed device on the server (RTSP metadata, rtsp://<device>/axis-media/media.amp?video=0&audio=0&event=on) with the credentials OADM stores for it. The credentials never reach the plugin. Offered to core plugins through ICorePluginContext.EventStreams.

public interface IDeviceEventStreams

Guide: Devices and VAPIX

Task<int?> GetRtspPortAsync(Guid deviceId, CancellationToken ct)

Default implementation

The RTSP port stored for a device (a port forward to port 554, e.g. a camera behind NAT), null = 554. Every IDeviceEventStreams.OpenAsync uses it. Hosts without the setting return null.

Task<IReadOnlyDictionary<Guid, int>> GetRtspPortsAsync(IReadOnlyCollection<Guid> deviceIds, CancellationToken ct)

Default implementation

The stored RTSP ports of many devices in one read; devices on the default port are left out.

Task<IDeviceEventSource> OpenAsync(Guid deviceId, CancellationToken ct)

Connects, authenticates and starts the stream. Throws DeviceStreamException when the device refuses or does not answer, KeyNotFoundException for an unknown device.

Task SetRtspPortAsync(Guid deviceId, int? port, CancellationToken ct)

Default implementation

Stores the RTSP port of a device (1..65535; null or 554 = the default). Throws ArgumentOutOfRangeException for another value, NotSupportedException on hosts without the setting.

Task SetRtspPortsAsync(IReadOnlyCollection<Guid> deviceIds, int? port, IReadOnlyCollection<Guid>? managed, CancellationToken ct)

Default implementation

Stores one RTSP port for many devices in one write. With managed the ports of devices that are no longer managed are dropped in the same write.