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

Add alone pithy print

This commit is contained in:
winlin 2021-04-27 17:05:26 +08:00
parent e67207f4b1
commit c2229d392a
2 changed files with 38 additions and 0 deletions

View file

@ -165,6 +165,30 @@ bool SrsErrorPithyPrint::can_print(int error_code, uint32_t* pnn)
return new_stage || stage->can_print();
}
SrsAlonePithyPrint::SrsAlonePithyPrint() : info_(0)
{
previous_tick_ = srs_get_system_time();
}
SrsAlonePithyPrint::~SrsAlonePithyPrint()
{
}
void SrsAlonePithyPrint::elapse()
{
srs_utime_t diff = srs_get_system_time() - previous_tick_;
previous_tick_ = srs_get_system_time();
diff = srs_max(0, diff);
info_.elapse(diff);
}
bool SrsAlonePithyPrint::can_print()
{
return info_.can_print();
}
// The global stage manager for pithy print, multiple stages.
static SrsStageManager* _srs_stages = new SrsStageManager();