video_rtp_depacketizer.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef MODULES_RTP_RTCP_SOURCE_VIDEO_RTP_DEPACKETIZER_H_
  11. #define MODULES_RTP_RTCP_SOURCE_VIDEO_RTP_DEPACKETIZER_H_
  12. #include <stdint.h>
  13. #include "absl/types/optional.h"
  14. #include "api/array_view.h"
  15. #include "api/scoped_refptr.h"
  16. #include "api/video/encoded_image.h"
  17. #include "modules/rtp_rtcp/source/rtp_video_header.h"
  18. #include "rtc_base/copy_on_write_buffer.h"
  19. namespace webrtc {
  20. class VideoRtpDepacketizer {
  21. public:
  22. struct ParsedRtpPayload {
  23. RTPVideoHeader video_header;
  24. rtc::CopyOnWriteBuffer video_payload;
  25. };
  26. virtual ~VideoRtpDepacketizer() = default;
  27. virtual absl::optional<ParsedRtpPayload> Parse(
  28. rtc::CopyOnWriteBuffer rtp_payload) = 0;
  29. virtual rtc::scoped_refptr<EncodedImageBuffer> AssembleFrame(
  30. rtc::ArrayView<const rtc::ArrayView<const uint8_t>> rtp_payloads);
  31. };
  32. } // namespace webrtc
  33. #endif // MODULES_RTP_RTCP_SOURCE_VIDEO_RTP_DEPACKETIZER_H_