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
|
@ -38,7 +38,8 @@ using namespace std;
|
|||
SrsHttpClient::SrsHttpClient()
|
||||
{
|
||||
transport = NULL;
|
||||
kbps = new SrsKbps(new SrsWallClock());
|
||||
clk = new SrsWallClock();
|
||||
kbps = new SrsKbps(clk);
|
||||
parser = NULL;
|
||||
timeout = SRS_CONSTS_NO_TMMS;
|
||||
port = 0;
|
||||
|
@ -49,6 +50,7 @@ SrsHttpClient::~SrsHttpClient()
|
|||
disconnect();
|
||||
|
||||
srs_freep(kbps);
|
||||
srs_freep(clk);
|
||||
srs_freep(parser);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ class SrsHttpParser;
|
|||
class ISrsHttpMessage;
|
||||
class SrsStSocket;
|
||||
class SrsKbps;
|
||||
class SrsWallClock;
|
||||
class SrsTcpClient;
|
||||
|
||||
// the default timeout for http client.
|
||||
|
@ -60,6 +61,7 @@ private:
|
|||
SrsHttpParser* parser;
|
||||
std::map<std::string, std::string> headers;
|
||||
SrsKbps* kbps;
|
||||
SrsWallClock* clk;
|
||||
private:
|
||||
// The timeout in ms.
|
||||
int64_t timeout;
|
||||
|
|
|
@ -35,7 +35,8 @@ using namespace std;
|
|||
|
||||
SrsBasicRtmpClient::SrsBasicRtmpClient(string u, int64_t ctm, int64_t stm)
|
||||
{
|
||||
kbps = new SrsKbps(new SrsWallClock());
|
||||
clk = new SrsWallClock();
|
||||
kbps = new SrsKbps(clk);
|
||||
|
||||
url = u;
|
||||
connect_timeout = ctm;
|
||||
|
@ -55,6 +56,7 @@ SrsBasicRtmpClient::~SrsBasicRtmpClient()
|
|||
{
|
||||
close();
|
||||
srs_freep(kbps);
|
||||
srs_freep(clk);
|
||||
}
|
||||
|
||||
srs_error_t SrsBasicRtmpClient::connect()
|
||||
|
|
|
@ -35,6 +35,7 @@ class SrsCommonMessage;
|
|||
class SrsSharedPtrMessage;
|
||||
class SrsPacket;
|
||||
class SrsKbps;
|
||||
class SrsWallClock;
|
||||
|
||||
/**
|
||||
* The simple RTMP client, provides friendly APIs.
|
||||
|
@ -57,6 +58,7 @@ private:
|
|||
SrsTcpClient* transport;
|
||||
SrsRtmpClient* client;
|
||||
SrsKbps* kbps;
|
||||
SrsWallClock* clk;
|
||||
int stream_id;
|
||||
public:
|
||||
// Constructor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue