Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

5 месяцев назад
123456789101112131415161718192021222324252627282930
  1. #ifndef ZLMEDIAKIT_SRT_NACK_CONTEXT_H
  2. #define ZLMEDIAKIT_SRT_NACK_CONTEXT_H
  3. #include "Common.hpp"
  4. #include "PacketQueue.hpp"
  5. #include <list>
  6. namespace SRT {
  7. class NackContext {
  8. public:
  9. NackContext() = default;
  10. ~NackContext() = default;
  11. void update(TimePoint now, std::list<PacketQueue::LostPair> &lostlist);
  12. void getLostList(TimePoint now, uint32_t rtt, uint32_t rtt_variance, std::list<PacketQueue::LostPair> &lostlist);
  13. void drop(uint32_t seq);
  14. private:
  15. void mergeItem(TimePoint now, PacketQueue::LostPair &item);
  16. private:
  17. class NackItem {
  18. public:
  19. bool _is_nack = false;
  20. TimePoint _ts; // send nak time
  21. };
  22. std::map<uint32_t, NackItem> _nack_map;
  23. };
  24. } // namespace SRT
  25. #endif // ZLMEDIAKIT_SRT_NACK_CONTEXT_H