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

Refine server stat, extract to hybrid server stat

This commit is contained in:
winlin 2021-02-10 13:07:26 +08:00
parent 152c161de3
commit e776e0eca7
4 changed files with 65 additions and 21 deletions

View file

@ -28,6 +28,8 @@
#include <vector>
#include <srs_app_hourglass.hpp>
class SrsServer;
// The hibrid server interfaces, we could register many servers.
@ -62,10 +64,11 @@ public:
};
// The hybrid server manager.
class SrsHybridServer
class SrsHybridServer : public ISrsHourGlass
{
private:
std::vector<ISrsHybridServer*> servers;
SrsHourGlass* timer_;
public:
SrsHybridServer();
virtual ~SrsHybridServer();
@ -77,6 +80,10 @@ public:
virtual void stop();
public:
virtual SrsServerAdapter* srs();
// interface ISrsHourGlass
private:
virtual srs_error_t setup_ticks();
virtual srs_error_t notify(int event, srs_utime_t interval, srs_utime_t tick);
};
extern SrsHybridServer* _srs_hybrid;