h264rtpdepacketizer.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_H264_RTP_DEPACKETIZER_H
  10. #define RTC_H264_RTP_DEPACKETIZER_H
  11. #if RTC_ENABLE_MEDIA
  12. #include "common.hpp"
  13. #include "mediahandler.hpp"
  14. #include "message.hpp"
  15. #include "rtp.hpp"
  16. #include <iterator>
  17. namespace rtc {
  18. /// RTP depacketization for H264
  19. class RTC_CPP_EXPORT H264RtpDepacketizer : public MediaHandler {
  20. public:
  21. H264RtpDepacketizer() = default;
  22. virtual ~H264RtpDepacketizer() = default;
  23. void incoming(message_vector &messages, const message_callback &send) override;
  24. private:
  25. std::vector<message_ptr> mRtpBuffer;
  26. message_vector buildFrames(message_vector::iterator firstPkt, message_vector::iterator lastPkt,
  27. uint32_t timestamp);
  28. };
  29. } // namespace rtc
  30. #endif // RTC_ENABLE_MEDIA
  31. #endif /* RTC_H264_RTP_DEPACKETIZER_H */