Thanks to visit codestin.com
Credit goes to webrtc.googlesource.com

blob: 09eebcab053842e470b33022b9873da9f7b35888 [file] [log] [blame]
skvladdc1c62c2016-03-17 02:07:431/*
2 * Copyright 2015 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
Steve Anton10542f22019-01-11 17:11:0011#ifndef API_RTP_PARAMETERS_H_
12#define API_RTP_PARAMETERS_H_
skvladdc1c62c2016-03-17 02:07:4313
Yves Gerey988cc082018-10-23 10:03:0114#include <stdint.h>
Jonas Olssona4d87372019-07-05 17:08:3315
Johannes Kron72d69152020-02-10 13:05:5516#include <map>
Florent Castelli8037fc62024-08-29 13:00:4017#include <optional>
Taylor Brandstetter0cd086b2016-04-20 23:23:1018#include <string>
skvladdc1c62c2016-03-17 02:07:4319#include <vector>
20
Byoungchan Leea1a7c632022-07-05 12:06:2821#include "absl/container/inlined_vector.h"
Harald Alvestrandb3e94fd2024-12-19 13:19:4722#include "absl/strings/str_format.h"
Markus Handelldfeb0df2020-03-16 21:20:4723#include "absl/strings/string_view.h"
Steve Anton10542f22019-01-11 17:11:0024#include "api/media_types.h"
Harald Alvestrandfd5ae7f2020-05-16 06:37:4925#include "api/priority.h"
Tommi932f2742025-10-10 14:04:3226#include "api/rtc_error.h"
Markus Handell0357b3e2020-03-16 12:40:5127#include "api/rtp_transceiver_direction.h"
Jonas Oreland0deda152022-09-23 10:08:5728#include "api/video/resolution.h"
Byoungchan Leea1a7c632022-07-05 12:06:2829#include "api/video_codecs/scalability_mode.h"
Mirko Bonadeiac194142018-10-22 15:08:3730#include "rtc_base/system/rtc_export.h"
sakal1fd95952016-06-22 07:46:1531
skvladdc1c62c2016-03-17 02:07:4332namespace webrtc {
Tommi932f2742025-10-10 14:04:3233class StringBuilder;
skvladdc1c62c2016-03-17 02:07:4334
Philipp Hanckede172522023-12-14 08:45:3935using CodecParameterMap = std::map<std::string, std::string>;
36
deadbeefe702b302017-02-04 20:09:0137// These structures are intended to mirror those defined by:
38// http://draft.ortc.org/#rtcrtpdictionaries*
39// Contains everything specified as of 2017 Jan 24.
40//
41// They are used when retrieving or modifying the parameters of an
42// RtpSender/RtpReceiver, or retrieving capabilities.
43//
44// Note on conventions: Where ORTC may use "octet", "short" and "unsigned"
45// types, we typically use "int", in keeping with our style guidelines. The
46// parameter's actual valid range will be enforced when the parameters are set,
47// rather than when the parameters struct is built. An exception is made for
48// SSRCs, since they use the full unsigned 32-bit range, and aren't expected to
49// be used for any numeric comparisons/operations.
50//
51// Additionally, where ORTC uses strings, we may use enums for things that have
52// a fixed number of supported values. However, for things that can be extended
53// (such as codecs, by providing an external encoder factory), a string
54// identifier is used.
55
56enum class FecMechanism {
57 RED,
58 RED_AND_ULPFEC,
59 FLEXFEC,
60};
61
62// Used in RtcpFeedback struct.
63enum class RtcpFeedbackType {
deadbeefe702b302017-02-04 20:09:0164 CCM,
Elad Alonfadb1812019-05-24 11:40:0265 LNTF, // "goog-lntf"
deadbeefe702b302017-02-04 20:09:0166 NACK,
67 REMB, // "goog-remb"
68 TRANSPORT_CC,
Per Kd142f352025-08-26 18:47:5869 CCFB, // RFC8888
deadbeefe702b302017-02-04 20:09:0170};
71
Per Kd142f352025-08-26 18:47:5872template <typename Sink>
73void AbslStringify(Sink& sink, RtcpFeedbackType type) {
74 switch (type) {
75 case RtcpFeedbackType::CCM:
76 sink.Append("CCM");
77 break;
78 case RtcpFeedbackType::LNTF:
79 sink.Append("LNTF");
80 break;
81 case RtcpFeedbackType::NACK:
82 sink.Append("NACK");
83 break;
84 case RtcpFeedbackType::REMB:
85 sink.Append("REMB");
86 break;
87 case RtcpFeedbackType::TRANSPORT_CC:
88 sink.Append("TRANSPORT_CC");
89 break;
90 case RtcpFeedbackType::CCFB:
91 sink.Append("CCFB");
92 break;
93 }
94}
95
96template <typename Sink>
97void AbslStringify(Sink& sink, std::optional<RtcpFeedbackType> type) {
98 if (!type.has_value()) {
99 sink.Append("nullopt");
100 return;
101 }
102 AbslStringify(sink, *type);
103}
104
deadbeefe814a0d2017-02-26 02:15:09105// Used in RtcpFeedback struct when type is NACK or CCM.
deadbeefe702b302017-02-04 20:09:01106enum class RtcpFeedbackMessageType {
107 // Equivalent to {type: "nack", parameter: undefined} in ORTC.
108 GENERIC_NACK,
109 PLI, // Usable with NACK.
110 FIR, // Usable with CCM.
111};
112
113enum class DtxStatus {
114 DISABLED,
115 ENABLED,
116};
117
Taylor Brandstetter49fcc102018-05-16 21:20:41118// Based on the spec in
119// https://w3c.github.io/webrtc-pc/#idl-def-rtcdegradationpreference.
120// These options are enforced on a best-effort basis. For instance, all of
121// these options may suffer some frame drops in order to avoid queuing.
122// TODO(sprang): Look into possibility of more strictly enforcing the
123// maintain-framerate option.
124// TODO(deadbeef): Default to "balanced", as the spec indicates?
deadbeefe702b302017-02-04 20:09:01125enum class DegradationPreference {
Sergey Silkin95593092025-10-10 11:14:00126 // Maintain framerate and resolution regardless of video quality. Frames may
127 // be dropped before encoding if necessary not to overuse network and encoder
128 // resources.
129 MAINTAIN_FRAMERATE_AND_RESOLUTION,
130 // TODO(webrtc:450044904): Switch downstream projects to
131 // MAINTAIN_FRAMERATE_AND_RESOLUTION and remove DISABLED.
132 DISABLED = MAINTAIN_FRAMERATE_AND_RESOLUTION,
Taylor Brandstetter49fcc102018-05-16 21:20:41133 // On over-use, request lower resolution, possibly causing down-scaling.
Ã…sa Persson90bc1e12019-05-31 11:29:35134 MAINTAIN_FRAMERATE,
135 // On over-use, request lower frame rate, possibly causing frame drops.
deadbeefe702b302017-02-04 20:09:01136 MAINTAIN_RESOLUTION,
Taylor Brandstetter49fcc102018-05-16 21:20:41137 // Try to strike a "pleasing" balance between frame rate or resolution.
deadbeefe702b302017-02-04 20:09:01138 BALANCED,
139};
140
Henrik Boströmf0eef122020-05-28 14:22:42141RTC_EXPORT const char* DegradationPreferenceToString(
142 DegradationPreference degradation_preference);
143
Mirko Bonadei66e76792019-04-02 09:33:59144RTC_EXPORT extern const double kDefaultBitratePriority;
deadbeefe702b302017-02-04 20:09:01145
Tommi932f2742025-10-10 14:04:32146// Generates an FMTP line based on `parameters`. Please note that some
147// parameters are not considered to be part of the FMTP line, see the function
148// IsFmtpParam(). Returns true if the set of FMTP parameters is nonempty, false
149// otherwise.
150bool WriteFmtpParameters(const CodecParameterMap& parameters,
151 StringBuilder& os);
152
153// Parses a string into an FMTP parameter set, in key-value format.
154RTCError ParseFmtpParameterSet(absl::string_view line_params,
155 CodecParameterMap& codec_params);
156
Mirko Bonadei35214fc2019-09-23 12:54:28157struct RTC_EXPORT RtcpFeedback {
deadbeefe814a0d2017-02-26 02:15:09158 RtcpFeedbackType type = RtcpFeedbackType::CCM;
deadbeefe702b302017-02-04 20:09:01159
160 // Equivalent to ORTC "parameter" field with slight differences:
161 // 1. It's an enum instead of a string.
162 // 2. Generic NACK feedback is represented by a GENERIC_NACK message type,
163 // rather than an unset "parameter" value.
Florent Castelli8037fc62024-08-29 13:00:40164 std::optional<RtcpFeedbackMessageType> message_type;
deadbeefe702b302017-02-04 20:09:01165
deadbeefe814a0d2017-02-26 02:15:09166 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 13:29:28167 RtcpFeedback();
168 explicit RtcpFeedback(RtcpFeedbackType type);
169 RtcpFeedback(RtcpFeedbackType type, RtcpFeedbackMessageType message_type);
Mirko Bonadei2ffed6d2018-07-20 09:09:32170 RtcpFeedback(const RtcpFeedback&);
Stefan Holmer1acbd682017-09-01 13:29:28171 ~RtcpFeedback();
deadbeefe814a0d2017-02-26 02:15:09172
deadbeefe702b302017-02-04 20:09:01173 bool operator==(const RtcpFeedback& o) const {
174 return type == o.type && message_type == o.message_type;
175 }
176 bool operator!=(const RtcpFeedback& o) const { return !(*this == o); }
177};
178
Florent Castelli0a4a9842023-04-03 17:25:29179struct RTC_EXPORT RtpCodec {
180 RtpCodec();
181 RtpCodec(const RtpCodec&);
182 virtual ~RtpCodec();
Stefan Holmer1acbd682017-09-01 13:29:28183
Artem Titov0e61fdd2021-07-25 19:50:14184 // Build MIME "type/subtype" string from `name` and `kind`.
deadbeefe702b302017-02-04 20:09:01185 std::string mime_type() const { return MediaTypeToString(kind) + "/" + name; }
186
187 // Used to identify the codec. Equivalent to MIME subtype.
188 std::string name;
189
190 // The media type of this codec. Equivalent to MIME top-level type.
Harald Alvestrand3d120662025-06-11 07:34:39191 MediaType kind = MediaType::AUDIO;
deadbeefe702b302017-02-04 20:09:01192
Florent Castelli0a4a9842023-04-03 17:25:29193 // If unset, the implementation default is used.
Florent Castelli8037fc62024-08-29 13:00:40194 std::optional<int> clock_rate;
deadbeefe702b302017-02-04 20:09:01195
Florent Castelli0a4a9842023-04-03 17:25:29196 // The number of audio channels used. Unset for video codecs. If unset for
197 // audio, the implementation default is used.
198 // TODO(deadbeef): The "implementation default" part isn't fully implemented.
199 // Only defaults to 1, even though some codecs (such as opus) should really
200 // default to 2.
Florent Castelli8037fc62024-08-29 13:00:40201 std::optional<int> num_channels;
deadbeefe702b302017-02-04 20:09:01202
Florent Castelli0a4a9842023-04-03 17:25:29203 // Feedback mechanisms to be used for this codec.
204 // TODO(deadbeef): Not implemented with PeerConnection senders/receivers.
deadbeefe702b302017-02-04 20:09:01205 std::vector<RtcpFeedback> rtcp_feedback;
206
207 // Codec-specific parameters that must be signaled to the remote party.
deadbeefe814a0d2017-02-26 02:15:09208 //
deadbeefe702b302017-02-04 20:09:01209 // Corresponds to "a=fmtp" parameters in SDP.
deadbeefe814a0d2017-02-26 02:15:09210 //
211 // Contrary to ORTC, these parameters are named using all lowercase strings.
Ã…sa Persson90bc1e12019-05-31 11:29:35212 // This helps make the mapping to SDP simpler, if an application is using SDP.
213 // Boolean values are represented by the string "1".
Johannes Kron72d69152020-02-10 13:05:55214 std::map<std::string, std::string> parameters;
deadbeefe702b302017-02-04 20:09:01215
Florent Castelli0a4a9842023-04-03 17:25:29216 bool operator==(const RtpCodec& o) const {
217 return name == o.name && kind == o.kind && clock_rate == o.clock_rate &&
218 num_channels == o.num_channels && rtcp_feedback == o.rtcp_feedback &&
219 parameters == o.parameters;
220 }
221 bool operator!=(const RtpCodec& o) const { return !(*this == o); }
Philipp Hanckeb9405c42023-12-07 17:00:47222 bool IsResiliencyCodec() const;
223 bool IsMediaCodec() const;
Florent Castelli0a4a9842023-04-03 17:25:29224};
deadbeefe702b302017-02-04 20:09:01225
Florent Castelli0a4a9842023-04-03 17:25:29226// RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to
227// RtpParameters. This represents the static capabilities of an endpoint's
228// implementation of a codec.
229struct RTC_EXPORT RtpCodecCapability : public RtpCodec {
230 RtpCodecCapability();
231 virtual ~RtpCodecCapability();
deadbeefe702b302017-02-04 20:09:01232
Florent Castelli0a4a9842023-04-03 17:25:29233 // Default payload type for this codec. Mainly needed for codecs that have
234 // statically assigned payload types.
Florent Castelli8037fc62024-08-29 13:00:40235 std::optional<int> preferred_payload_type;
deadbeefe702b302017-02-04 20:09:01236
Florent Castelli0a4a9842023-04-03 17:25:29237 // List of scalability modes supported by the video codec.
Byoungchan Leea1a7c632022-07-05 12:06:28238 absl::InlinedVector<ScalabilityMode, kScalabilityModeCount> scalability_modes;
239
deadbeefe702b302017-02-04 20:09:01240 bool operator==(const RtpCodecCapability& o) const {
Florent Castelli0a4a9842023-04-03 17:25:29241 return RtpCodec::operator==(o) &&
deadbeefe702b302017-02-04 20:09:01242 preferred_payload_type == o.preferred_payload_type &&
Byoungchan Leea1a7c632022-07-05 12:06:28243 scalability_modes == o.scalability_modes;
deadbeefe702b302017-02-04 20:09:01244 }
245 bool operator!=(const RtpCodecCapability& o) const { return !(*this == o); }
Harald Alvestrand72a1d7d2025-03-05 12:26:17246
247 template <typename Sink>
248 friend void AbslStringify(Sink& sink, const RtpCodecCapability& cap) {
Harald Alvestrand3d120662025-06-11 07:34:39249 if (cap.kind == MediaType::AUDIO) {
Harald Alvestrand72a1d7d2025-03-05 12:26:17250 absl::Format(&sink, "[audio/%s/%d/%d]", cap.name,
251 cap.clock_rate.value_or(0), cap.num_channels.value_or(1));
252 } else {
253 absl::Format(&sink, "[video/%s]", cap.name);
254 }
255 }
deadbeefe702b302017-02-04 20:09:01256};
257
Markus Handell0357b3e2020-03-16 12:40:51258// Used in RtpCapabilities and RtpTransceiverInterface's header extensions query
259// and setup methods; represents the capabilities/preferences of an
deadbeefe702b302017-02-04 20:09:01260// implementation for a header extension.
261//
262// Just called "RtpHeaderExtension" in ORTC, but the "Capability" suffix was
263// added here for consistency and to avoid confusion with
264// RtpHeaderExtensionParameters.
265//
266// Note that ORTC includes a "kind" field, but we omit this because it's
Harald Alvestrand9f033692025-03-25 22:31:05267// redundant; if you call
Harald Alvestrand3d120662025-06-11 07:34:39268// "RtpReceiver::GetCapabilities(MediaType::AUDIO)", you know you're
Harald Alvestrand9f033692025-03-25 22:31:05269// getting audio capabilities.
Markus Handell0357b3e2020-03-16 12:40:51270struct RTC_EXPORT RtpHeaderExtensionCapability {
Johannes Kron07ba2b92018-09-26 11:33:35271 // URI of this extension, as defined in RFC8285.
deadbeefe702b302017-02-04 20:09:01272 std::string uri;
273
274 // Preferred value of ID that goes in the packet.
Florent Castelli8037fc62024-08-29 13:00:40275 std::optional<int> preferred_id;
deadbeefe702b302017-02-04 20:09:01276
277 // If true, it's preferred that the value in the header is encrypted.
deadbeefe702b302017-02-04 20:09:01278 bool preferred_encrypt = false;
279
Markus Handell0357b3e2020-03-16 12:40:51280 // The direction of the extension. The kStopped value is only used with
Philipp Hancke9f6ae372023-03-06 17:08:31281 // RtpTransceiverInterface::SetHeaderExtensionsToNegotiate() and
282 // SetHeaderExtensionsToNegotiate().
Markus Handell0357b3e2020-03-16 12:40:51283 RtpTransceiverDirection direction = RtpTransceiverDirection::kSendRecv;
284
deadbeefe814a0d2017-02-26 02:15:09285 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 13:29:28286 RtpHeaderExtensionCapability();
Danil Chapovalov2b4ec9e2020-03-25 16:23:37287 explicit RtpHeaderExtensionCapability(absl::string_view uri);
288 RtpHeaderExtensionCapability(absl::string_view uri, int preferred_id);
289 RtpHeaderExtensionCapability(absl::string_view uri,
Markus Handell0357b3e2020-03-16 12:40:51290 int preferred_id,
291 RtpTransceiverDirection direction);
Emil Vardarf5a547a2024-09-26 11:06:07292 RtpHeaderExtensionCapability(absl::string_view uri,
293 int preferred_id,
294 bool preferred_encrypt,
295 RtpTransceiverDirection direction);
Stefan Holmer1acbd682017-09-01 13:29:28296 ~RtpHeaderExtensionCapability();
deadbeefe814a0d2017-02-26 02:15:09297
deadbeefe702b302017-02-04 20:09:01298 bool operator==(const RtpHeaderExtensionCapability& o) const {
299 return uri == o.uri && preferred_id == o.preferred_id &&
Markus Handell0357b3e2020-03-16 12:40:51300 preferred_encrypt == o.preferred_encrypt && direction == o.direction;
deadbeefe702b302017-02-04 20:09:01301 }
302 bool operator!=(const RtpHeaderExtensionCapability& o) const {
303 return !(*this == o);
304 }
Harald Alvestrand836300f2025-06-05 11:52:25305 template <typename Sink>
306 friend void AbslStringify(Sink& sink,
307 const RtpHeaderExtensionCapability& cap) {
308 absl::Format(&sink, "%s", cap.uri);
309 if (cap.direction != RtpTransceiverDirection::kSendRecv) {
310 absl::Format(&sink, "/%v", cap.direction);
311 }
312 if (cap.preferred_encrypt) {
313 sink.Append(" (encrypt)");
314 }
315 }
deadbeefe702b302017-02-04 20:09:01316};
317
Johannes Kron07ba2b92018-09-26 11:33:35318// RTP header extension, see RFC8285.
Mirko Bonadei35214fc2019-09-23 12:54:28319struct RTC_EXPORT RtpExtension {
Lennart Grahl0d0ed762021-05-17 14:06:37320 enum Filter {
321 // Encrypted extensions will be ignored and only non-encrypted extensions
322 // will be considered.
323 kDiscardEncryptedExtension,
324 // Encrypted extensions will be preferred but will fall back to
325 // non-encrypted extensions if necessary.
326 kPreferEncryptedExtension,
327 // Encrypted extensions will be required, so any non-encrypted extensions
328 // will be discarded.
329 kRequireEncryptedExtension,
330 };
331
Stefan Holmer1acbd682017-09-01 13:29:28332 RtpExtension();
Danil Chapovalov2b4ec9e2020-03-25 16:23:37333 RtpExtension(absl::string_view uri, int id);
334 RtpExtension(absl::string_view uri, int id, bool encrypt);
Stefan Holmer1acbd682017-09-01 13:29:28335 ~RtpExtension();
Danil Chapovalov418cfee2020-03-25 10:02:37336
Stefan Holmer1acbd682017-09-01 13:29:28337 std::string ToString() const;
338 bool operator==(const RtpExtension& rhs) const {
339 return uri == rhs.uri && id == rhs.id && encrypt == rhs.encrypt;
340 }
Markus Handelldfeb0df2020-03-16 21:20:47341 static bool IsSupportedForAudio(absl::string_view uri);
342 static bool IsSupportedForVideo(absl::string_view uri);
Stefan Holmer1acbd682017-09-01 13:29:28343 // Return "true" if the given RTP header extension URI may be encrypted.
Markus Handelldfeb0df2020-03-16 21:20:47344 static bool IsEncryptionSupported(absl::string_view uri);
Stefan Holmer1acbd682017-09-01 13:29:28345
Lennart Grahl0d0ed762021-05-17 14:06:37346 // Returns the header extension with the given URI or nullptr if not found.
347 static const RtpExtension* FindHeaderExtensionByUri(
348 const std::vector<RtpExtension>& extensions,
349 absl::string_view uri,
350 Filter filter);
Stefan Holmer1acbd682017-09-01 13:29:28351
Lennart Grahl0d0ed762021-05-17 14:06:37352 // Returns the header extension with the given URI and encrypt parameter,
353 // if found, otherwise nullptr.
354 static const RtpExtension* FindHeaderExtensionByUriAndEncryption(
355 const std::vector<RtpExtension>& extensions,
356 absl::string_view uri,
357 bool encrypt);
358
359 // Returns a list of extensions where any extension URI is unique.
Tomas Gunnarssonc69453d2022-01-06 12:36:04360 // The returned list will be sorted by uri first, then encrypt and id last.
361 // Having the list sorted allows the caller fo compare filtered lists for
362 // equality to detect when changes have been made.
Lennart Grahl0d0ed762021-05-17 14:06:37363 static const std::vector<RtpExtension> DeduplicateHeaderExtensions(
364 const std::vector<RtpExtension>& extensions,
365 Filter filter);
Stefan Holmer1acbd682017-09-01 13:29:28366
Danil Chapovalov418cfee2020-03-25 10:02:37367 // Encryption of Header Extensions, see RFC 6904 for details:
368 // https://tools.ietf.org/html/rfc6904
369 static constexpr char kEncryptHeaderExtensionsUri[] =
370 "urn:ietf:params:rtp-hdrext:encrypt";
371
Stefan Holmer1acbd682017-09-01 13:29:28372 // Header extension for audio levels, as defined in:
Danil Chapovalov418cfee2020-03-25 10:02:37373 // https://tools.ietf.org/html/rfc6464
374 static constexpr char kAudioLevelUri[] =
375 "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
Stefan Holmer1acbd682017-09-01 13:29:28376
377 // Header extension for RTP timestamp offset, see RFC 5450 for details:
378 // http://tools.ietf.org/html/rfc5450
Danil Chapovalov418cfee2020-03-25 10:02:37379 static constexpr char kTimestampOffsetUri[] =
380 "urn:ietf:params:rtp-hdrext:toffset";
Stefan Holmer1acbd682017-09-01 13:29:28381
382 // Header extension for absolute send time, see url for details:
383 // http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
Danil Chapovalov418cfee2020-03-25 10:02:37384 static constexpr char kAbsSendTimeUri[] =
385 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
Stefan Holmer1acbd682017-09-01 13:29:28386
Chen Xingcd8a6e22019-07-01 08:56:51387 // Header extension for absolute capture time, see url for details:
388 // http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time
Danil Chapovalov418cfee2020-03-25 10:02:37389 static constexpr char kAbsoluteCaptureTimeUri[] =
390 "http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time";
Chen Xingcd8a6e22019-07-01 08:56:51391
Stefan Holmer1acbd682017-09-01 13:29:28392 // Header extension for coordination of video orientation, see url for
393 // details:
394 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ts_126114v120700p.pdf
Danil Chapovalov418cfee2020-03-25 10:02:37395 static constexpr char kVideoRotationUri[] = "urn:3gpp:video-orientation";
Stefan Holmer1acbd682017-09-01 13:29:28396
397 // Header extension for video content type. E.g. default or screenshare.
Danil Chapovalov418cfee2020-03-25 10:02:37398 static constexpr char kVideoContentTypeUri[] =
399 "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type";
Stefan Holmer1acbd682017-09-01 13:29:28400
401 // Header extension for video timing.
Danil Chapovalov418cfee2020-03-25 10:02:37402 static constexpr char kVideoTimingUri[] =
403 "http://www.webrtc.org/experiments/rtp-hdrext/video-timing";
Stefan Holmer1acbd682017-09-01 13:29:28404
Danil Chapovalovf3119ef2018-09-25 10:20:37405 // Experimental codec agnostic frame descriptor.
Danil Chapovalov418cfee2020-03-25 10:02:37406 static constexpr char kGenericFrameDescriptorUri00[] =
407 "http://www.webrtc.org/experiments/rtp-hdrext/"
408 "generic-frame-descriptor-00";
Danil Chapovalov418cfee2020-03-25 10:02:37409 static constexpr char kDependencyDescriptorUri[] =
410 "https://aomediacodec.github.io/av1-rtp-spec/"
411 "#dependency-descriptor-rtp-header-extension";
Danil Chapovalovf3119ef2018-09-25 10:20:37412
Per Kjellander70c89452020-10-21 11:35:07413 // Experimental extension for signalling target bitrate per layer.
414 static constexpr char kVideoLayersAllocationUri[] =
415 "http://www.webrtc.org/experiments/rtp-hdrext/video-layers-allocation00";
416
Stefan Holmer1acbd682017-09-01 13:29:28417 // Header extension for transport sequence number, see url for details:
418 // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions
Danil Chapovalov418cfee2020-03-25 10:02:37419 static constexpr char kTransportSequenceNumberUri[] =
420 "http://www.ietf.org/id/"
421 "draft-holmer-rmcat-transport-wide-cc-extensions-01";
422 static constexpr char kTransportSequenceNumberV2Uri[] =
423 "http://www.webrtc.org/experiments/rtp-hdrext/transport-wide-cc-02";
Stefan Holmer1acbd682017-09-01 13:29:28424
Danil Chapovalov418cfee2020-03-25 10:02:37425 // This extension allows applications to adaptively limit the playout delay
426 // on frames as per the current needs. For example, a gaming application
427 // has very different needs on end-to-end delay compared to a video-conference
428 // application.
429 static constexpr char kPlayoutDelayUri[] =
430 "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay";
431
432 // Header extension for color space information.
433 static constexpr char kColorSpaceUri[] =
434 "http://www.webrtc.org/experiments/rtp-hdrext/color-space";
Stefan Holmer1acbd682017-09-01 13:29:28435
Steve Antonbb50ce52018-03-26 17:24:32436 // Header extension for identifying media section within a transport.
437 // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation-49#section-15
Danil Chapovalov418cfee2020-03-25 10:02:37438 static constexpr char kMidUri[] = "urn:ietf:params:rtp-hdrext:sdes:mid";
Johannes Krond0b69a82018-12-03 13:18:53439
Amit Hilbuch77938e62018-12-21 17:23:38440 // Header extension for RIDs and Repaired RIDs
441 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09
442 // https://tools.ietf.org/html/draft-ietf-mmusic-rid-15
Danil Chapovalov418cfee2020-03-25 10:02:37443 static constexpr char kRidUri[] =
444 "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id";
445 static constexpr char kRepairedRidUri[] =
446 "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id";
Amit Hilbuch77938e62018-12-21 17:23:38447
Harald Alvestrand3d120662025-06-11 07:34:39448 // Header extension to propagate VideoFrame id field
Jeremy Leconteb258c562021-03-18 12:50:42449 static constexpr char kVideoFrameTrackingIdUri[] =
450 "http://www.webrtc.org/experiments/rtp-hdrext/video-frame-tracking-id";
451
Doudou Kisabakaae0d1172021-05-24 11:04:45452 // Header extension for Mixer-to-Client audio levels per CSRC as defined in
453 // https://tools.ietf.org/html/rfc6465
454 static constexpr char kCsrcAudioLevelsUri[] =
455 "urn:ietf:params:rtp-hdrext:csrc-audio-level";
456
Fanny Linderborg2f91bdc2024-08-28 07:46:46457 // Header extension for automatic corruption detection.
458 static constexpr char kCorruptionDetectionUri[] =
459 "http://www.webrtc.org/experiments/rtp-hdrext/corruption-detection";
460
Johannes Kron07ba2b92018-09-26 11:33:35461 // Inclusive min and max IDs for two-byte header extensions and one-byte
462 // header extensions, per RFC8285 Section 4.2-4.3.
463 static constexpr int kMinId = 1;
464 static constexpr int kMaxId = 255;
Johannes Kron78cdde32018-10-05 08:00:46465 static constexpr int kMaxValueSize = 255;
Johannes Kron07ba2b92018-09-26 11:33:35466 static constexpr int kOneByteHeaderExtensionMaxId = 14;
Johannes Kron78cdde32018-10-05 08:00:46467 static constexpr int kOneByteHeaderExtensionMaxValueSize = 16;
Stefan Holmer1acbd682017-09-01 13:29:28468
469 std::string uri;
470 int id = 0;
471 bool encrypt = false;
Harald Alvestrandb3e94fd2024-12-19 13:19:47472
473 template <typename Sink>
474 friend void AbslStringify(Sink& sink, const RtpExtension& extension) {
475 if (extension.encrypt) {
476 absl::Format(&sink, "[%d %s (encrypted)]", extension.id, extension.uri);
477 } else {
478 absl::Format(&sink, "[%d %s]", extension.id, extension.uri);
479 }
480 }
Stefan Holmer1acbd682017-09-01 13:29:28481};
482
Mirko Bonadei35214fc2019-09-23 12:54:28483struct RTC_EXPORT RtpFecParameters {
deadbeefe702b302017-02-04 20:09:01484 // If unset, a value is chosen by the implementation.
deadbeefe814a0d2017-02-26 02:15:09485 // Works just like RtpEncodingParameters::ssrc.
Florent Castelli8037fc62024-08-29 13:00:40486 std::optional<uint32_t> ssrc;
deadbeefe702b302017-02-04 20:09:01487
488 FecMechanism mechanism = FecMechanism::RED;
489
deadbeefe814a0d2017-02-26 02:15:09490 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 13:29:28491 RtpFecParameters();
492 explicit RtpFecParameters(FecMechanism mechanism);
493 RtpFecParameters(FecMechanism mechanism, uint32_t ssrc);
Mirko Bonadei2ffed6d2018-07-20 09:09:32494 RtpFecParameters(const RtpFecParameters&);
Stefan Holmer1acbd682017-09-01 13:29:28495 ~RtpFecParameters();
deadbeefe814a0d2017-02-26 02:15:09496
deadbeefe702b302017-02-04 20:09:01497 bool operator==(const RtpFecParameters& o) const {
498 return ssrc == o.ssrc && mechanism == o.mechanism;
499 }
500 bool operator!=(const RtpFecParameters& o) const { return !(*this == o); }
501};
502
Mirko Bonadei35214fc2019-09-23 12:54:28503struct RTC_EXPORT RtpRtxParameters {
deadbeefe702b302017-02-04 20:09:01504 // If unset, a value is chosen by the implementation.
deadbeefe814a0d2017-02-26 02:15:09505 // Works just like RtpEncodingParameters::ssrc.
Florent Castelli8037fc62024-08-29 13:00:40506 std::optional<uint32_t> ssrc;
deadbeefe702b302017-02-04 20:09:01507
deadbeefe814a0d2017-02-26 02:15:09508 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 13:29:28509 RtpRtxParameters();
510 explicit RtpRtxParameters(uint32_t ssrc);
Mirko Bonadei2ffed6d2018-07-20 09:09:32511 RtpRtxParameters(const RtpRtxParameters&);
Stefan Holmer1acbd682017-09-01 13:29:28512 ~RtpRtxParameters();
deadbeefe814a0d2017-02-26 02:15:09513
deadbeefe702b302017-02-04 20:09:01514 bool operator==(const RtpRtxParameters& o) const { return ssrc == o.ssrc; }
515 bool operator!=(const RtpRtxParameters& o) const { return !(*this == o); }
516};
517
Mirko Bonadei66e76792019-04-02 09:33:59518struct RTC_EXPORT RtpEncodingParameters {
Stefan Holmer1acbd682017-09-01 13:29:28519 RtpEncodingParameters();
Mirko Bonadei2ffed6d2018-07-20 09:09:32520 RtpEncodingParameters(const RtpEncodingParameters&);
Stefan Holmer1acbd682017-09-01 13:29:28521 ~RtpEncodingParameters();
522
deadbeefe702b302017-02-04 20:09:01523 // If unset, a value is chosen by the implementation.
deadbeefe814a0d2017-02-26 02:15:09524 //
525 // Note that the chosen value is NOT returned by GetParameters, because it
526 // may change due to an SSRC conflict, in which case the conflict is handled
527 // internally without any event. Another way of looking at this is that an
528 // unset SSRC acts as a "wildcard" SSRC.
Florent Castelli8037fc62024-08-29 13:00:40529 std::optional<uint32_t> ssrc;
deadbeefe702b302017-02-04 20:09:01530
Helmer Nylend7f47b72025-06-09 15:36:00531 // The list of CSRCs to be included in the RTP header. Defaults to an empty
532 // list. At most 15 CSRCs can be specified, and they must be the same for all
533 // encodings in an RtpParameters struct.
534 //
535 // If this field is set, the list is replaced with the specified values.
536 // Otherwise, it is left unchanged. Specify an empty vector to clear the list.
537 std::optional<std::vector<uint32_t>> csrcs;
538
Seth Hampson24722b32017-12-22 17:36:42539 // The relative bitrate priority of this encoding. Currently this is
Seth Hampsona881ac02018-02-12 22:14:39540 // implemented for the entire rtp sender by using the value of the first
541 // encoding parameter.
Taylor Brandstettere3a294c2020-03-23 23:16:58542 // See: https://w3c.github.io/webrtc-priority/#enumdef-rtcprioritytype
543 // "very-low" = 0.5
544 // "low" = 1.0
545 // "medium" = 2.0
546 // "high" = 4.0
Seth Hampsona881ac02018-02-12 22:14:39547 // TODO(webrtc.bugs.org/8630): Implement this per encoding parameter.
548 // Currently there is logic for how bitrate is distributed per simulcast layer
549 // in the VideoBitrateAllocator. This must be updated to incorporate relative
550 // bitrate priority.
Seth Hampson24722b32017-12-22 17:36:42551 double bitrate_priority = kDefaultBitratePriority;
deadbeefe702b302017-02-04 20:09:01552
Tim Haloun648d28a2018-10-18 23:52:22553 // The relative DiffServ Code Point priority for this encoding, allowing
554 // packets to be marked relatively higher or lower without affecting
Taylor Brandstettere3a294c2020-03-23 23:16:58555 // bandwidth allocations. See https://w3c.github.io/webrtc-dscp-exp/ .
Tim Haloun648d28a2018-10-18 23:52:22556 // TODO(http://crbug.com/webrtc/8630): Implement this per encoding parameter.
Taylor Brandstetter3f1aee32020-02-27 19:59:23557 // TODO(http://crbug.com/webrtc/11379): TCP connections should use a single
558 // DSCP value even if shared by multiple senders; this is not implemented.
559 Priority network_priority = Priority::kLow;
Tim Haloun648d28a2018-10-18 23:52:22560
deadbeefe702b302017-02-04 20:09:01561 // If set, this represents the Transport Independent Application Specific
562 // maximum bandwidth defined in RFC3890. If unset, there is no maximum
Seth Hampsona881ac02018-02-12 22:14:39563 // bitrate. Currently this is implemented for the entire rtp sender by using
564 // the value of the first encoding parameter.
565 //
deadbeefe702b302017-02-04 20:09:01566 // Just called "maxBitrate" in ORTC spec.
deadbeefe814a0d2017-02-26 02:15:09567 //
568 // TODO(deadbeef): With ORTC RtpSenders, this currently sets the total
569 // bandwidth for the entire bandwidth estimator (audio and video). This is
570 // just always how "b=AS" was handled, but it's not correct and should be
571 // fixed.
Florent Castelli8037fc62024-08-29 13:00:40572 std::optional<int> max_bitrate_bps;
deadbeefe702b302017-02-04 20:09:01573
Ã…sa Persson55659812018-06-18 15:51:32574 // Specifies the minimum bitrate in bps for video.
Florent Castelli8037fc62024-08-29 13:00:40575 std::optional<int> min_bitrate_bps;
Ã…sa Persson613591a2018-05-29 07:21:31576
Ã…sa Persson8c1bf952018-09-13 08:42:19577 // Specifies the maximum framerate in fps for video.
Florent Castelli8037fc62024-08-29 13:00:40578 std::optional<double> max_framerate;
deadbeefe702b302017-02-04 20:09:01579
Ã…sa Persson23eba222018-10-02 12:47:06580 // Specifies the number of temporal layers for video (if the feature is
581 // supported by the codec implementation).
Ilya Nikolaevskiy9f6a0d52019-02-05 09:29:41582 // Screencast support is experimental.
Florent Castelli8037fc62024-08-29 13:00:40583 std::optional<int> num_temporal_layers;
Ã…sa Persson23eba222018-10-02 12:47:06584
deadbeefe702b302017-02-04 20:09:01585 // For video, scale the resolution down by this factor.
Florent Castelli8037fc62024-08-29 13:00:40586 std::optional<double> scale_resolution_down_by;
deadbeefe702b302017-02-04 20:09:01587
philipel87e99092020-11-18 10:52:04588 // https://w3c.github.io/webrtc-svc/#rtcrtpencodingparameters
Florent Castelli8037fc62024-08-29 13:00:40589 std::optional<std::string> scalability_mode;
philipel87e99092020-11-18 10:52:04590
Henrik Boströme8c97c02024-10-25 07:51:44591 // This is an alternative API to `scale_resolution_down_by` but expressed in
592 // absolute terms (max width and max height) as opposed to relative terms (a
593 // scaling factor that is relative to the input frame size).
Jonas Oreland0deda152022-09-23 10:08:57594 //
Henrik Boströme8c97c02024-10-25 07:51:44595 // If both `scale_resolution_down_by` and `scale_resolution_down_to` are
596 // specified, the "scale by" value is ignored.
Jonas Oreland0deda152022-09-23 10:08:57597 //
Henrik Boströme8c97c02024-10-25 07:51:44598 // See spec:
599 // https://w3c.github.io/webrtc-extensions/#dom-rtcrtpencodingparameters-scaleresolutiondownto
Henrik Boströme8c97c02024-10-25 07:51:44600 std::optional<Resolution> scale_resolution_down_to;
Jonas Oreland0deda152022-09-23 10:08:57601
Seth Hampsona881ac02018-02-12 22:14:39602 // For an RtpSender, set to true to cause this encoding to be encoded and
603 // sent, and false for it not to be encoded and sent. This allows control
604 // across multiple encodings of a sender for turning simulcast layers on and
605 // off.
606 // TODO(webrtc.bugs.org/8807): Updating this parameter will trigger an encoder
607 // reset, but this isn't necessarily required.
deadbeefdbe2b872016-03-22 22:42:00608 bool active = true;
deadbeefe702b302017-02-04 20:09:01609
610 // Value to use for RID RTP header extension.
611 // Called "encodingId" in ORTC.
deadbeefe702b302017-02-04 20:09:01612 std::string rid;
Philipp Hancke82c56ca2023-08-28 09:11:06613 bool request_key_frame = false;
deadbeefe702b302017-02-04 20:09:01614
Jakob Ivarsson39adce12020-06-25 12:09:58615 // Allow dynamic frame length changes for audio:
616 // https://w3c.github.io/webrtc-extensions/#dom-rtcrtpencodingparameters-adaptiveptime
617 bool adaptive_ptime = false;
618
Florent Castelli43a5dd82023-04-12 10:45:07619 // Allow changing the used codec for this encoding.
Florent Castelli8037fc62024-08-29 13:00:40620 std::optional<RtpCodec> codec;
Florent Castelli43a5dd82023-04-12 10:45:07621
Taylor Brandstetter0cd086b2016-04-20 23:23:10622 bool operator==(const RtpEncodingParameters& o) const {
Helmer Nylend7f47b72025-06-09 15:36:00623 return ssrc == o.ssrc && csrcs == o.csrcs &&
624 bitrate_priority == o.bitrate_priority &&
Florent Castellia8c2f512019-11-28 14:48:24625 network_priority == o.network_priority &&
Seth Hampson24722b32017-12-22 17:36:42626 max_bitrate_bps == o.max_bitrate_bps &&
Ã…sa Persson8c1bf952018-09-13 08:42:19627 min_bitrate_bps == o.min_bitrate_bps &&
deadbeefe702b302017-02-04 20:09:01628 max_framerate == o.max_framerate &&
Ã…sa Persson23eba222018-10-02 12:47:06629 num_temporal_layers == o.num_temporal_layers &&
deadbeefe702b302017-02-04 20:09:01630 scale_resolution_down_by == o.scale_resolution_down_by &&
Jakob Ivarsson39adce12020-06-25 12:09:58631 active == o.active && rid == o.rid &&
Jonas Oreland0deda152022-09-23 10:08:57632 adaptive_ptime == o.adaptive_ptime &&
Henrik Boströme8c97c02024-10-25 07:51:44633 scale_resolution_down_to == o.scale_resolution_down_to &&
634 codec == o.codec;
Taylor Brandstetter0cd086b2016-04-20 23:23:10635 }
Taylor Brandstetterdb0cd9e2016-05-16 18:40:30636 bool operator!=(const RtpEncodingParameters& o) const {
637 return !(*this == o);
638 }
Taylor Brandstetter0cd086b2016-04-20 23:23:10639};
640
Florent Castelli0a4a9842023-04-03 17:25:29641struct RTC_EXPORT RtpCodecParameters : public RtpCodec {
Stefan Holmer1acbd682017-09-01 13:29:28642 RtpCodecParameters();
Mirko Bonadei2ffed6d2018-07-20 09:09:32643 RtpCodecParameters(const RtpCodecParameters&);
Florent Castelli0a4a9842023-04-03 17:25:29644 virtual ~RtpCodecParameters();
deadbeefe702b302017-02-04 20:09:01645
646 // Payload type used to identify this codec in RTP packets.
deadbeefe814a0d2017-02-26 02:15:09647 // This must always be present, and must be unique across all codecs using
deadbeefe702b302017-02-04 20:09:01648 // the same transport.
649 int payload_type = 0;
650
Taylor Brandstetter0cd086b2016-04-20 23:23:10651 bool operator==(const RtpCodecParameters& o) const {
Florent Castelli0a4a9842023-04-03 17:25:29652 return RtpCodec::operator==(o) && payload_type == o.payload_type;
Taylor Brandstetter0cd086b2016-04-20 23:23:10653 }
Taylor Brandstetterdb0cd9e2016-05-16 18:40:30654 bool operator!=(const RtpCodecParameters& o) const { return !(*this == o); }
Harald Alvestrand45c54602025-06-18 09:35:28655 template <typename Sink>
656 friend void AbslStringify(Sink& sink, const RtpCodecParameters& p) {
657 absl::Format(&sink, "[%d: %s]", p.payload_type, p.mime_type());
658 }
skvladdc1c62c2016-03-17 02:07:43659};
660
Ã…sa Persson90bc1e12019-05-31 11:29:35661// RtpCapabilities is used to represent the static capabilities of an endpoint.
662// An application can use these capabilities to construct an RtpParameters.
Mirko Bonadei66e76792019-04-02 09:33:59663struct RTC_EXPORT RtpCapabilities {
Stefan Holmer1acbd682017-09-01 13:29:28664 RtpCapabilities();
665 ~RtpCapabilities();
666
deadbeefe702b302017-02-04 20:09:01667 // Supported codecs.
668 std::vector<RtpCodecCapability> codecs;
669
670 // Supported RTP header extensions.
671 std::vector<RtpHeaderExtensionCapability> header_extensions;
672
deadbeefe814a0d2017-02-26 02:15:09673 // Supported Forward Error Correction (FEC) mechanisms. Note that the RED,
674 // ulpfec and flexfec codecs used by these mechanisms will still appear in
Artem Titov0e61fdd2021-07-25 19:50:14675 // `codecs`.
deadbeefe702b302017-02-04 20:09:01676 std::vector<FecMechanism> fec;
677
678 bool operator==(const RtpCapabilities& o) const {
679 return codecs == o.codecs && header_extensions == o.header_extensions &&
680 fec == o.fec;
681 }
682 bool operator!=(const RtpCapabilities& o) const { return !(*this == o); }
683};
684
Florent Castellidacec712018-05-24 14:24:21685struct RtcpParameters final {
686 RtcpParameters();
Mirko Bonadei2ffed6d2018-07-20 09:09:32687 RtcpParameters(const RtcpParameters&);
Florent Castellidacec712018-05-24 14:24:21688 ~RtcpParameters();
689
690 // The SSRC to be used in the "SSRC of packet sender" field. If not set, one
691 // will be chosen by the implementation.
692 // TODO(deadbeef): Not implemented.
Florent Castelli8037fc62024-08-29 13:00:40693 std::optional<uint32_t> ssrc;
Florent Castellidacec712018-05-24 14:24:21694
695 // The Canonical Name (CNAME) used by RTCP (e.g. in SDES messages).
696 //
697 // If empty in the construction of the RtpTransport, one will be generated by
698 // the implementation, and returned in GetRtcpParameters. Multiple
699 // RtpTransports created by the same OrtcFactory will use the same generated
700 // CNAME.
701 //
702 // If empty when passed into SetParameters, the CNAME simply won't be
703 // modified.
704 std::string cname;
705
706 // Send reduced-size RTCP?
707 bool reduced_size = false;
708
709 // Send RTCP multiplexed on the RTP transport?
710 // Not used with PeerConnection senders/receivers
711 bool mux = true;
712
713 bool operator==(const RtcpParameters& o) const {
714 return ssrc == o.ssrc && cname == o.cname &&
715 reduced_size == o.reduced_size && mux == o.mux;
716 }
717 bool operator!=(const RtcpParameters& o) const { return !(*this == o); }
718};
719
Mirko Bonadeiac194142018-10-22 15:08:37720struct RTC_EXPORT RtpParameters {
Stefan Holmer1acbd682017-09-01 13:29:28721 RtpParameters();
Mirko Bonadei2ffed6d2018-07-20 09:09:32722 RtpParameters(const RtpParameters&);
Stefan Holmer1acbd682017-09-01 13:29:28723 ~RtpParameters();
724
deadbeefe702b302017-02-04 20:09:01725 // Used when calling getParameters/setParameters with a PeerConnection
726 // RtpSender, to ensure that outdated parameters are not unintentionally
727 // applied successfully.
deadbeefe702b302017-02-04 20:09:01728 std::string transaction_id;
729
730 // Value to use for MID RTP header extension.
731 // Called "muxId" in ORTC.
732 // TODO(deadbeef): Not implemented.
733 std::string mid;
734
Taylor Brandstetter0cd086b2016-04-20 23:23:10735 std::vector<RtpCodecParameters> codecs;
736
Danil Chapovalovb19eb392019-12-23 16:55:05737 std::vector<RtpExtension> header_extensions;
deadbeefe702b302017-02-04 20:09:01738
739 std::vector<RtpEncodingParameters> encodings;
740
Florent Castellidacec712018-05-24 14:24:21741 // Only available with a Peerconnection RtpSender.
742 // In ORTC, our API includes an additional "RtpTransport"
743 // abstraction on which RTCP parameters are set.
744 RtcpParameters rtcp;
745
Florent Castelli87b3c512018-07-18 14:00:28746 // When bandwidth is constrained and the RtpSender needs to choose between
747 // degrading resolution or degrading framerate, degradationPreference
748 // indicates which is preferred. Only for video tracks.
Florent Castelli8037fc62024-08-29 13:00:40749 std::optional<DegradationPreference> degradation_preference;
deadbeefe702b302017-02-04 20:09:01750
Taylor Brandstetter0cd086b2016-04-20 23:23:10751 bool operator==(const RtpParameters& o) const {
deadbeefe702b302017-02-04 20:09:01752 return mid == o.mid && codecs == o.codecs &&
753 header_extensions == o.header_extensions &&
Florent Castellidacec712018-05-24 14:24:21754 encodings == o.encodings && rtcp == o.rtcp &&
deadbeefe702b302017-02-04 20:09:01755 degradation_preference == o.degradation_preference;
Taylor Brandstetter0cd086b2016-04-20 23:23:10756 }
Taylor Brandstetterdb0cd9e2016-05-16 18:40:30757 bool operator!=(const RtpParameters& o) const { return !(*this == o); }
Shigemasa Watanabe63c20e92025-10-18 10:18:53758
759 // Returns true if the active encodings use different codecs.
760 // Inactive encodings are ignored.
761 // If at least two active encodings have different codec values
762 // (including one being unset and another set), this is considered mixed.
763 bool IsMixedCodec() const;
skvladdc1c62c2016-03-17 02:07:43764};
765
766} // namespace webrtc
767
Steve Anton10542f22019-01-11 17:11:00768#endif // API_RTP_PARAMETERS_H_