xref: /aosp_15_r20/external/webrtc/modules/rtp_rtcp/source/rtp_generic_frame_descriptor_extension.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2018 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_RTP_GENERIC_FRAME_DESCRIPTOR_EXTENSION_H_
11 #define MODULES_RTP_RTCP_SOURCE_RTP_GENERIC_FRAME_DESCRIPTOR_EXTENSION_H_
12 
13 #include <stddef.h>
14 #include <stdint.h>
15 
16 #include "absl/strings/string_view.h"
17 #include "api/array_view.h"
18 #include "api/rtp_parameters.h"
19 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
20 #include "modules/rtp_rtcp/source/rtp_generic_frame_descriptor.h"
21 
22 namespace webrtc {
23 
24 class RtpGenericFrameDescriptorExtension00 {
25  public:
26   using value_type = RtpGenericFrameDescriptor;
27   static constexpr RTPExtensionType kId = kRtpExtensionGenericFrameDescriptor00;
Uri()28   static constexpr absl::string_view Uri() {
29     return RtpExtension::kGenericFrameDescriptorUri00;
30   }
31   static constexpr int kMaxSizeBytes = 16;
32 
33   static bool Parse(rtc::ArrayView<const uint8_t> data,
34                     RtpGenericFrameDescriptor* descriptor);
35   static size_t ValueSize(const RtpGenericFrameDescriptor& descriptor);
36   static bool Write(rtc::ArrayView<uint8_t> data,
37                     const RtpGenericFrameDescriptor& descriptor);
38 };
39 
40 }  // namespace webrtc
41 
42 #endif  // MODULES_RTP_RTCP_SOURCE_RTP_GENERIC_FRAME_DESCRIPTOR_EXTENSION_H_
43