opuspacketizationhandler.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * libdatachannel client example
  3. * Copyright (c) 2020 Filip Klembara (in2core)
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef OpusPacketizationHandler_hpp
  19. #define OpusPacketizationHandler_hpp
  20. #if RTC_ENABLE_MEDIA
  21. #include "rtcpsenderreportable.hpp"
  22. #include "opusrtppacketizer.hpp"
  23. #include "rtcp.hpp"
  24. namespace rtc {
  25. /// Handler for opus packetization
  26. class OpusPacketizationHandler: public RtcpHandler, public RTCPSenderReportable {
  27. /// RTP packetizer for opus
  28. const std::shared_ptr<OpusRTPPacketizer> packetizer;
  29. public:
  30. /// Construct handler for opus packetization.
  31. /// @param packetizer RTP packetizer for opus
  32. OpusPacketizationHandler(std::shared_ptr<OpusRTPPacketizer> packetizer);
  33. /// Returns message unchanged
  34. /// @param ptr message
  35. message_ptr incoming(message_ptr ptr) override;
  36. /// Returns packetized message if message type is binary
  37. /// @param ptr message
  38. message_ptr outgoing(message_ptr ptr) override;
  39. };
  40. } // namespace
  41. #endif /* RTC_ENABLE_MEDIA */
  42. #endif /* OpusPacketizationHandler_hpp */