public Camera(WebCommander commander, LoginResult session, Channel data) { InArchiveMode = false; _commander = commander; _session = session; _data = data; }
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; }
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") + "¬_found_dir=1" + "&dojo.preventCache=" + TimeMarker()); } return cr != null ? new ArchiveNabvigationResult(cr) : null; }
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; }
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; }
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; }
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; }
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; }
public string GetStatus(Channel cnannel) { return (string) Obj[cnannel.Id]; }