xref: /aosp_15_r20/external/webrtc/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2020 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_RTP_VIDEO_LAYERS_ALLOCATION_EXTENSION_H_
12 #define MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_LAYERS_ALLOCATION_EXTENSION_H_
13 
14 #include "absl/strings/string_view.h"
15 #include "api/rtp_parameters.h"
16 #include "api/video/video_layers_allocation.h"
17 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
18 
19 namespace webrtc {
20 
21 // TODO(bugs.webrtc.org/12000): Note that this extensions is being developed and
22 // the wire format will likely change.
23 class RtpVideoLayersAllocationExtension {
24  public:
25   using value_type = VideoLayersAllocation;
26   static constexpr RTPExtensionType kId = kRtpExtensionVideoLayersAllocation;
Uri()27   static constexpr absl::string_view Uri() {
28     return RtpExtension::kVideoLayersAllocationUri;
29   }
30 
31   static bool Parse(rtc::ArrayView<const uint8_t> data,
32                     VideoLayersAllocation* allocation);
33   static size_t ValueSize(const VideoLayersAllocation& allocation);
34   static bool Write(rtc::ArrayView<uint8_t> data,
35                     const VideoLayersAllocation& allocation);
36 };
37 
38 }  // namespace webrtc
39 #endif  // MODULES_RTP_RTCP_SOURCE_RTP_VIDEO_LAYERS_ALLOCATION_EXTENSION_H_
40