/* * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "modules/rtp_rtcp/source/video_rtp_depacketizer_vp8.h" #include <stddef.h> #include <stdint.h> #include "absl/types/optional.h" #include "api/array_view.h" #include "modules/rtp_rtcp/source/rtp_video_header.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" // VP8 payload descriptor // https://datatracker.ietf.org/doc/html/rfc7741#section-4.2 // // 0 1 2 3 4 5 6 7 // +-+-+-+-+-+-+-+-+ // |X|R|N|S|R| PID | (REQUIRED) // +-+-+-+-+-+-+-+-+ // X: |I|L|T|K| RSV | (OPTIONAL) // +-+-+-+-+-+-+-+-+ // I: |M| PictureID | (OPTIONAL) // +-+-+-+-+-+-+-+-+ // | PictureID | // +-+-+-+-+-+-+-+-+ // L: | TL0PICIDX | (OPTIONAL) // +-+-+-+-+-+-+-+-+ // T/K: |TID|Y| KEYIDX | (OPTIONAL) // +-+-+-+-+-+-+-+-+ // // VP8 payload header. Considered part of the actual payload, sent to decoder. // https://datatracker.ietf.org/doc/html/rfc7741#section-4.3 // // 0 1 2 3 4 5 6 7 // +-+-+-+-+-+-+-+-+ // |Size0|H| VER |P| // +-+-+-+-+-+-+-+-+ // : ... : // +-+-+-+-+-+-+-+-+ namespace webrtc { namespace { constexpr int kFailedToParse = …; int ParseVP8Descriptor(RTPVideoHeaderVP8* vp8, const uint8_t* data, size_t data_length) { … } } // namespace absl::optional<VideoRtpDepacketizer::ParsedRtpPayload> VideoRtpDepacketizerVp8::Parse(rtc::CopyOnWriteBuffer rtp_payload) { … } int VideoRtpDepacketizerVp8::ParseRtpPayload( rtc::ArrayView<const uint8_t> rtp_payload, RTPVideoHeader* video_header) { … } } // namespace webrtc