Table of Contents

Class OnvifClient2

Namespace
VAST.ONVIF
Assembly
VAST.ONVIF.dll

Provides an ONVIF client implementation using the Media2 service profile. This client communicates with ONVIF-compliant devices to retrieve media profiles, streaming URIs, PTZ controls, events, and device I/O information.

public class OnvifClient2 : IOnvifClient, IDisposable
Inheritance
OnvifClient2
Implements
Inherited Members

Constructors

OnvifClient2(string, string, string)

Initializes a new instance of the OnvifClient2 class.

public OnvifClient2(string uri, string username, string password)

Parameters

uri string

The URI of the ONVIF device.

username string

The username for device authentication.

password string

The password for device authentication.

Methods

Dispose()

Releases all resources used by the OnvifClient2 class. Unsubscribes from events, removes the pullpoint instance, and disposes of the timeline cacher.

public override void Dispose()

OpenAsync()

Opens the connection to the ONVIF device asynchronously by retrieving device information, capabilities, and media profiles using the Media2 service.

public override Task OpenAsync()

Returns

Task

A Task representing the asynchronous operation.

Exceptions

Exception

Thrown when the ONVIF Profile 2 client fails to initialize.

TakeSnapshot()

Captures a snapshot image from the ONVIF device asynchronously.

public override Task<Stream> TakeSnapshot()

Returns

Task<Stream>

A Task<TResult> containing the snapshot image as a Stream.

Exceptions

Exception

Thrown when snapshot is not supported or the request fails.

Events

Notification

Occurs when a pullpoint notification is received from the ONVIF device.

public event EventHandler Notification

Event Type

EventHandler