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

@ -42,54 +42,38 @@ class SrsConsumer;
class SrsHttpConn;
class SrsResponseOnlyHttpConn;
/**
* The message consumer which consume a message.
*/
// The message consumer which consume a message.
class ISrsMessageConsumer
{
public:
ISrsMessageConsumer();
virtual ~ISrsMessageConsumer();
public:
/**
* Consume the received message.
* @remark user must free this message.
*/
// Consume the received message.
// @remark user must free this message.
virtual srs_error_t consume(SrsCommonMessage* msg) = 0;
};
/**
* The message pumper to pump messages to processer.
*/
// The message pumper to pump messages to processer.
class ISrsMessagePumper : public ISrsMessageConsumer
{
public:
ISrsMessagePumper();
virtual ~ISrsMessagePumper();
public:
/**
* Whether the pumper is interrupted.
* For example, when pumpter is busy, it's interrupted,
* please wait for a while then try to feed the pumper.
*/
// Whether the pumper is interrupted.
// For example, when pumpter is busy, it's interrupted,
// please wait for a while then try to feed the pumper.
virtual bool interrupted() = 0;
/**
* Interrupt the pumper for a error.
*/
// Interrupt the pumper for a error.
virtual void interrupt(srs_error_t error) = 0;
/**
* When start the pumper.
*/
// When start the pumper.
virtual void on_start() = 0;
/**
* When stop the pumper.
*/
// When stop the pumper.
virtual void on_stop() = 0;
};
/**
* the recv thread, use message handler to handle each received message.
*/
// The recv thread, use message handler to handle each received message.
class SrsRecvThread : public ISrsCoroutineHandler
{
protected:
@ -117,19 +101,17 @@ private:
virtual srs_error_t do_cycle();
};
/**
* the recv thread used to replace the timeout recv,
* which hurt performance for the epoll_ctrl is frequently used.
* @see: SrsRtmpConn::playing
* @see: https://github.com/ossrs/srs/issues/217
*/
// The recv thread used to replace the timeout recv,
// which hurt performance for the epoll_ctrl is frequently used.
// @see: SrsRtmpConn::playing
// @see: https://github.com/ossrs/srs/issues/217
class SrsQueueRecvThread : public ISrsMessagePumper
{
private:
std::vector<SrsCommonMessage*> queue;
SrsRecvThread trd;
SrsRtmpServer* rtmp;
// the recv thread error code.
// The recv thread error code.
srs_error_t recv_error;
SrsConsumer* _consumer;
public:
@ -153,10 +135,8 @@ public:
virtual void on_stop();
};
/**
* the publish recv thread got message and callback the source method to process message.
* @see: https://github.com/ossrs/srs/issues/237
*/
// The publish recv thread got message and callback the source method to process message.
// @see: https://github.com/ossrs/srs/issues/237
class SrsPublishRecvThread : virtual public ISrsMessagePumper, virtual public ISrsReloadHandler
#ifdef SRS_PERF_MERGED_READ
, virtual public IMergeReadHandler
@ -166,27 +146,27 @@ private:
SrsRecvThread trd;
SrsRtmpServer* rtmp;
SrsRequest* req;
// the msgs already got.
// The msgs already got.
int64_t _nb_msgs;
// The video frames we got.
uint64_t video_frames;
// for mr(merged read),
// For mr(merged read),
// @see https://github.com/ossrs/srs/issues/241
bool mr;
int mr_fd;
srs_utime_t mr_sleep;
// for realtime
// For realtime
// @see https://github.com/ossrs/srs/issues/257
bool realtime;
// the recv thread error code.
// The recv thread error code.
srs_error_t recv_error;
SrsRtmpConn* _conn;
// the params for conn callback.
// The params for conn callback.
SrsSource* _source;
// the error timeout cond
// The error timeout cond
// @see https://github.com/ossrs/srs/issues/244
srs_cond_t error;
// merged context id.
// The merged context id.
int cid;
int ncid;
public:
@ -194,9 +174,7 @@ public:
int mr_sock_fd, srs_utime_t tm, SrsRtmpConn* conn, SrsSource* source, int parent_cid);
virtual ~SrsPublishRecvThread();
public:
/**
* wait for error for some timeout.
*/
// Wait for error for some timeout.
virtual srs_error_t wait(srs_utime_t tm);
virtual int64_t nb_msgs();
virtual uint64_t nb_video_frames();
@ -226,12 +204,10 @@ private:
virtual void set_socket_buffer(srs_utime_t sleep_v);
};
/**
* The HTTP receive thread, try to read messages util EOF.
* For example, the HTTP FLV serving thread will use the receive thread to break
* when client closed the request, to avoid FD leak.
* @see https://github.com/ossrs/srs/issues/636#issuecomment-298208427
*/
// The HTTP receive thread, try to read messages util EOF.
// For example, the HTTP FLV serving thread will use the receive thread to break
// when client closed the request, to avoid FD leak.
// @see https://github.com/ossrs/srs/issues/636#issuecomment-298208427
class SrsHttpRecvThread : public ISrsCoroutineHandler
{
private: