Exemplo n.º 1
0
        public PublishedCamera(PublishedCameraProfile profile, PublishedDestination destination)
        {
            if (profile == null)
            throw new ArgumentNullException("profile");
              if (destination == null)
            throw new ArgumentNullException("destination");

              Profile = profile;
              Destination = destination;
        }
Exemplo n.º 2
0
        public PublishedCamera(PublishedCameraProfile profile, PublishedDestination destination)
        {
            if (profile == null)
            {
                throw new ArgumentNullException("profile");
            }
            if (destination == null)
            {
                throw new ArgumentNullException("destination");
            }

            Profile     = profile;
            Destination = destination;
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            bool result = false;

            if (obj != null)
            {
                PublishedDestination other = obj as PublishedDestination;
                if (other != null && this.Id == other.Id)
                {
                    result = true;
                }
            }

            return(result);
        }
Exemplo n.º 4
0
        public PublishedCamera PublishCamera(PublishedCameraProfile profile, PublishedDestination destination)
        {
            lock (_syncRoot)
              {
            if (profile == null)
              throw new ArgumentNullException("profile");
            if (destination == null)
              throw new ArgumentNullException("destination");

            PublishedCamera camera = _cameras.Find(c => c.Profile.CameraId == profile.CameraId && c.Destination == destination);
            if (camera == null)
            {
              camera = new PublishedCamera(profile, destination);
              Locator.Get<IStreamingManager>().StartCameraStreaming(camera);
              _cameras.Add(camera);

              DA::PublishedCamera entity = new DA::PublishedCamera()
              {
            Id = camera.Id,
            Profile = new DA::PublishedCameraProfile()
            {
              CameraId = profile.CameraId,
              CameraName = profile.CameraName,
              CameraThumbnail = profile.CameraThumbnail,
              DeviceServiceHostName = profile.DeviceServiceHostName,
              DeviceServiceUri = profile.DeviceServiceUri,
            },
            Destination = new DA::Destination()
            {
              Port = camera.Destination.Port,
            },
              };
              Locator.Get<IPublishedCameraRepository>().Save(entity);
            }

            return camera;
              }
        }
Exemplo n.º 5
0
        public void UnpublishCamera(string cameraId, PublishedDestination destination)
        {
            lock (_syncRoot)
              {
            if (destination == null)
              throw new ArgumentNullException("destination");

            PublishedCamera camera = _cameras.Find(c => c.Profile.CameraId == cameraId && c.Destination.Port == destination.Port);
            if (camera != null)
            {
              Locator.Get<IStreamingManager>().StopCameraStreaming(camera);
              Locator.Get<IPublishedCameraRepository>().Remove(camera.Id);
              _cameras.Remove(camera);
            }
              }
        }