plihandler.hpp 1021 B

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 "mediahandler.hpp"
  12. #include "utils.hpp"
  13. namespace rtc {
  14. /// Responds to PLI and FIR messages sent by the receiver. The sender should respond to these
  15. /// messages by sending an intra.
  16. class RTC_CPP_EXPORT PliHandler final : public MediaHandler {
  17. rtc::synchronized_callback<> mOnPli;
  18. public:
  19. /// Constructs the PLIResponder object to notify whenever a new intra frame is requested
  20. /// @param onPli The callback that gets called whenever an intra frame is requested by the receiver
  21. PliHandler(std::function<void(void)> onPli);
  22. void incoming(message_vector &messages, const message_callback &send) override;
  23. };
  24. }
  25. #endif // RTC_ENABLE_MEDIA
  26. #endif // RTC_PLI_RESPONDER_H