Example #1
0
 public void initialise(string homeHubId, string node)
 {
     if (_videoHub != null)
     {
         _videoHub.Closed();
         _videoHub.Dispose();
     }
     _videoHub = VideoHub.Get(homeHubId, node);
     Debug.WriteLine(string.Format("Initialised camera {0} on hub {1}", node, homeHubId));
 }
Example #2
0
        public virtual void Dispose()
        {
            if (_videoHub != null)
            {
                _videoHub.Closed();
                _videoHub.Dispose();
                _videoHub = null;
            }

            Debug.WriteLine("Camera Conection closed");
        }
Example #3
0
        public static VideoHub Get(string homeHubId, string node)
        {
            lock (_instances)
            {
                VideoHub videoHub = null;
                var streamId = getStreamId(homeHubId, node);
                if (_instances.ContainsKey(streamId))
                {
                    videoHub = _instances[streamId];
                }
                else {
                    videoHub = new VideoHub(streamId, homeHubId, node);
                    _instances[streamId] = videoHub;
                }

                videoHub.AddRef();
                return videoHub;
            }
        }
 public override void Close()
 {
     base.Close();
     if (_videoHub != null)
     {
         _videoHub.Closed();
         _videoHub.Dispose();
         _videoHub = null;
     }
 }
 public VideoHubStream(string hubId, string node)
 {
     _videoHub = VideoHub.Get(hubId, node);
 }
Example #6
0
        public VideoHubWaitable(VideoHub videoHub, bool useRecent = false)
        {
            _videoHub = videoHub;

            Push();

            _videoHub.OnData += _videoHub_OnData;
            _videoHub.OnClosed += _videoHub_OnClosed;

            if (useRecent)
            {
                var recentData = _videoHub.GetRecent();
                if (recentData != null)
                {
                    Push(recentData);
                }
            }
        }