2
0

plihandler.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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 <functional>
  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 MediaHandlerElement {
  17. std::function<void(void)> onPli;
  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. ChainedIncomingControlProduct processIncomingControlMessage(message_ptr) override;
  23. };
  24. }
  25. #endif // RTC_ENABLE_MEDIA
  26. #endif // RTC_PLI_RESPONDER_H