rtcpreceivingsession.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * Copyright (c) 2020 Staz Modrzynski
  3. * Copyright (c) 2020 Paul-Louis Ageneau
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2.1 of the License, or (at your option) any later version.
  9. *
  10. * This library 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 GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #ifndef RTC_RTCP_RECEIVING_SESSION_H
  20. #define RTC_RTCP_RECEIVING_SESSION_H
  21. #if RTC_ENABLE_MEDIA
  22. #include "common.hpp"
  23. #include "mediahandler.hpp"
  24. #include "message.hpp"
  25. #include "rtp.hpp"
  26. namespace rtc {
  27. // An RtcpSession can be plugged into a Track to handle the whole RTCP session
  28. class RTC_CPP_EXPORT RtcpReceivingSession : public MediaHandler {
  29. public:
  30. message_ptr incoming(message_ptr ptr) override;
  31. message_ptr outgoing(message_ptr ptr) override;
  32. bool send(message_ptr ptr);
  33. void requestBitrate(unsigned int newBitrate);
  34. bool requestKeyframe() override;
  35. protected:
  36. void pushREMB(unsigned int bitrate);
  37. void pushRR(unsigned int lastSR_delay);
  38. void pushPLI();
  39. unsigned int mRequestedBitrate = 0;
  40. SSRC mSsrc = 0;
  41. uint32_t mGreatestSeqNo = 0;
  42. uint64_t mSyncRTPTS, mSyncNTPTS;
  43. };
  44. } // namespace rtc
  45. #endif // RTC_ENABLE_MEDIA
  46. #endif // RTC_RTCP_RECEIVING_SESSION_H