Skip to content

Commit

Permalink
For #913, APP support complex error.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 1, 2018
1 parent aebbbad commit 6eae932
Show file tree
Hide file tree
Showing 47 changed files with 1,098 additions and 1,432 deletions.
199 changes: 78 additions & 121 deletions trunk/src/app/srs_app_bandwidth.cpp

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions trunk/src/app/srs_app_bandwidth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,41 +131,41 @@ class SrsBandwidth
* @param req, client request object, specifies the request info from client.
* @param local_ip, the ip of server which client connected at
*/
virtual int bandwidth_check(SrsRtmpServer* rtmp, ISrsProtocolStatistic* io_stat, SrsRequest* req, std::string local_ip);
virtual srs_error_t bandwidth_check(SrsRtmpServer* rtmp, ISrsProtocolStatistic* io_stat, SrsRequest* req, std::string local_ip);
private:
/**
* used to process band width check from client.
* @param limit, the bandwidth limit object, to slowdown if exceed the kbps.
*/
virtual int do_bandwidth_check(SrsKbpsLimit* limit);
virtual srs_error_t do_bandwidth_check(SrsKbpsLimit* limit);
// play check/test, downloading bandwidth kbps.
private:
/**
* start play/download bandwidth check/test,
* send start-play command to client, client must response starting-play
* to start the test.
*/
virtual int play_start(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
virtual srs_error_t play_start(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
/**
* do play/download bandwidth check/test,
* server send call messages to client in specified time,
* calc the time and bytes sent, then we got the kbps.
*/
virtual int play_checking(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
virtual srs_error_t play_checking(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
/**
* stop play/download bandwidth check/test,
* send stop-play command to client, client must response stopped-play
* to stop the test.
*/
virtual int play_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
virtual srs_error_t play_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
// publish check/test, publishing bandwidth kbps.
private:
/**
* start publish/upload bandwidth check/test,
* send start-publish command to client, client must response starting-publish
* to start the test.
*/
virtual int publish_start(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
virtual srs_error_t publish_start(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
/**
* do publish/upload bandwidth check/test,
* client send call messages to client in specified time,
Expand All @@ -176,15 +176,15 @@ class SrsBandwidth
* the send queue is fullfill with call messages, so we should never expect the
* response message in the publish-stop stage.
*/
virtual int publish_checking(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
virtual srs_error_t publish_checking(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
/**
* stop publish/upload bandwidth check/test,
* send stop-publish command to client,
* for linux client, always expect a stopped-publish response from client,
* for flash client, the sent queue is fullfill with publishing call messages,
* so server never expect the stopped-publish from it.
*/
virtual int publish_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
virtual srs_error_t publish_stop(SrsBandwidthSample* sample, SrsKbpsLimit* limit);
private:
/**
* report and final packet
Expand All @@ -193,7 +193,7 @@ class SrsBandwidth
* for flash client, the sent queue is fullfill with publishing call messages,
* so server never expect the final packet from it.
*/
virtual int finial(SrsBandwidthSample& play_sample, SrsBandwidthSample& publish_sample, int64_t start_time, int64_t& end_time);
virtual srs_error_t do_final(SrsBandwidthSample& play_sample, SrsBandwidthSample& publish_sample, int64_t start_time, int64_t& end_time);
};

/**
Expand Down
10 changes: 5 additions & 5 deletions trunk/src/app/srs_app_caster_flv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ class SrsDynamicHttpConn : public SrsHttpConn
public:
virtual srs_error_t on_got_http_message(ISrsHttpMessage* msg);
public:
virtual int proxy(ISrsHttpResponseWriter* w, ISrsHttpMessage* r, std::string o);
virtual srs_error_t proxy(ISrsHttpResponseWriter* w, ISrsHttpMessage* r, std::string o);
private:
virtual int do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec);
virtual srs_error_t do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec);
};

/**
Expand All @@ -110,7 +110,7 @@ class SrsHttpFileReader : public SrsFileReader
/**
* open file reader, can open then close then open...
*/
virtual int open(std::string file);
virtual srs_error_t open(std::string file);
virtual void close();
public:
// TODO: FIXME: extract interface.
Expand All @@ -120,8 +120,8 @@ class SrsHttpFileReader : public SrsFileReader
virtual int64_t seek2(int64_t offset);
virtual int64_t filesize();
public:
virtual int read(void* buf, size_t count, ssize_t* pnread);
virtual int lseek(off_t offset, int whence, off_t* seeked);
virtual srs_error_t read(void* buf, size_t count, ssize_t* pnread);
virtual srs_error_t lseek(off_t offset, int whence, off_t* seeked);
};

#endif
Expand Down
Loading

0 comments on commit 6eae932

Please sign in to comment.