receiver_udp_fec.h 817 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef TINYPLAYER2_FRAME_RECEIVER2_H
  2. #define TINYPLAYER2_FRAME_RECEIVER2_H
  3. #include "receiver_base.hpp"
  4. #include <boost/asio/io_context.hpp>
  5. #include <memory>
  6. class receiver_udp_fec : public receiver_base {
  7. public:
  8. using io_context = boost::asio::io_context;
  9. struct create_config {
  10. std::string server_addr;
  11. uint16_t server_port;
  12. io_context *ctx = nullptr;
  13. // for parent
  14. cb_func_type cb_func = nullptr;
  15. bool enable_log = false;
  16. };
  17. using this_type = receiver_udp_fec;
  18. using pointer = std::unique_ptr<this_type>;
  19. static pointer create(const create_config &conf);
  20. ~receiver_udp_fec();
  21. private:
  22. struct impl;
  23. std::unique_ptr<impl> pimpl;
  24. explicit receiver_udp_fec(impl *pimpl);
  25. };
  26. #endif //TINYPLAYER2_FRAME_RECEIVER2_H