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 11 #ifndef MODULES_RTP_RTCP_SOURCE_VIDEO_RTP_DEPACKETIZER_VP9_H_ 12 #define MODULES_RTP_RTCP_SOURCE_VIDEO_RTP_DEPACKETIZER_VP9_H_ 13 14 #include <cstdint> 15 16 #include "absl/types/optional.h" 17 #include "api/array_view.h" 18 #include "modules/rtp_rtcp/source/rtp_video_header.h" 19 #include "modules/rtp_rtcp/source/video_rtp_depacketizer.h" 20 #include "rtc_base/copy_on_write_buffer.h" 21 22 namespace webrtc { 23 24 class VideoRtpDepacketizerVp9 : public VideoRtpDepacketizer { 25 public: 26 VideoRtpDepacketizerVp9() = default; 27 VideoRtpDepacketizerVp9(const VideoRtpDepacketizerVp9&) = delete; 28 VideoRtpDepacketizerVp9& operator=(VideoRtpDepacketizerVp9&) = delete; 29 ~VideoRtpDepacketizerVp9() override = default; 30 31 // Parses vp9 rtp payload descriptor. 32 // Returns zero on error or vp9 payload header offset on success. 33 static int ParseRtpPayload(rtc::ArrayView<const uint8_t> rtp_payload, 34 RTPVideoHeader* video_header); 35 36 absl::optional<ParsedRtpPayload> Parse( 37 rtc::CopyOnWriteBuffer rtp_payload) override; 38 }; 39 40 } // namespace webrtc 41 42 #endif // MODULES_RTP_RTCP_SOURCE_VIDEO_RTP_DEPACKETIZER_VP9_H_ 43