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

Refine typo in app.

This commit is contained in:
winlin 2019-04-30 08:24:52 +08:00
parent aac8a13f42
commit 45009785fb
27 changed files with 409 additions and 703 deletions

View file

@ -47,34 +47,28 @@ class SrsTcpClient;
class SrsSimpleRtmpClient;
class SrsPacket;
/**
* the state of edge, auto machine
*/
// The state of edge, auto machine
enum SrsEdgeState
{
SrsEdgeStateInit = 0,
// for play edge
// For play edge
SrsEdgeStatePlay = 100,
// play stream from origin, ingest stream
SrsEdgeStateIngestConnected = 101,
// for publish edge
// For publish edge
SrsEdgeStatePublish = 200,
};
/**
* the state of edge from user, manual machine
*/
// The state of edge from user, manual machine
enum SrsEdgeUserState
{
SrsEdgeUserStateInit = 0,
SrsEdgeUserStateReloading = 100,
};
/**
* the upstream of edge, can be rtmp or http.
*/
// The upstream of edge, can be rtmp or http.
class SrsEdgeUpstream
{
public:
@ -93,7 +87,7 @@ public:
class SrsEdgeRtmpUpstream : public SrsEdgeUpstream
{
private:
// for RTMP 302, if not empty,
// For RTMP 302, if not empty,
// use this <ip[:port]> as upstream.
std::string redirect;
SrsSimpleRtmpClient* sdk;
@ -111,9 +105,7 @@ public:
virtual void kbps_sample(const char* label, int64_t age);
};
/**
* edge used to ingest stream from origin.
*/
// The edge used to ingest stream from origin.
class SrsEdgeIngester : public ISrsCoroutineHandler
{
private:
@ -123,7 +115,7 @@ private:
SrsCoroutine* trd;
SrsLbRoundRobin* lb;
SrsEdgeUpstream* upstream;
// for RTMP 302 redirect.
// For RTMP 302 redirect.
std::string redirect;
public:
SrsEdgeIngester();
@ -143,9 +135,7 @@ private:
virtual srs_error_t process_publish_message(SrsCommonMessage* msg);
};
/**
* edge used to forward stream to origin.
*/
// The edge used to forward stream to origin.
class SrsEdgeForwarder : public ISrsCoroutineHandler
{
private:
@ -155,16 +145,12 @@ private:
SrsCoroutine* trd;
SrsSimpleRtmpClient* sdk;
SrsLbRoundRobin* lb;
/**
* we must ensure one thread one fd principle,
* that is, a fd must be write/read by the one thread.
* the publish service thread will proxy(msg), and the edge forward thread
* will cycle(), so we use queue for cycle to send the msg of proxy.
*/
// we must ensure one thread one fd principle,
// that is, a fd must be write/read by the one thread.
// The publish service thread will proxy(msg), and the edge forward thread
// will cycle(), so we use queue for cycle to send the msg of proxy.
SrsMessageQueue* queue;
/**
* error code of send, for edge proxy thread to query.
*/
// error code of send, for edge proxy thread to query.
int send_error_code;
public:
SrsEdgeForwarder();
@ -184,10 +170,7 @@ public:
virtual srs_error_t proxy(SrsCommonMessage* msg);
};
/**
* play edge control service.
* downloading edge speed-up.
*/
// The play edge control service.
class SrsPlayEdge
{
private:
@ -197,32 +180,21 @@ public:
SrsPlayEdge();
virtual ~SrsPlayEdge();
public:
/**
* always use the req of source,
* for we assume all client to edge is invalid,
* if auth open, edge must valid it from origin, then service it.
*/
// Always use the req of source,
// For we assume all client to edge is invalid,
// if auth open, edge must valid it from origin, then service it.
virtual srs_error_t initialize(SrsSource* source, SrsRequest* req);
/**
* when client play stream on edge.
*/
// When client play stream on edge.
virtual srs_error_t on_client_play();
/**
* when all client stopped play, disconnect to origin.
*/
// When all client stopped play, disconnect to origin.
virtual void on_all_client_stop();
virtual std::string get_curr_origin();
public:
/**
* when ingester start to play stream.
*/
// When ingester start to play stream.
virtual srs_error_t on_ingest_play();
};
/**
* publish edge control service.
* uploading edge speed-up.
*/
// The publish edge control service.
class SrsPublishEdge
{
private:
@ -236,17 +208,11 @@ public:
public:
virtual srs_error_t initialize(SrsSource* source, SrsRequest* req);
virtual bool can_publish();
/**
* when client publish stream on edge.
*/
// When client publish stream on edge.
virtual srs_error_t on_client_publish();
/**
* proxy publish stream to edge
*/
// Proxy publish stream to edge
virtual srs_error_t on_proxy_publish(SrsCommonMessage* msg);
/**
* proxy unpublish stream to edge.
*/
// Proxy unpublish stream to edge.
virtual void on_proxy_unpublish();
};