Example #1
0
 public Camera(WebCommander commander, LoginResult session, Channel data)
 {
     InArchiveMode = false;
     _commander = commander;
     _session = session;
     _data = data;
 }
Example #2
0
        public ArchiveNabvigationResult ArchiveFrameNext( LoginResult lr, Channel channel)
        {
            JObject cr = null;
            //lock (_lo)
              //  {
                cr = SendCommandReturnJson(_server + "/frame_next?sid=" + lr.SessionId + "&cid=" + channel.Id + "&tid=" + channel.Id.Replace("-", ""));
               // }

            return cr != null ? new ArchiveNabvigationResult(cr) : null;
        }
Example #3
0
 public ArchiveNabvigationResult ArchiveSeek( LoginResult lr, Channel channel, DateTime seek)
 {
     JObject cr = null;
     lock (_lo)
     {
         cr =
             SendCommandReturnJson(_server + "/seek?sid=" + lr.SessionId + "&cid=" + channel.Id + "&tid=" +
                                   channel.Id.Replace("-", "") + "&t=" +
                                   seek.ToString("yyyy-MM-dd" + "'%'20" + "HH:mm:ss.ffffff") + "&not_found_dir=1" +
                                   "&dojo.preventCache=" + TimeMarker());
     }
     return cr != null ? new ArchiveNabvigationResult(cr) : null;
 }
Example #4
0
 public bool AddCameraToDirection(Channel channel, int dir)
 {
     if(_camerasToDirection.ContainsKey(dir))
     {
        if( _camerasToDirection[dir].Exists(each=>channel.Id==each))
        {
            return false;
        }
         _camerasToDirection[dir].Add(channel.Id);
         return true;
     }
     _camerasToDirection.Add(dir,new List<string> {channel.Id});
     return true;
 }
Example #5
0
        public byte[] GetJPEG( LoginResult lr, Channel channel, object lockObject,int cadrNumber)
        {
            byte[] res = null;
            lock (lockObject)
            {
                    try
                    {
                        res =
                            SendCommand(_videoServer + "/jpeg/" + channel.Address + "/u?id=" + lr.SessionId + "/" +
                                        channel.Id + "&t=" + cadrNumber + TimeMarker());
                    }
                    catch (Exception)
                    {

                    }

               }
            return res;
        }
Example #6
0
 public ArchiveNabvigationResult ArchiveStop( LoginResult lr, Channel channel)
 {
     var cr = SendCommandReturnJson(_server + "/stop?sid=" + lr.SessionId + "&cid=" + channel.Id);
     return cr != null ? new ArchiveNabvigationResult(cr) : null;
 }
Example #7
0
 public AtrchiveEnterResult ArchiveEnter( LoginResult lr, Channel channel, bool enterflag, string sip = "127.0.0.1")
 {
     var cr = SendCommandReturnJson(_server + "/archive_enter?sid=" + lr.SessionId + "&cid=" + channel.Id + "&enter=" + enterflag.ToString().ToLower()+"&sip="+_server.Remove(_server.LastIndexOf(':')));
     return cr != null ? new AtrchiveEnterResult(cr) : null;
 }
Example #8
0
        public StatusResult GetStatus(LoginResult lr, Channel channel)
        {
            JObject cr = null;
            lock (_lo)
            {

                try
                {
                    cr =
                        SendCommandReturnJson(_server + "/get_status?sid=" + lr.SessionId + "&tid=" +
                                              channel.Id.Replace("-", "") + "&dojo.preventCache=" + TimeMarker());
                }
                catch (Exception)
                {

                }
            }
            return cr != null ? new StatusResult(cr) : null;
        }
Example #9
0
 public string GetStatus(Channel cnannel)
 {
     return (string) Obj[cnannel.Id];
 }