2013-11-03 20:11:37 +01:00
|
|
|
|
2012-05-07 13:41:03 +02:00
|
|
|
/*
|
2013-11-03 20:11:37 +01:00
|
|
|
* Copyright (C) Roman Arutyunyan
|
2012-05-07 13:41:03 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _NGX_RTMP_BANDWIDTH_H_INCLUDED_
|
|
|
|
#define _NGX_RTMP_BANDWIDTH_H_INCLUDED_
|
|
|
|
|
|
|
|
|
2013-06-11 19:00:39 +02:00
|
|
|
#include <ngx_config.h>
|
2012-05-07 13:41:03 +02:00
|
|
|
#include <ngx_core.h>
|
|
|
|
|
|
|
|
|
|
|
|
/* Bandwidth update interval in seconds */
|
2013-12-23 17:24:40 +01:00
|
|
|
#define NGX_RTMP_BANDWIDTH_INTERVAL 10
|
2012-05-07 13:41:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
uint64_t bytes;
|
|
|
|
uint64_t bandwidth; /* bytes/sec */
|
|
|
|
|
|
|
|
time_t intl_end;
|
|
|
|
uint64_t intl_bytes;
|
|
|
|
} ngx_rtmp_bandwidth_t;
|
|
|
|
|
|
|
|
|
|
|
|
void ngx_rtmp_update_bandwidth(ngx_rtmp_bandwidth_t *bw, uint32_t bytes);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _NGX_RTMP_BANDWIDTH_H_INCLUDED_ */
|