mediahandlerrootelement.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * Copyright (c) 2020 Filip Klembara (in2core)
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #if RTC_ENABLE_MEDIA
  19. #include "mediahandlerrootelement.hpp"
  20. namespace rtc {
  21. message_ptr MediaHandlerRootElement::reduce(ChainedMessagesProduct messages) {
  22. if (messages && !messages->empty()) {
  23. auto msg_ptr = messages->front();
  24. if (msg_ptr) {
  25. return make_message(*msg_ptr);
  26. } else {
  27. return nullptr;
  28. }
  29. } else {
  30. return nullptr;
  31. }
  32. }
  33. ChainedMessagesProduct MediaHandlerRootElement::split(message_ptr message) {
  34. return make_chained_messages_product(message);
  35. }
  36. } // namespace rtc
  37. #endif /* RTC_ENABLE_MEDIA */