cc_loss_stat.h 802 B

12345678910111213141516171819202122232425262728
  1. #ifndef __cc_loss_stat_h_
  2. #define __cc_loss_stat_h_
  3. #include <stdint.h>
  4. #include "../common/cf_platform.h"
  5. #include "../common/cf_unwrapper.h"
  6. /*接收端统计丢包,没有采用webRTC中比较复杂的方式,而是采用了一种简单近似的方式来实现*/
  7. typedef struct
  8. {
  9. int64_t stat_ts;
  10. int64_t prev_max_id; /*上一次统计的最大序号*/
  11. int64_t max_id; /*接收到最大序号*/
  12. int count; /*本次接收到报文个数*/
  13. cf_unwrapper_t wrapper; /*id转换器*/
  14. }cc_loss_statistics_t;
  15. void loss_statistics_init(cc_loss_statistics_t* loss_stat);
  16. void loss_statistics_destroy(cc_loss_statistics_t* loss_stat);
  17. int loss_statistics_calculate(cc_loss_statistics_t* loss_stat, int64_t now_ts, uint8_t* fraction_loss, int* num);
  18. void loss_statistics_incoming(cc_loss_statistics_t* loss_stat, uint16_t seq);
  19. #endif