1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Merge branch 'rtc' of https://github.com/xiaozhihong/srs into xiaozhihong-rtc

This commit is contained in:
winlin 2020-03-13 21:18:09 +08:00
commit d21ef106a0
35 changed files with 3620 additions and 20 deletions

View file

@ -41,6 +41,7 @@ class SrsServer;
class SrsConnection;
class SrsHttpServeMux;
class SrsHttpServer;
class SrsRtcServer;
class SrsIngester;
class SrsHttpHeartbeat;
class SrsKbps;
@ -69,6 +70,8 @@ enum SrsListenerType
SrsListenerRtsp = 4,
// TCP stream, FLV stream over HTTP.
SrsListenerFlv = 5,
// UDP remux, rtp over udp
SrsListenerRtc = 6,
};
// A common tcp listener, for RTMP/HTTP server.
@ -156,6 +159,19 @@ public:
virtual ~SrsUdpCasterListener();
};
// A UDP listener, for udp remux rtc server
class SrsRtcListener : public SrsListener
{
protected:
SrsUdpMuxListener* listener;
ISrsUdpMuxHandler* rtc;
public:
SrsRtcListener(SrsServer* svr, SrsRtcServer* rtc_svr, SrsListenerType t);
virtual ~SrsRtcListener();
public:
virtual srs_error_t listen(std::string i, int p);
};
// Convert signal to io,
// @see: st-1.9/docs/notes.html
class SrsSignalManager : public ISrsCoroutineHandler
@ -225,6 +241,7 @@ private:
// TODO: FIXME: rename to http_api
SrsHttpServeMux* http_api_mux;
SrsHttpServer* http_server;
SrsRtcServer* rtc_server;
SrsHttpHeartbeat* http_heartbeat;
SrsIngester* ingester;
SrsCoroutineManager* conn_manager;
@ -303,6 +320,7 @@ private:
virtual srs_error_t listen_http_api();
virtual srs_error_t listen_http_stream();
virtual srs_error_t listen_stream_caster();
virtual srs_error_t listen_rtc();
// Close the listeners for specified type,
// Remove the listen object from manager.
virtual void close_listeners(SrsListenerType type);
@ -338,6 +356,8 @@ public:
public:
virtual srs_error_t on_publish(SrsSource* s, SrsRequest* r);
virtual void on_unpublish(SrsSource* s, SrsRequest* r);
// listeners commuction
virtual SrsListener* find_listener(SrsListenerType type);
};
#endif