Exemple #1
0
        private static Camera UnpublishCameraSync(Camera camera, string address, int port)
        {
            MediaService service = GetDeviceConnectorServiceSync(camera.HostUri);

              if (service != null)
              {
            UnpublishCameraRequest request = new UnpublishCameraRequest()
            {
              CameraId = camera.Id,
              Destination = new PublishDestinationData()
              {
            Address = address,
            Port = port,
              },
            };
            UnpublishCameraResponse response =
              ServiceProvider
            .GetService<IDeviceConnectorService, IDeviceConnectorCallbackService>(
              ViewModelLocator.ServiceClient, service.HostName, service.Uri.ToString())
            .UnpublishCamera(request);
              }

              return camera;
        }
        public UnpublishCameraResponse UnpublishCamera(UnpublishCameraRequest request)
        {
            try
              {
            if (request == null)
              throw new ArgumentNullException("request");

            UnpublishCameraResponse response = new UnpublishCameraResponse();

            Locator.Get<IStreamingManager>().UnpublishCamera(request.CameraId, PublishedCameraTranslator.Translate(request.Destination));

            return response;
              }
              catch (Exception ex)
              {
            throw new FaultException<DeviceConnectorServiceFault>(new DeviceConnectorServiceFault(ex.Message, ex), ex.Message);
              }
        }