mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine code, move the kbps to protocol
This commit is contained in:
parent
cfc0877ec9
commit
68d835021e
13 changed files with 89 additions and 89 deletions
|
@ -34,6 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
|
||||
#include <srs_app_st.hpp>
|
||||
|
||||
class SrsKbps;
|
||||
class SrsRequest;
|
||||
class SrsRtmpServer;
|
||||
class SrsKbpsLimit;
|
||||
|
@ -199,4 +200,30 @@ private:
|
|||
virtual int finial(SrsBandwidthSample& play_sample, SrsBandwidthSample& publish_sample, int64_t start_time, int64_t& end_time);
|
||||
};
|
||||
|
||||
/**
|
||||
* the kbps limit, if exceed the kbps, slow down.
|
||||
*/
|
||||
class SrsKbpsLimit
|
||||
{
|
||||
private:
|
||||
int _limit_kbps;
|
||||
SrsKbps* _kbps;
|
||||
public:
|
||||
SrsKbpsLimit(SrsKbps* kbps, int limit_kbps);
|
||||
virtual ~SrsKbpsLimit();
|
||||
public:
|
||||
/**
|
||||
* get the system limit kbps.
|
||||
*/
|
||||
virtual int limit_kbps();
|
||||
/**
|
||||
* limit the recv bandwidth.
|
||||
*/
|
||||
virtual void recv_limit();
|
||||
/**
|
||||
* limit the send bandwidth.
|
||||
*/
|
||||
virtual void send_limit();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue