receiver_base.h 605 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef TINYPLAYER3_RECEIVER_BASE_H
  2. #define TINYPLAYER3_RECEIVER_BASE_H
  3. #include "frame_decoder/decoder_base.h"
  4. #include <boost/asio/io_context.hpp>
  5. #include <memory>
  6. enum receiver_type {
  7. RECEIVER_TCP,
  8. RECEIVER_UDP,
  9. RECEIVER_UDP_FEC
  10. };
  11. struct receiver_config {
  12. std::string server_addr;
  13. uint16_t server_port;
  14. decoder_base *decoder;
  15. };
  16. class receiver_base {
  17. public:
  18. receiver_base();
  19. virtual ~receiver_base();
  20. void run();
  21. boost::asio::io_context *get_ctx();
  22. private:
  23. struct impl;
  24. std::unique_ptr<impl> pimpl;
  25. };
  26. #endif //TINYPLAYER3_RECEIVER_BASE_H