rtcpreceivingsession.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Copyright (c) 2020 Staz Modrzynski
  3. * Copyright (c) 2020 Paul-Louis Ageneau
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  8. */
  9. #ifndef RTC_RTCP_RECEIVING_SESSION_H
  10. #define RTC_RTCP_RECEIVING_SESSION_H
  11. #if RTC_ENABLE_MEDIA
  12. #include "common.hpp"
  13. #include "mediahandler.hpp"
  14. #include "message.hpp"
  15. #include "rtp.hpp"
  16. namespace rtc {
  17. // An RtcpSession can be plugged into a Track to handle the whole RTCP session
  18. class RTC_CPP_EXPORT RtcpReceivingSession : public MediaHandler {
  19. public:
  20. message_ptr incoming(message_ptr ptr) override;
  21. message_ptr outgoing(message_ptr ptr) override;
  22. bool send(message_ptr ptr);
  23. void requestBitrate(unsigned int newBitrate);
  24. bool requestKeyframe() override;
  25. protected:
  26. void pushREMB(unsigned int bitrate);
  27. void pushRR(unsigned int lastSR_delay);
  28. void pushPLI();
  29. unsigned int mRequestedBitrate = 0;
  30. SSRC mSsrc = 0;
  31. uint32_t mGreatestSeqNo = 0;
  32. uint64_t mSyncRTPTS, mSyncNTPTS;
  33. };
  34. } // namespace rtc
  35. #endif // RTC_ENABLE_MEDIA
  36. #endif // RTC_RTCP_RECEIVING_SESSION_H