Class OnvifClient2
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
uristringThe URI of the ONVIF device.
usernamestringThe username for device authentication.
passwordstringThe 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
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