diff --git a/trunk/src/app/srs_app_pithy_print.cpp b/trunk/src/app/srs_app_pithy_print.cpp index cef07f1de..09ae09cf6 100644 --- a/trunk/src/app/srs_app_pithy_print.cpp +++ b/trunk/src/app/srs_app_pithy_print.cpp @@ -112,6 +112,8 @@ SrsPithyPrint::SrsPithyPrint(int _stage_id) #define SRS_CONSTS_STAGE_EXEC 11 // for the rtc play #define SRS_CONSTS_STAGE_RTC_PLAY 12 +// for the rtc send +#define SRS_CONSTS_STAGE_RTC_SEND 13 SrsPithyPrint* SrsPithyPrint::create_rtmp_play() { @@ -173,6 +175,11 @@ SrsPithyPrint* SrsPithyPrint::create_rtc_play() return new SrsPithyPrint(SRS_CONSTS_STAGE_RTC_PLAY); } +SrsPithyPrint* SrsPithyPrint::create_rtc_send() +{ + return new SrsPithyPrint(SRS_CONSTS_STAGE_RTC_SEND); +} + SrsPithyPrint::~SrsPithyPrint() { leave_stage(); diff --git a/trunk/src/app/srs_app_pithy_print.hpp b/trunk/src/app/srs_app_pithy_print.hpp index c3b9f1219..77993b047 100644 --- a/trunk/src/app/srs_app_pithy_print.hpp +++ b/trunk/src/app/srs_app_pithy_print.hpp @@ -88,6 +88,7 @@ public: static SrsPithyPrint* create_http_stream(); static SrsPithyPrint* create_http_stream_cache(); static SrsPithyPrint* create_rtc_play(); + static SrsPithyPrint* create_rtc_send(); virtual ~SrsPithyPrint(); private: // Enter the specified stage, return the client id. diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index 386ebab65..ec4a5c501 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -1398,12 +1398,12 @@ srs_error_t SrsRtcServer::cycle() { srs_error_t err = srs_success; - // TODO: FIXME: Use pithy print. - uint32_t cnt = 1; uint64_t nn_msgs = 0; - SrsStatistic* stat = SrsStatistic::instance(); + SrsPithyPrint* pprint = SrsPithyPrint::create_rtc_send(); + SrsAutoFree(SrsPithyPrint, pprint); + // TODO: FIXME: Support reload. int max_sendmmsg = _srs_config->get_rtc_server_sendmmsg(); @@ -1439,8 +1439,8 @@ srs_error_t SrsRtcServer::cycle() // Increase total messages. nn_msgs += pos; - // TODO: FIXME: Use pithy print. - if ((cnt++ % 100) == 0) { + pprint->elapse(); + if (pprint->can_print()) { // TODO: FIXME: Support reload. max_sendmmsg = _srs_config->get_rtc_server_sendmmsg(); srs_trace("-> RTC SEND %d by sendmmsg %d, total %" PRId64 " msgs", pos, max_sendmmsg, nn_msgs);