mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine kbps, stub wall clock
This commit is contained in:
parent
4c40370986
commit
c26b475bae
15 changed files with 70 additions and 27 deletions
|
@ -163,7 +163,8 @@ srs_error_t SrsBandwidth::bandwidth_check(SrsRtmpServer* rtmp, ISrsProtocolStati
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a limit object.
|
// create a limit object.
|
||||||
SrsKbps kbps;
|
SrsWallClock clk;
|
||||||
|
SrsKbps kbps(&clk);
|
||||||
kbps.set_io(io_stat, io_stat);
|
kbps.set_io(io_stat, io_stat);
|
||||||
|
|
||||||
int limit_kbps = _srs_config->get_bw_check_limit_kbps(_req->vhost);
|
int limit_kbps = _srs_config->get_bw_check_limit_kbps(_req->vhost);
|
||||||
|
|
|
@ -39,7 +39,8 @@ SrsConnection::SrsConnection(IConnectionManager* cm, srs_netfd_t c, string cip)
|
||||||
create_time = srs_get_system_time_ms();
|
create_time = srs_get_system_time_ms();
|
||||||
|
|
||||||
skt = new SrsStSocket();
|
skt = new SrsStSocket();
|
||||||
kbps = new SrsKbps(new SrsWallClock());
|
clk = new SrsWallClock();
|
||||||
|
kbps = new SrsKbps(clk);
|
||||||
kbps->set_io(skt, skt);
|
kbps->set_io(skt, skt);
|
||||||
|
|
||||||
trd = new SrsSTCoroutine("conn", this);
|
trd = new SrsSTCoroutine("conn", this);
|
||||||
|
@ -50,6 +51,7 @@ SrsConnection::~SrsConnection()
|
||||||
dispose();
|
dispose();
|
||||||
|
|
||||||
srs_freep(kbps);
|
srs_freep(kbps);
|
||||||
|
srs_freep(clk);
|
||||||
srs_freep(skt);
|
srs_freep(skt);
|
||||||
srs_freep(trd);
|
srs_freep(trd);
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@
|
||||||
#include <srs_app_reload.hpp>
|
#include <srs_app_reload.hpp>
|
||||||
#include <srs_service_conn.hpp>
|
#include <srs_service_conn.hpp>
|
||||||
|
|
||||||
|
class SrsWallClock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the basic connection of SRS,
|
* the basic connection of SRS,
|
||||||
* all connections accept from listener must extends from this base class,
|
* all connections accept from listener must extends from this base class,
|
||||||
|
@ -71,6 +73,7 @@ protected:
|
||||||
* the SrsStatistic will use it indirectly to statistic the bytes delta of current connection.
|
* the SrsStatistic will use it indirectly to statistic the bytes delta of current connection.
|
||||||
*/
|
*/
|
||||||
SrsKbps* kbps;
|
SrsKbps* kbps;
|
||||||
|
SrsWallClock* clk;
|
||||||
/**
|
/**
|
||||||
* the create time in milliseconds.
|
* the create time in milliseconds.
|
||||||
* for current connection to log self create time and calculate the living time.
|
* for current connection to log self create time and calculate the living time.
|
||||||
|
|
|
@ -110,8 +110,7 @@ SrsClientInfo::~SrsClientInfo()
|
||||||
srs_freep(res);
|
srs_freep(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsRtmpConn::SrsRtmpConn(SrsServer* svr, srs_netfd_t c, string cip)
|
SrsRtmpConn::SrsRtmpConn(SrsServer* svr, srs_netfd_t c, string cip) : SrsConnection(svr, c, cip)
|
||||||
: SrsConnection(svr, c, cip)
|
|
||||||
{
|
{
|
||||||
server = svr;
|
server = svr;
|
||||||
|
|
||||||
|
@ -120,8 +119,6 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, srs_netfd_t c, string cip)
|
||||||
bandwidth = new SrsBandwidth();
|
bandwidth = new SrsBandwidth();
|
||||||
security = new SrsSecurity();
|
security = new SrsSecurity();
|
||||||
duration = 0;
|
duration = 0;
|
||||||
kbps = new SrsKbps(new SrsWallClock());
|
|
||||||
kbps->set_io(skt, skt);
|
|
||||||
wakable = NULL;
|
wakable = NULL;
|
||||||
|
|
||||||
mw_sleep = SRS_PERF_MW_SLEEP;
|
mw_sleep = SRS_PERF_MW_SLEEP;
|
||||||
|
@ -143,7 +140,6 @@ SrsRtmpConn::~SrsRtmpConn()
|
||||||
srs_freep(refer);
|
srs_freep(refer);
|
||||||
srs_freep(bandwidth);
|
srs_freep(bandwidth);
|
||||||
srs_freep(security);
|
srs_freep(security);
|
||||||
srs_freep(kbps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsRtmpConn::dispose()
|
void SrsRtmpConn::dispose()
|
||||||
|
|
|
@ -109,7 +109,6 @@ private:
|
||||||
// for live play duration, for instance, rtmpdump to record.
|
// for live play duration, for instance, rtmpdump to record.
|
||||||
// @see https://github.com/ossrs/srs/issues/47
|
// @see https://github.com/ossrs/srs/issues/47
|
||||||
int64_t duration;
|
int64_t duration;
|
||||||
SrsKbps* kbps;
|
|
||||||
// the MR(merged-write) sleep time in ms.
|
// the MR(merged-write) sleep time in ms.
|
||||||
int mw_sleep;
|
int mw_sleep;
|
||||||
// the MR(merged-write) only enabled for play.
|
// the MR(merged-write) only enabled for play.
|
||||||
|
|
|
@ -49,7 +49,8 @@ SrsStatisticVhost::SrsStatisticVhost()
|
||||||
{
|
{
|
||||||
id = srs_generate_id();
|
id = srs_generate_id();
|
||||||
|
|
||||||
kbps = new SrsKbps(new SrsWallClock());
|
clk = new SrsWallClock();
|
||||||
|
kbps = new SrsKbps(clk);
|
||||||
kbps->set_io(NULL, NULL);
|
kbps->set_io(NULL, NULL);
|
||||||
|
|
||||||
nb_clients = 0;
|
nb_clients = 0;
|
||||||
|
@ -59,6 +60,7 @@ SrsStatisticVhost::SrsStatisticVhost()
|
||||||
SrsStatisticVhost::~SrsStatisticVhost()
|
SrsStatisticVhost::~SrsStatisticVhost()
|
||||||
{
|
{
|
||||||
srs_freep(kbps);
|
srs_freep(kbps);
|
||||||
|
srs_freep(clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsStatisticVhost::dumps(SrsJsonObject* obj)
|
srs_error_t SrsStatisticVhost::dumps(SrsJsonObject* obj)
|
||||||
|
@ -114,7 +116,8 @@ SrsStatisticStream::SrsStatisticStream()
|
||||||
width = 0;
|
width = 0;
|
||||||
height = 0;
|
height = 0;
|
||||||
|
|
||||||
kbps = new SrsKbps(new SrsWallClock());
|
clk = new SrsWallClock();
|
||||||
|
kbps = new SrsKbps(clk);
|
||||||
kbps->set_io(NULL, NULL);
|
kbps->set_io(NULL, NULL);
|
||||||
|
|
||||||
nb_clients = 0;
|
nb_clients = 0;
|
||||||
|
@ -124,6 +127,7 @@ SrsStatisticStream::SrsStatisticStream()
|
||||||
SrsStatisticStream::~SrsStatisticStream()
|
SrsStatisticStream::~SrsStatisticStream()
|
||||||
{
|
{
|
||||||
srs_freep(kbps);
|
srs_freep(kbps);
|
||||||
|
srs_freep(clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsStatisticStream::dumps(SrsJsonObject* obj)
|
srs_error_t SrsStatisticStream::dumps(SrsJsonObject* obj)
|
||||||
|
@ -236,13 +240,15 @@ SrsStatistic::SrsStatistic()
|
||||||
{
|
{
|
||||||
_server_id = srs_generate_id();
|
_server_id = srs_generate_id();
|
||||||
|
|
||||||
kbps = new SrsKbps(new SrsWallClock());
|
clk = new SrsWallClock();
|
||||||
|
kbps = new SrsKbps(clk);
|
||||||
kbps->set_io(NULL, NULL);
|
kbps->set_io(NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsStatistic::~SrsStatistic()
|
SrsStatistic::~SrsStatistic()
|
||||||
{
|
{
|
||||||
srs_freep(kbps);
|
srs_freep(kbps);
|
||||||
|
srs_freep(clk);
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
std::map<int64_t, SrsStatisticVhost*>::iterator it;
|
std::map<int64_t, SrsStatisticVhost*>::iterator it;
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <srs_rtmp_stack.hpp>
|
#include <srs_rtmp_stack.hpp>
|
||||||
|
|
||||||
class SrsKbps;
|
class SrsKbps;
|
||||||
|
class SrsWallClock;
|
||||||
class SrsRequest;
|
class SrsRequest;
|
||||||
class SrsConnection;
|
class SrsConnection;
|
||||||
class SrsJsonObject;
|
class SrsJsonObject;
|
||||||
|
@ -51,6 +52,7 @@ public:
|
||||||
* vhost total kbps.
|
* vhost total kbps.
|
||||||
*/
|
*/
|
||||||
SrsKbps* kbps;
|
SrsKbps* kbps;
|
||||||
|
SrsWallClock* clk;
|
||||||
public:
|
public:
|
||||||
SrsStatisticVhost();
|
SrsStatisticVhost();
|
||||||
virtual ~SrsStatisticVhost();
|
virtual ~SrsStatisticVhost();
|
||||||
|
@ -75,6 +77,7 @@ public:
|
||||||
* stream total kbps.
|
* stream total kbps.
|
||||||
*/
|
*/
|
||||||
SrsKbps* kbps;
|
SrsKbps* kbps;
|
||||||
|
SrsWallClock* clk;
|
||||||
public:
|
public:
|
||||||
bool has_video;
|
bool has_video;
|
||||||
SrsVideoCodecId vcodec;
|
SrsVideoCodecId vcodec;
|
||||||
|
@ -152,6 +155,7 @@ private:
|
||||||
std::map<int, SrsStatisticClient*> clients;
|
std::map<int, SrsStatisticClient*> clients;
|
||||||
// server total kbps.
|
// server total kbps.
|
||||||
SrsKbps* kbps;
|
SrsKbps* kbps;
|
||||||
|
SrsWallClock* clk;
|
||||||
private:
|
private:
|
||||||
SrsStatistic();
|
SrsStatistic();
|
||||||
virtual ~SrsStatistic();
|
virtual ~SrsStatistic();
|
||||||
|
|
|
@ -31,8 +31,9 @@ SrsKbpsSample::SrsKbpsSample()
|
||||||
kbps = 0;
|
kbps = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsKbpsSlice::SrsKbpsSlice()
|
SrsKbpsSlice::SrsKbpsSlice(SrsWallClock* c)
|
||||||
{
|
{
|
||||||
|
clk = c;
|
||||||
io.in = NULL;
|
io.in = NULL;
|
||||||
io.out = NULL;
|
io.out = NULL;
|
||||||
last_bytes = io_bytes_base = starttime = bytes = delta_bytes = 0;
|
last_bytes = io_bytes_base = starttime = bytes = delta_bytes = 0;
|
||||||
|
@ -49,7 +50,7 @@ int64_t SrsKbpsSlice::get_total_bytes()
|
||||||
|
|
||||||
void SrsKbpsSlice::sample()
|
void SrsKbpsSlice::sample()
|
||||||
{
|
{
|
||||||
int64_t now = clock->time_ms();
|
int64_t now = clk->time_ms();
|
||||||
int64_t total_bytes = get_total_bytes();
|
int64_t total_bytes = get_total_bytes();
|
||||||
|
|
||||||
if (sample_30s.time <= 0) {
|
if (sample_30s.time <= 0) {
|
||||||
|
@ -116,14 +117,13 @@ int64_t SrsWallClock::time_ms()
|
||||||
return srs_get_system_time_ms();
|
return srs_get_system_time_ms();
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsKbps::SrsKbps(SrsWallClock* c)
|
SrsKbps::SrsKbps(SrsWallClock* c) : is(c), os(c)
|
||||||
{
|
{
|
||||||
clock = c;
|
clk = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsKbps::~SrsKbps()
|
SrsKbps::~SrsKbps()
|
||||||
{
|
{
|
||||||
srs_freep(clock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsKbps::set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out)
|
void SrsKbps::set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out)
|
||||||
|
@ -131,7 +131,7 @@ void SrsKbps::set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out)
|
||||||
// set input stream
|
// set input stream
|
||||||
// now, set start time.
|
// now, set start time.
|
||||||
if (is.starttime == 0) {
|
if (is.starttime == 0) {
|
||||||
is.starttime = clock->time_ms();
|
is.starttime = clk->time_ms();
|
||||||
}
|
}
|
||||||
// save the old in bytes.
|
// save the old in bytes.
|
||||||
if (is.io.in) {
|
if (is.io.in) {
|
||||||
|
@ -149,7 +149,7 @@ void SrsKbps::set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out)
|
||||||
// set output stream
|
// set output stream
|
||||||
// now, set start time.
|
// now, set start time.
|
||||||
if (os.starttime == 0) {
|
if (os.starttime == 0) {
|
||||||
os.starttime = clock->time_ms();
|
os.starttime = clk->time_ms();
|
||||||
}
|
}
|
||||||
// save the old in bytes.
|
// save the old in bytes.
|
||||||
if (os.io.out) {
|
if (os.io.out) {
|
||||||
|
@ -167,7 +167,7 @@ void SrsKbps::set_io(ISrsProtocolStatistic* in, ISrsProtocolStatistic* out)
|
||||||
|
|
||||||
int SrsKbps::get_send_kbps()
|
int SrsKbps::get_send_kbps()
|
||||||
{
|
{
|
||||||
int64_t duration = clock->time_ms() - is.starttime;
|
int64_t duration = clk->time_ms() - is.starttime;
|
||||||
if (duration <= 0) {
|
if (duration <= 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ int SrsKbps::get_send_kbps()
|
||||||
|
|
||||||
int SrsKbps::get_recv_kbps()
|
int SrsKbps::get_recv_kbps()
|
||||||
{
|
{
|
||||||
int64_t duration = clock->time_ms() - os.starttime;
|
int64_t duration = clk->time_ms() - os.starttime;
|
||||||
if (duration <= 0) {
|
if (duration <= 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include <srs_protocol_io.hpp>
|
#include <srs_protocol_io.hpp>
|
||||||
|
|
||||||
|
class SrsWallClock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a kbps sample, for example, 1minute kbps,
|
* a kbps sample, for example, 1minute kbps,
|
||||||
* 10minute kbps sample.
|
* 10minute kbps sample.
|
||||||
|
@ -64,6 +66,7 @@ private:
|
||||||
ISrsProtocolStatistic* in;
|
ISrsProtocolStatistic* in;
|
||||||
ISrsProtocolStatistic* out;
|
ISrsProtocolStatistic* out;
|
||||||
};
|
};
|
||||||
|
SrsWallClock* clk;
|
||||||
public:
|
public:
|
||||||
// the slice io used for SrsKbps to invoke,
|
// the slice io used for SrsKbps to invoke,
|
||||||
// the SrsKbpsSlice itself never use it.
|
// the SrsKbpsSlice itself never use it.
|
||||||
|
@ -88,7 +91,7 @@ public:
|
||||||
// for the delta bytes.
|
// for the delta bytes.
|
||||||
int64_t delta_bytes;
|
int64_t delta_bytes;
|
||||||
public:
|
public:
|
||||||
SrsKbpsSlice();
|
SrsKbpsSlice(SrsWallClock* clk);
|
||||||
virtual ~SrsKbpsSlice();
|
virtual ~SrsKbpsSlice();
|
||||||
public:
|
public:
|
||||||
// Get current total bytes, not depend on sample().
|
// Get current total bytes, not depend on sample().
|
||||||
|
@ -182,7 +185,7 @@ class SrsKbps : virtual public ISrsProtocolStatistic, virtual public IKbpsDelta
|
||||||
private:
|
private:
|
||||||
SrsKbpsSlice is;
|
SrsKbpsSlice is;
|
||||||
SrsKbpsSlice os;
|
SrsKbpsSlice os;
|
||||||
SrsWallClock* clock;
|
SrsWallClock* clk;
|
||||||
public:
|
public:
|
||||||
// We will free the clock c.
|
// We will free the clock c.
|
||||||
SrsKbps(SrsWallClock* c);
|
SrsKbps(SrsWallClock* c);
|
||||||
|
|
|
@ -38,7 +38,8 @@ using namespace std;
|
||||||
SrsHttpClient::SrsHttpClient()
|
SrsHttpClient::SrsHttpClient()
|
||||||
{
|
{
|
||||||
transport = NULL;
|
transport = NULL;
|
||||||
kbps = new SrsKbps(new SrsWallClock());
|
clk = new SrsWallClock();
|
||||||
|
kbps = new SrsKbps(clk);
|
||||||
parser = NULL;
|
parser = NULL;
|
||||||
timeout = SRS_CONSTS_NO_TMMS;
|
timeout = SRS_CONSTS_NO_TMMS;
|
||||||
port = 0;
|
port = 0;
|
||||||
|
@ -49,6 +50,7 @@ SrsHttpClient::~SrsHttpClient()
|
||||||
disconnect();
|
disconnect();
|
||||||
|
|
||||||
srs_freep(kbps);
|
srs_freep(kbps);
|
||||||
|
srs_freep(clk);
|
||||||
srs_freep(parser);
|
srs_freep(parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ class SrsHttpParser;
|
||||||
class ISrsHttpMessage;
|
class ISrsHttpMessage;
|
||||||
class SrsStSocket;
|
class SrsStSocket;
|
||||||
class SrsKbps;
|
class SrsKbps;
|
||||||
|
class SrsWallClock;
|
||||||
class SrsTcpClient;
|
class SrsTcpClient;
|
||||||
|
|
||||||
// the default timeout for http client.
|
// the default timeout for http client.
|
||||||
|
@ -60,6 +61,7 @@ private:
|
||||||
SrsHttpParser* parser;
|
SrsHttpParser* parser;
|
||||||
std::map<std::string, std::string> headers;
|
std::map<std::string, std::string> headers;
|
||||||
SrsKbps* kbps;
|
SrsKbps* kbps;
|
||||||
|
SrsWallClock* clk;
|
||||||
private:
|
private:
|
||||||
// The timeout in ms.
|
// The timeout in ms.
|
||||||
int64_t timeout;
|
int64_t timeout;
|
||||||
|
|
|
@ -35,7 +35,8 @@ using namespace std;
|
||||||
|
|
||||||
SrsBasicRtmpClient::SrsBasicRtmpClient(string u, int64_t ctm, int64_t stm)
|
SrsBasicRtmpClient::SrsBasicRtmpClient(string u, int64_t ctm, int64_t stm)
|
||||||
{
|
{
|
||||||
kbps = new SrsKbps(new SrsWallClock());
|
clk = new SrsWallClock();
|
||||||
|
kbps = new SrsKbps(clk);
|
||||||
|
|
||||||
url = u;
|
url = u;
|
||||||
connect_timeout = ctm;
|
connect_timeout = ctm;
|
||||||
|
@ -55,6 +56,7 @@ SrsBasicRtmpClient::~SrsBasicRtmpClient()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
srs_freep(kbps);
|
srs_freep(kbps);
|
||||||
|
srs_freep(clk);
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsBasicRtmpClient::connect()
|
srs_error_t SrsBasicRtmpClient::connect()
|
||||||
|
|
|
@ -35,6 +35,7 @@ class SrsCommonMessage;
|
||||||
class SrsSharedPtrMessage;
|
class SrsSharedPtrMessage;
|
||||||
class SrsPacket;
|
class SrsPacket;
|
||||||
class SrsKbps;
|
class SrsKbps;
|
||||||
|
class SrsWallClock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The simple RTMP client, provides friendly APIs.
|
* The simple RTMP client, provides friendly APIs.
|
||||||
|
@ -57,6 +58,7 @@ private:
|
||||||
SrsTcpClient* transport;
|
SrsTcpClient* transport;
|
||||||
SrsRtmpClient* client;
|
SrsRtmpClient* client;
|
||||||
SrsKbps* kbps;
|
SrsKbps* kbps;
|
||||||
|
SrsWallClock* clk;
|
||||||
int stream_id;
|
int stream_id;
|
||||||
public:
|
public:
|
||||||
// Constructor.
|
// Constructor.
|
||||||
|
|
|
@ -5685,8 +5685,28 @@ VOID TEST(ProtocolHTTPTest, ParseHTTPMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID TEST(ProtocolKbpsTest, ParseHTTPMessage)
|
VOID TEST(ProtocolKbpsTest, Connections)
|
||||||
{
|
{
|
||||||
|
if (true) {
|
||||||
|
MockWallClock* clock = new MockWallClock();
|
||||||
|
SrsAutoFree(MockWallClock, clock);
|
||||||
|
MockStatistic* io = new MockStatistic();
|
||||||
|
SrsAutoFree(MockStatistic, io);
|
||||||
|
|
||||||
|
SrsKbps* kbps = new SrsKbps(clock->set_clock(0));
|
||||||
|
SrsAutoFree(SrsKbps, kbps);
|
||||||
|
kbps->set_io(io, io);
|
||||||
|
|
||||||
|
kbps->sample();
|
||||||
|
|
||||||
|
EXPECT_EQ(0, kbps->get_recv_kbps());
|
||||||
|
EXPECT_EQ(0, kbps->get_recv_kbps_30s());
|
||||||
|
EXPECT_EQ(0, kbps->get_recv_kbps_5m());
|
||||||
|
|
||||||
|
EXPECT_EQ(0, kbps->get_send_kbps());
|
||||||
|
EXPECT_EQ(0, kbps->get_send_kbps_30s());
|
||||||
|
EXPECT_EQ(0, kbps->get_send_kbps_5m());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,6 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <srs_rtmp_stack.hpp>
|
#include <srs_rtmp_stack.hpp>
|
||||||
#include <srs_rtmp_handshake.hpp>
|
#include <srs_rtmp_handshake.hpp>
|
||||||
#include <srs_protocol_stream.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
|
#include <srs_protocol_kbps.hpp>
|
||||||
|
|
||||||
using namespace _srs_internal;
|
using namespace _srs_internal;
|
||||||
|
|
||||||
|
@ -127,13 +128,13 @@ public:
|
||||||
MockStatistic* add_out(int64_t v);
|
MockStatistic* add_out(int64_t v);
|
||||||
};
|
};
|
||||||
|
|
||||||
class MockWallClock
|
class MockWallClock : public SrsWallClock
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
int64_t clock;
|
int64_t clock;
|
||||||
public:
|
public:
|
||||||
MockWallClock();
|
MockWallClock();
|
||||||
virtual MockWallClock();
|
virtual ~MockWallClock();
|
||||||
public:
|
public:
|
||||||
virtual int64_t time_ms();
|
virtual int64_t time_ms();
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue