Beispiel #1
0
 private static void CleanUp()
 {
     InnerRequestProcessors.Clear();
     InnerStaticRedirectionTable.Clear();
     _listener = null;
     _fileRequestController.Dispose();
     _statisticsController.Dispose();
     ServiceUris.Clear();
 }
Beispiel #2
0
        /// <summary>
        /// Retrieves Onvif service URIs from the device and stores them in the ServiceUris dictionary
        /// </summary>
        /// <param name="ip">IP Address</param>
        /// <param name="onvifPort">Port to connect on (normally HTTP - 80)</param>
        /// <param name="user">User name</param>
        /// <param name="password">User's Password</param>
        private void GetOnvifUris(Camera cam, int onvifPort)
        {
            ServiceUris.Clear();

            DeviceClient client = OnvifServices.GetOnvifDeviceClient(cam.IP, onvifPort, DeviceTimeOffset, cam.User, cam.Password);

            Service[] svc = client.GetServices(IncludeCapability: false); // Bosch Autodome 800 response can't be deserialized if IncludeCapability enabled
            foreach (Service s in svc)
            {
                ServiceUris.Add(s.Namespace, s.XAddr);
            }

            // Check if this is an Onvif enabled PTZ
            if (ServiceUris.ContainsKey(OnvifNamespace.PTZ))
            {
                IsPtz = true;
            }
            else
            {
                IsPtz = false;
            }
        }