h264rtpdepacketizer.hpp 1015 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 "message.hpp"
  14. #include "nalunit.hpp"
  15. #include "rtp.hpp"
  16. #include "rtpdepacketizer.hpp"
  17. namespace rtc {
  18. /// RTP depacketization for H264
  19. class RTC_CPP_EXPORT H264RtpDepacketizer final : public VideoRtpDepacketizer {
  20. public:
  21. using Separator = NalUnit::Separator;
  22. H264RtpDepacketizer(Separator separator = Separator::StartSequence);
  23. ~H264RtpDepacketizer();
  24. private:
  25. message_ptr reassemble(message_buffer &buffer) override;
  26. void addSeparator(binary &frame);
  27. const NalUnit::Separator mSeparator;
  28. };
  29. } // namespace rtc
  30. #endif // RTC_ENABLE_MEDIA
  31. #endif /* RTC_H264_RTP_DEPACKETIZER_H */