plihandler.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Copyright (c) 2023 Arda Cinar
  3. *
  4. * This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  7. */
  8. #ifndef RTC_PLI_RESPONDER_H
  9. #define RTC_PLI_RESPONDER_H
  10. #if RTC_ENABLE_MEDIA
  11. #include "mediahandlerelement.hpp"
  12. #include "utils.hpp"
  13. #include <functional>
  14. namespace rtc {
  15. /// Responds to PLI and FIR messages sent by the receiver. The sender should respond to these
  16. /// messages by sending an intra.
  17. class RTC_CPP_EXPORT PliHandler final : public MediaHandlerElement {
  18. std::function<void(void)> mOnPli;
  19. public:
  20. /// Constructs the PLIResponder object to notify whenever a new intra frame is requested
  21. /// @param onPli The callback that gets called whenever an intra frame is requested by the receiver
  22. PliHandler(rtc::synchronized_callback<> onPli);
  23. ChainedIncomingControlProduct processIncomingControlMessage(message_ptr) override;
  24. };
  25. }
  26. #endif // RTC_ENABLE_MEDIA
  27. #endif // RTC_PLI_RESPONDER_H