public int HandleOp(IWebHostEnvironment hostEnv, COp rcop) { try { using (PtzCamera ptzCam = new PtzCamera()) { int MaxDelay = 0; var cop = Add(rcop); if (cop == COp.None) { return(6000); } while (cop != COp.None) { //Debug.WriteLine("CamOps.HandleOp " + (int)cop); var delay = ptzCam.ExecuteOp(hostEnv, cop); if (delay > MaxDelay) { MaxDelay = delay; } cop = Delete(); } // Give time for Camera to move. Delay can be adjusted ptzCam.Logout(); return(MaxDelay); } } catch { return(0); } }
public string SnapShot(IWebHostEnvironment hostEnv) { try { using (PtzCamera ptzCam = new PtzCamera()) { var link = ptzCam.GetSnapshot(hostEnv); ptzCam.Logout(); return(link); } } catch { return(""); } }
public string GetVideo(IWebHostEnvironment hostEnv, string url) { try { using (PtzCamera ptzCam = new PtzCamera()) { var link = ptzCam.GetVideo(hostEnv, url); ptzCam.Logout(); return(link); } } catch { return(""); } }