void pause(StreamWriter sw, string req, string seq) { string session = getSession(req); RTPPlayer p = _server.rps[session]; p.stop(); send_ok(sw, seq, session); }
void teardown(StreamWriter sw, string req, string seq) { string session = getSession(req); RTPPlayer p = _server.rps[session]; p.stop(); _server.rps.Remove(session); send_ok(sw, seq, session); }
void setup(StreamWriter sw, string req, string seq) { Regex path_rex = new Regex("^\\S+\\s+(\\S+).*", RegexOptions.Singleline); Regex port_rex = new Regex(".*client_port=\\s+(\\d+).*", RegexOptions.Multiline); string path = path_rex.Match(req).Groups[1].Value; string port = port_rex.Match(req).Groups[1].Value; IPEndPoint remote = (IPEndPoint)_sock.RemoteEndPoint; RTPPlayer p = new RTPPlayer(remote.Address.ToString(), int.Parse(port), _server.vcs[path]); string session = Guid.NewGuid().ToString().Substring(0, 8); _server.rps.Add(session, p); sw.WriteLine("RTSP/1.0 200 OK"); sw.WriteLine("CSeq: {0}", seq); sw.WriteLine("Session: {0}", session); }
void setup(StreamWriter sw, string req, string seq) { Regex path_rex = new Regex("^\\S+\\s+(\\S+).*", RegexOptions.Singleline); Regex port_rex = new Regex(".*client_port=\\s+(\\d+).*", RegexOptions.Multiline); string path = path_rex.Match(req).Groups[1].Value; string port = port_rex.Match(req).Groups[1].Value; IPEndPoint remote = (IPEndPoint)_sock.RemoteEndPoint; RTPPlayer p = new RTPPlayer(remote.Address.ToString(), int.Parse(port), _server.vcs[path]); string session=Guid.NewGuid().ToString().Substring(0, 8); _server.rps.Add(session, p); sw.WriteLine("RTSP/1.0 200 OK"); sw.WriteLine("CSeq: {0}", seq); sw.WriteLine("Session: {0}", session); }