Beispiel #1
0
            void pause(StreamWriter sw, string req, string seq)
            {
                string    session = getSession(req);
                RTPPlayer p       = _server.rps[session];

                p.stop();
                send_ok(sw, seq, session);
            }
Beispiel #2
0
            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);
            }
Beispiel #3
0
            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);
            }
Beispiel #4
0
 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);
 }