blob: 0d3c9dfd22c5d18f8623a5ebbe47fe02064b1e15 [file] [log] [blame]
skvladdc1c62c2016-03-16 19:07:43 -07001/*
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 09:11:00 -080011#ifndef API_RTP_PARAMETERS_H_
12#define API_RTP_PARAMETERS_H_
skvladdc1c62c2016-03-16 19:07:43 -070013
Yves Gerey988cc082018-10-23 12:03:01 +020014#include <stdint.h>
Jonas Olssona4d87372019-07-05 19:08:33 +020015
Johannes Kron72d69152020-02-10 14:05:55 +010016#include <map>
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070017#include <string>
skvladdc1c62c2016-03-16 19:07:43 -070018#include <vector>
19
Byoungchan Leea1a7c632022-07-05 21:06:28 +090020#include "absl/container/inlined_vector.h"
Markus Handelldfeb0df2020-03-16 22:20:47 +010021#include "absl/strings/string_view.h"
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +020022#include "absl/types/optional.h"
Steve Anton10542f22019-01-11 09:11:00 -080023#include "api/media_types.h"
Harald Alvestrandfd5ae7f2020-05-16 08:37:49 +020024#include "api/priority.h"
Markus Handell0357b3e2020-03-16 13:40:51 +010025#include "api/rtp_transceiver_direction.h"
Jonas Oreland0deda152022-09-23 12:08:57 +020026#include "api/video/resolution.h"
Byoungchan Leea1a7c632022-07-05 21:06:28 +090027#include "api/video_codecs/scalability_mode.h"
Mirko Bonadeiac194142018-10-22 17:08:37 +020028#include "rtc_base/system/rtc_export.h"
sakal1fd95952016-06-22 00:46:15 -070029
skvladdc1c62c2016-03-16 19:07:43 -070030namespace webrtc {
31
deadbeefe702b302017-02-04 12:09:01 -080032// These structures are intended to mirror those defined by:
33// http://draft.ortc.org/#rtcrtpdictionaries*
34// Contains everything specified as of 2017 Jan 24.
35//
36// They are used when retrieving or modifying the parameters of an
37// RtpSender/RtpReceiver, or retrieving capabilities.
38//
39// Note on conventions: Where ORTC may use "octet", "short" and "unsigned"
40// types, we typically use "int", in keeping with our style guidelines. The
41// parameter's actual valid range will be enforced when the parameters are set,
42// rather than when the parameters struct is built. An exception is made for
43// SSRCs, since they use the full unsigned 32-bit range, and aren't expected to
44// be used for any numeric comparisons/operations.
45//
46// Additionally, where ORTC uses strings, we may use enums for things that have
47// a fixed number of supported values. However, for things that can be extended
48// (such as codecs, by providing an external encoder factory), a string
49// identifier is used.
50
51enum class FecMechanism {
52 RED,
53 RED_AND_ULPFEC,
54 FLEXFEC,
55};
56
57// Used in RtcpFeedback struct.
58enum class RtcpFeedbackType {
deadbeefe702b302017-02-04 12:09:01 -080059 CCM,
Elad Alonfadb1812019-05-24 13:40:02 +020060 LNTF, // "goog-lntf"
deadbeefe702b302017-02-04 12:09:01 -080061 NACK,
62 REMB, // "goog-remb"
63 TRANSPORT_CC,
64};
65
deadbeefe814a0d2017-02-25 18:15:09 -080066// Used in RtcpFeedback struct when type is NACK or CCM.
deadbeefe702b302017-02-04 12:09:01 -080067enum class RtcpFeedbackMessageType {
68 // Equivalent to {type: "nack", parameter: undefined} in ORTC.
69 GENERIC_NACK,
70 PLI, // Usable with NACK.
71 FIR, // Usable with CCM.
72};
73
74enum class DtxStatus {
75 DISABLED,
76 ENABLED,
77};
78
Taylor Brandstetter49fcc102018-05-16 14:20:41 -070079// Based on the spec in
80// https://w3c.github.io/webrtc-pc/#idl-def-rtcdegradationpreference.
81// These options are enforced on a best-effort basis. For instance, all of
82// these options may suffer some frame drops in order to avoid queuing.
83// TODO(sprang): Look into possibility of more strictly enforcing the
84// maintain-framerate option.
85// TODO(deadbeef): Default to "balanced", as the spec indicates?
deadbeefe702b302017-02-04 12:09:01 -080086enum class DegradationPreference {
Taylor Brandstetter49fcc102018-05-16 14:20:41 -070087 // Don't take any actions based on over-utilization signals. Not part of the
88 // web API.
89 DISABLED,
Taylor Brandstetter49fcc102018-05-16 14:20:41 -070090 // On over-use, request lower resolution, possibly causing down-scaling.
Åsa Persson90bc1e12019-05-31 13:29:35 +020091 MAINTAIN_FRAMERATE,
92 // On over-use, request lower frame rate, possibly causing frame drops.
deadbeefe702b302017-02-04 12:09:01 -080093 MAINTAIN_RESOLUTION,
Taylor Brandstetter49fcc102018-05-16 14:20:41 -070094 // Try to strike a "pleasing" balance between frame rate or resolution.
deadbeefe702b302017-02-04 12:09:01 -080095 BALANCED,
96};
97
Henrik Boströmf0eef122020-05-28 16:22:42 +020098RTC_EXPORT const char* DegradationPreferenceToString(
99 DegradationPreference degradation_preference);
100
Mirko Bonadei66e76792019-04-02 11:33:59 +0200101RTC_EXPORT extern const double kDefaultBitratePriority;
deadbeefe702b302017-02-04 12:09:01 -0800102
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200103struct RTC_EXPORT RtcpFeedback {
deadbeefe814a0d2017-02-25 18:15:09 -0800104 RtcpFeedbackType type = RtcpFeedbackType::CCM;
deadbeefe702b302017-02-04 12:09:01 -0800105
106 // Equivalent to ORTC "parameter" field with slight differences:
107 // 1. It's an enum instead of a string.
108 // 2. Generic NACK feedback is represented by a GENERIC_NACK message type,
109 // rather than an unset "parameter" value.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200110 absl::optional<RtcpFeedbackMessageType> message_type;
deadbeefe702b302017-02-04 12:09:01 -0800111
deadbeefe814a0d2017-02-25 18:15:09 -0800112 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 15:29:28 +0200113 RtcpFeedback();
114 explicit RtcpFeedback(RtcpFeedbackType type);
115 RtcpFeedback(RtcpFeedbackType type, RtcpFeedbackMessageType message_type);
Mirko Bonadei2ffed6d2018-07-20 11:09:32 +0200116 RtcpFeedback(const RtcpFeedback&);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200117 ~RtcpFeedback();
deadbeefe814a0d2017-02-25 18:15:09 -0800118
deadbeefe702b302017-02-04 12:09:01 -0800119 bool operator==(const RtcpFeedback& o) const {
120 return type == o.type && message_type == o.message_type;
121 }
122 bool operator!=(const RtcpFeedback& o) const { return !(*this == o); }
123};
124
125// RtpCodecCapability is to RtpCodecParameters as RtpCapabilities is to
126// RtpParameters. This represents the static capabilities of an endpoint's
127// implementation of a codec.
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200128struct RTC_EXPORT RtpCodecCapability {
Stefan Holmer1acbd682017-09-01 15:29:28 +0200129 RtpCodecCapability();
130 ~RtpCodecCapability();
131
Artem Titov0e61fdd2021-07-25 21:50:14 +0200132 // Build MIME "type/subtype" string from `name` and `kind`.
deadbeefe702b302017-02-04 12:09:01 -0800133 std::string mime_type() const { return MediaTypeToString(kind) + "/" + name; }
134
135 // Used to identify the codec. Equivalent to MIME subtype.
136 std::string name;
137
138 // The media type of this codec. Equivalent to MIME top-level type.
139 cricket::MediaType kind = cricket::MEDIA_TYPE_AUDIO;
140
141 // Clock rate in Hertz. If unset, the codec is applicable to any clock rate.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200142 absl::optional<int> clock_rate;
deadbeefe702b302017-02-04 12:09:01 -0800143
144 // Default payload type for this codec. Mainly needed for codecs that use
145 // that have statically assigned payload types.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200146 absl::optional<int> preferred_payload_type;
deadbeefe702b302017-02-04 12:09:01 -0800147
148 // Maximum packetization time supported by an RtpReceiver for this codec.
149 // TODO(deadbeef): Not implemented.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200150 absl::optional<int> max_ptime;
deadbeefe702b302017-02-04 12:09:01 -0800151
Åsa Persson90bc1e12019-05-31 13:29:35 +0200152 // Preferred packetization time for an RtpReceiver or RtpSender of this codec.
deadbeefe702b302017-02-04 12:09:01 -0800153 // TODO(deadbeef): Not implemented.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200154 absl::optional<int> ptime;
deadbeefe702b302017-02-04 12:09:01 -0800155
156 // The number of audio channels supported. Unused for video codecs.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200157 absl::optional<int> num_channels;
deadbeefe702b302017-02-04 12:09:01 -0800158
159 // Feedback mechanisms supported for this codec.
160 std::vector<RtcpFeedback> rtcp_feedback;
161
162 // Codec-specific parameters that must be signaled to the remote party.
deadbeefe814a0d2017-02-25 18:15:09 -0800163 //
deadbeefe702b302017-02-04 12:09:01 -0800164 // Corresponds to "a=fmtp" parameters in SDP.
deadbeefe814a0d2017-02-25 18:15:09 -0800165 //
166 // Contrary to ORTC, these parameters are named using all lowercase strings.
Åsa Persson90bc1e12019-05-31 13:29:35 +0200167 // This helps make the mapping to SDP simpler, if an application is using SDP.
168 // Boolean values are represented by the string "1".
Johannes Kron72d69152020-02-10 14:05:55 +0100169 std::map<std::string, std::string> parameters;
deadbeefe702b302017-02-04 12:09:01 -0800170
171 // Codec-specific parameters that may optionally be signaled to the remote
172 // party.
173 // TODO(deadbeef): Not implemented.
Johannes Kron72d69152020-02-10 14:05:55 +0100174 std::map<std::string, std::string> options;
deadbeefe702b302017-02-04 12:09:01 -0800175
176 // Maximum number of temporal layer extensions supported by this codec.
177 // For example, a value of 1 indicates that 2 total layers are supported.
178 // TODO(deadbeef): Not implemented.
179 int max_temporal_layer_extensions = 0;
180
181 // Maximum number of spatial layer extensions supported by this codec.
182 // For example, a value of 1 indicates that 2 total layers are supported.
183 // TODO(deadbeef): Not implemented.
184 int max_spatial_layer_extensions = 0;
185
Åsa Persson90bc1e12019-05-31 13:29:35 +0200186 // Whether the implementation can send/receive SVC layers with distinct SSRCs.
187 // Always false for audio codecs. True for video codecs that support scalable
188 // video coding with MRST.
deadbeefe702b302017-02-04 12:09:01 -0800189 // TODO(deadbeef): Not implemented.
190 bool svc_multi_stream_support = false;
191
Byoungchan Leea1a7c632022-07-05 21:06:28 +0900192 // https://w3c.github.io/webrtc-svc/#dom-rtcrtpcodeccapability-scalabilitymodes
193 absl::InlinedVector<ScalabilityMode, kScalabilityModeCount> scalability_modes;
194
deadbeefe702b302017-02-04 12:09:01 -0800195 bool operator==(const RtpCodecCapability& o) const {
196 return name == o.name && kind == o.kind && clock_rate == o.clock_rate &&
197 preferred_payload_type == o.preferred_payload_type &&
198 max_ptime == o.max_ptime && ptime == o.ptime &&
199 num_channels == o.num_channels && rtcp_feedback == o.rtcp_feedback &&
200 parameters == o.parameters && options == o.options &&
201 max_temporal_layer_extensions == o.max_temporal_layer_extensions &&
202 max_spatial_layer_extensions == o.max_spatial_layer_extensions &&
Byoungchan Leea1a7c632022-07-05 21:06:28 +0900203 svc_multi_stream_support == o.svc_multi_stream_support &&
204 scalability_modes == o.scalability_modes;
deadbeefe702b302017-02-04 12:09:01 -0800205 }
206 bool operator!=(const RtpCodecCapability& o) const { return !(*this == o); }
207};
208
Markus Handell0357b3e2020-03-16 13:40:51 +0100209// Used in RtpCapabilities and RtpTransceiverInterface's header extensions query
210// and setup methods; represents the capabilities/preferences of an
deadbeefe702b302017-02-04 12:09:01 -0800211// implementation for a header extension.
212//
213// Just called "RtpHeaderExtension" in ORTC, but the "Capability" suffix was
214// added here for consistency and to avoid confusion with
215// RtpHeaderExtensionParameters.
216//
217// Note that ORTC includes a "kind" field, but we omit this because it's
218// redundant; if you call "RtpReceiver::GetCapabilities(MEDIA_TYPE_AUDIO)",
219// you know you're getting audio capabilities.
Markus Handell0357b3e2020-03-16 13:40:51 +0100220struct RTC_EXPORT RtpHeaderExtensionCapability {
Johannes Kron07ba2b92018-09-26 13:33:35 +0200221 // URI of this extension, as defined in RFC8285.
deadbeefe702b302017-02-04 12:09:01 -0800222 std::string uri;
223
224 // Preferred value of ID that goes in the packet.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200225 absl::optional<int> preferred_id;
deadbeefe702b302017-02-04 12:09:01 -0800226
227 // If true, it's preferred that the value in the header is encrypted.
228 // TODO(deadbeef): Not implemented.
229 bool preferred_encrypt = false;
230
Markus Handell0357b3e2020-03-16 13:40:51 +0100231 // The direction of the extension. The kStopped value is only used with
Markus Handell755c65d2020-06-24 01:06:10 +0200232 // RtpTransceiverInterface::HeaderExtensionsToOffer() and
Markus Handell0357b3e2020-03-16 13:40:51 +0100233 // SetOfferedRtpHeaderExtensions().
234 RtpTransceiverDirection direction = RtpTransceiverDirection::kSendRecv;
235
deadbeefe814a0d2017-02-25 18:15:09 -0800236 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 15:29:28 +0200237 RtpHeaderExtensionCapability();
Danil Chapovalov2b4ec9e2020-03-25 17:23:37 +0100238 explicit RtpHeaderExtensionCapability(absl::string_view uri);
239 RtpHeaderExtensionCapability(absl::string_view uri, int preferred_id);
240 RtpHeaderExtensionCapability(absl::string_view uri,
Markus Handell0357b3e2020-03-16 13:40:51 +0100241 int preferred_id,
242 RtpTransceiverDirection direction);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200243 ~RtpHeaderExtensionCapability();
deadbeefe814a0d2017-02-25 18:15:09 -0800244
deadbeefe702b302017-02-04 12:09:01 -0800245 bool operator==(const RtpHeaderExtensionCapability& o) const {
246 return uri == o.uri && preferred_id == o.preferred_id &&
Markus Handell0357b3e2020-03-16 13:40:51 +0100247 preferred_encrypt == o.preferred_encrypt && direction == o.direction;
deadbeefe702b302017-02-04 12:09:01 -0800248 }
249 bool operator!=(const RtpHeaderExtensionCapability& o) const {
250 return !(*this == o);
251 }
252};
253
Johannes Kron07ba2b92018-09-26 13:33:35 +0200254// RTP header extension, see RFC8285.
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200255struct RTC_EXPORT RtpExtension {
Lennart Grahl0d0ed762021-05-17 16:06:37 +0200256 enum Filter {
257 // Encrypted extensions will be ignored and only non-encrypted extensions
258 // will be considered.
259 kDiscardEncryptedExtension,
260 // Encrypted extensions will be preferred but will fall back to
261 // non-encrypted extensions if necessary.
262 kPreferEncryptedExtension,
263 // Encrypted extensions will be required, so any non-encrypted extensions
264 // will be discarded.
265 kRequireEncryptedExtension,
266 };
267
Stefan Holmer1acbd682017-09-01 15:29:28 +0200268 RtpExtension();
Danil Chapovalov2b4ec9e2020-03-25 17:23:37 +0100269 RtpExtension(absl::string_view uri, int id);
270 RtpExtension(absl::string_view uri, int id, bool encrypt);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200271 ~RtpExtension();
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100272
Stefan Holmer1acbd682017-09-01 15:29:28 +0200273 std::string ToString() const;
274 bool operator==(const RtpExtension& rhs) const {
275 return uri == rhs.uri && id == rhs.id && encrypt == rhs.encrypt;
276 }
Markus Handelldfeb0df2020-03-16 22:20:47 +0100277 static bool IsSupportedForAudio(absl::string_view uri);
278 static bool IsSupportedForVideo(absl::string_view uri);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200279 // Return "true" if the given RTP header extension URI may be encrypted.
Markus Handelldfeb0df2020-03-16 22:20:47 +0100280 static bool IsEncryptionSupported(absl::string_view uri);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200281
Lennart Grahl0d0ed762021-05-17 16:06:37 +0200282 // Returns the header extension with the given URI or nullptr if not found.
283 static const RtpExtension* FindHeaderExtensionByUri(
284 const std::vector<RtpExtension>& extensions,
285 absl::string_view uri,
286 Filter filter);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200287
Lennart Grahl0d0ed762021-05-17 16:06:37 +0200288 // Returns the header extension with the given URI and encrypt parameter,
289 // if found, otherwise nullptr.
290 static const RtpExtension* FindHeaderExtensionByUriAndEncryption(
291 const std::vector<RtpExtension>& extensions,
292 absl::string_view uri,
293 bool encrypt);
294
295 // Returns a list of extensions where any extension URI is unique.
Tomas Gunnarssonc69453d2022-01-06 12:36:04 +0000296 // The returned list will be sorted by uri first, then encrypt and id last.
297 // Having the list sorted allows the caller fo compare filtered lists for
298 // equality to detect when changes have been made.
Lennart Grahl0d0ed762021-05-17 16:06:37 +0200299 static const std::vector<RtpExtension> DeduplicateHeaderExtensions(
300 const std::vector<RtpExtension>& extensions,
301 Filter filter);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200302
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100303 // Encryption of Header Extensions, see RFC 6904 for details:
304 // https://tools.ietf.org/html/rfc6904
305 static constexpr char kEncryptHeaderExtensionsUri[] =
306 "urn:ietf:params:rtp-hdrext:encrypt";
307
Stefan Holmer1acbd682017-09-01 15:29:28 +0200308 // Header extension for audio levels, as defined in:
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100309 // https://tools.ietf.org/html/rfc6464
310 static constexpr char kAudioLevelUri[] =
311 "urn:ietf:params:rtp-hdrext:ssrc-audio-level";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200312
313 // Header extension for RTP timestamp offset, see RFC 5450 for details:
314 // http://tools.ietf.org/html/rfc5450
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100315 static constexpr char kTimestampOffsetUri[] =
316 "urn:ietf:params:rtp-hdrext:toffset";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200317
318 // Header extension for absolute send time, see url for details:
319 // http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100320 static constexpr char kAbsSendTimeUri[] =
321 "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200322
Chen Xingcd8a6e22019-07-01 10:56:51 +0200323 // Header extension for absolute capture time, see url for details:
324 // http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100325 static constexpr char kAbsoluteCaptureTimeUri[] =
326 "http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time";
Chen Xingcd8a6e22019-07-01 10:56:51 +0200327
Stefan Holmer1acbd682017-09-01 15:29:28 +0200328 // Header extension for coordination of video orientation, see url for
329 // details:
330 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ts_126114v120700p.pdf
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100331 static constexpr char kVideoRotationUri[] = "urn:3gpp:video-orientation";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200332
333 // Header extension for video content type. E.g. default or screenshare.
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100334 static constexpr char kVideoContentTypeUri[] =
335 "http://www.webrtc.org/experiments/rtp-hdrext/video-content-type";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200336
337 // Header extension for video timing.
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100338 static constexpr char kVideoTimingUri[] =
339 "http://www.webrtc.org/experiments/rtp-hdrext/video-timing";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200340
Danil Chapovalovf3119ef2018-09-25 12:20:37 +0200341 // Experimental codec agnostic frame descriptor.
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100342 static constexpr char kGenericFrameDescriptorUri00[] =
343 "http://www.webrtc.org/experiments/rtp-hdrext/"
344 "generic-frame-descriptor-00";
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100345 static constexpr char kDependencyDescriptorUri[] =
346 "https://aomediacodec.github.io/av1-rtp-spec/"
347 "#dependency-descriptor-rtp-header-extension";
Danil Chapovalovf3119ef2018-09-25 12:20:37 +0200348
Per Kjellander70c89452020-10-21 13:35:07 +0200349 // Experimental extension for signalling target bitrate per layer.
350 static constexpr char kVideoLayersAllocationUri[] =
351 "http://www.webrtc.org/experiments/rtp-hdrext/video-layers-allocation00";
352
Stefan Holmer1acbd682017-09-01 15:29:28 +0200353 // Header extension for transport sequence number, see url for details:
354 // http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100355 static constexpr char kTransportSequenceNumberUri[] =
356 "http://www.ietf.org/id/"
357 "draft-holmer-rmcat-transport-wide-cc-extensions-01";
358 static constexpr char kTransportSequenceNumberV2Uri[] =
359 "http://www.webrtc.org/experiments/rtp-hdrext/transport-wide-cc-02";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200360
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100361 // This extension allows applications to adaptively limit the playout delay
362 // on frames as per the current needs. For example, a gaming application
363 // has very different needs on end-to-end delay compared to a video-conference
364 // application.
365 static constexpr char kPlayoutDelayUri[] =
366 "http://www.webrtc.org/experiments/rtp-hdrext/playout-delay";
367
368 // Header extension for color space information.
369 static constexpr char kColorSpaceUri[] =
370 "http://www.webrtc.org/experiments/rtp-hdrext/color-space";
Stefan Holmer1acbd682017-09-01 15:29:28 +0200371
Steve Antonbb50ce52018-03-26 10:24:32 -0700372 // Header extension for identifying media section within a transport.
373 // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-bundle-negotiation-49#section-15
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100374 static constexpr char kMidUri[] = "urn:ietf:params:rtp-hdrext:sdes:mid";
Johannes Krond0b69a82018-12-03 14:18:53 +0100375
Amit Hilbuch77938e62018-12-21 09:23:38 -0800376 // Header extension for RIDs and Repaired RIDs
377 // https://tools.ietf.org/html/draft-ietf-avtext-rid-09
378 // https://tools.ietf.org/html/draft-ietf-mmusic-rid-15
Danil Chapovalov418cfee2020-03-25 11:02:37 +0100379 static constexpr char kRidUri[] =
380 "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id";
381 static constexpr char kRepairedRidUri[] =
382 "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id";
Amit Hilbuch77938e62018-12-21 09:23:38 -0800383
Jeremy Leconteb258c562021-03-18 13:50:42 +0100384 // Header extension to propagate webrtc::VideoFrame id field
385 static constexpr char kVideoFrameTrackingIdUri[] =
386 "http://www.webrtc.org/experiments/rtp-hdrext/video-frame-tracking-id";
387
Doudou Kisabakaae0d1172021-05-24 13:04:45 +0200388 // Header extension for Mixer-to-Client audio levels per CSRC as defined in
389 // https://tools.ietf.org/html/rfc6465
390 static constexpr char kCsrcAudioLevelsUri[] =
391 "urn:ietf:params:rtp-hdrext:csrc-audio-level";
392
Johannes Kron07ba2b92018-09-26 13:33:35 +0200393 // Inclusive min and max IDs for two-byte header extensions and one-byte
394 // header extensions, per RFC8285 Section 4.2-4.3.
395 static constexpr int kMinId = 1;
396 static constexpr int kMaxId = 255;
Johannes Kron78cdde32018-10-05 10:00:46 +0200397 static constexpr int kMaxValueSize = 255;
Johannes Kron07ba2b92018-09-26 13:33:35 +0200398 static constexpr int kOneByteHeaderExtensionMaxId = 14;
Johannes Kron78cdde32018-10-05 10:00:46 +0200399 static constexpr int kOneByteHeaderExtensionMaxValueSize = 16;
Stefan Holmer1acbd682017-09-01 15:29:28 +0200400
401 std::string uri;
402 int id = 0;
403 bool encrypt = false;
404};
405
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200406struct RTC_EXPORT RtpFecParameters {
deadbeefe702b302017-02-04 12:09:01 -0800407 // If unset, a value is chosen by the implementation.
deadbeefe814a0d2017-02-25 18:15:09 -0800408 // Works just like RtpEncodingParameters::ssrc.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200409 absl::optional<uint32_t> ssrc;
deadbeefe702b302017-02-04 12:09:01 -0800410
411 FecMechanism mechanism = FecMechanism::RED;
412
deadbeefe814a0d2017-02-25 18:15:09 -0800413 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 15:29:28 +0200414 RtpFecParameters();
415 explicit RtpFecParameters(FecMechanism mechanism);
416 RtpFecParameters(FecMechanism mechanism, uint32_t ssrc);
Mirko Bonadei2ffed6d2018-07-20 11:09:32 +0200417 RtpFecParameters(const RtpFecParameters&);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200418 ~RtpFecParameters();
deadbeefe814a0d2017-02-25 18:15:09 -0800419
deadbeefe702b302017-02-04 12:09:01 -0800420 bool operator==(const RtpFecParameters& o) const {
421 return ssrc == o.ssrc && mechanism == o.mechanism;
422 }
423 bool operator!=(const RtpFecParameters& o) const { return !(*this == o); }
424};
425
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200426struct RTC_EXPORT RtpRtxParameters {
deadbeefe702b302017-02-04 12:09:01 -0800427 // If unset, a value is chosen by the implementation.
deadbeefe814a0d2017-02-25 18:15:09 -0800428 // Works just like RtpEncodingParameters::ssrc.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200429 absl::optional<uint32_t> ssrc;
deadbeefe702b302017-02-04 12:09:01 -0800430
deadbeefe814a0d2017-02-25 18:15:09 -0800431 // Constructors for convenience.
Stefan Holmer1acbd682017-09-01 15:29:28 +0200432 RtpRtxParameters();
433 explicit RtpRtxParameters(uint32_t ssrc);
Mirko Bonadei2ffed6d2018-07-20 11:09:32 +0200434 RtpRtxParameters(const RtpRtxParameters&);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200435 ~RtpRtxParameters();
deadbeefe814a0d2017-02-25 18:15:09 -0800436
deadbeefe702b302017-02-04 12:09:01 -0800437 bool operator==(const RtpRtxParameters& o) const { return ssrc == o.ssrc; }
438 bool operator!=(const RtpRtxParameters& o) const { return !(*this == o); }
439};
440
Mirko Bonadei66e76792019-04-02 11:33:59 +0200441struct RTC_EXPORT RtpEncodingParameters {
Stefan Holmer1acbd682017-09-01 15:29:28 +0200442 RtpEncodingParameters();
Mirko Bonadei2ffed6d2018-07-20 11:09:32 +0200443 RtpEncodingParameters(const RtpEncodingParameters&);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200444 ~RtpEncodingParameters();
445
deadbeefe702b302017-02-04 12:09:01 -0800446 // If unset, a value is chosen by the implementation.
deadbeefe814a0d2017-02-25 18:15:09 -0800447 //
448 // Note that the chosen value is NOT returned by GetParameters, because it
449 // may change due to an SSRC conflict, in which case the conflict is handled
450 // internally without any event. Another way of looking at this is that an
451 // unset SSRC acts as a "wildcard" SSRC.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200452 absl::optional<uint32_t> ssrc;
deadbeefe702b302017-02-04 12:09:01 -0800453
Seth Hampson24722b32017-12-22 09:36:42 -0800454 // The relative bitrate priority of this encoding. Currently this is
Seth Hampsona881ac02018-02-12 14:14:39 -0800455 // implemented for the entire rtp sender by using the value of the first
456 // encoding parameter.
Taylor Brandstettere3a294c2020-03-23 23:16:58 +0000457 // See: https://w3c.github.io/webrtc-priority/#enumdef-rtcprioritytype
458 // "very-low" = 0.5
459 // "low" = 1.0
460 // "medium" = 2.0
461 // "high" = 4.0
Seth Hampsona881ac02018-02-12 14:14:39 -0800462 // TODO(webrtc.bugs.org/8630): Implement this per encoding parameter.
463 // Currently there is logic for how bitrate is distributed per simulcast layer
464 // in the VideoBitrateAllocator. This must be updated to incorporate relative
465 // bitrate priority.
Seth Hampson24722b32017-12-22 09:36:42 -0800466 double bitrate_priority = kDefaultBitratePriority;
deadbeefe702b302017-02-04 12:09:01 -0800467
Tim Haloun648d28a2018-10-18 16:52:22 -0700468 // The relative DiffServ Code Point priority for this encoding, allowing
469 // packets to be marked relatively higher or lower without affecting
Taylor Brandstettere3a294c2020-03-23 23:16:58 +0000470 // bandwidth allocations. See https://w3c.github.io/webrtc-dscp-exp/ .
Tim Haloun648d28a2018-10-18 16:52:22 -0700471 // TODO(http://crbug.com/webrtc/8630): Implement this per encoding parameter.
Taylor Brandstetter3f1aee32020-02-27 11:59:23 -0800472 // TODO(http://crbug.com/webrtc/11379): TCP connections should use a single
473 // DSCP value even if shared by multiple senders; this is not implemented.
474 Priority network_priority = Priority::kLow;
Tim Haloun648d28a2018-10-18 16:52:22 -0700475
deadbeefe702b302017-02-04 12:09:01 -0800476 // If set, this represents the Transport Independent Application Specific
477 // maximum bandwidth defined in RFC3890. If unset, there is no maximum
Seth Hampsona881ac02018-02-12 14:14:39 -0800478 // bitrate. Currently this is implemented for the entire rtp sender by using
479 // the value of the first encoding parameter.
480 //
deadbeefe702b302017-02-04 12:09:01 -0800481 // Just called "maxBitrate" in ORTC spec.
deadbeefe814a0d2017-02-25 18:15:09 -0800482 //
483 // TODO(deadbeef): With ORTC RtpSenders, this currently sets the total
484 // bandwidth for the entire bandwidth estimator (audio and video). This is
485 // just always how "b=AS" was handled, but it's not correct and should be
486 // fixed.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200487 absl::optional<int> max_bitrate_bps;
deadbeefe702b302017-02-04 12:09:01 -0800488
Åsa Persson55659812018-06-18 17:51:32 +0200489 // Specifies the minimum bitrate in bps for video.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200490 absl::optional<int> min_bitrate_bps;
Åsa Persson613591a2018-05-29 09:21:31 +0200491
Åsa Persson8c1bf952018-09-13 10:42:19 +0200492 // Specifies the maximum framerate in fps for video.
Florent Castelli907dc802019-12-06 15:03:19 +0100493 absl::optional<double> max_framerate;
deadbeefe702b302017-02-04 12:09:01 -0800494
Åsa Persson23eba222018-10-02 14:47:06 +0200495 // Specifies the number of temporal layers for video (if the feature is
496 // supported by the codec implementation).
Ilya Nikolaevskiy9f6a0d52019-02-05 10:29:41 +0100497 // Screencast support is experimental.
Åsa Persson23eba222018-10-02 14:47:06 +0200498 absl::optional<int> num_temporal_layers;
499
deadbeefe702b302017-02-04 12:09:01 -0800500 // For video, scale the resolution down by this factor.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200501 absl::optional<double> scale_resolution_down_by;
deadbeefe702b302017-02-04 12:09:01 -0800502
philipel87e99092020-11-18 11:52:04 +0100503 // https://w3c.github.io/webrtc-svc/#rtcrtpencodingparameters
504 absl::optional<std::string> scalability_mode;
505
Jonas Oreland0deda152022-09-23 12:08:57 +0200506 // Requested encode resolution.
507 //
508 // This field provides an alternative to `scale_resolution_down_by`
509 // that is not dependent on the video source.
510 //
511 // When setting requested_resolution it is not necessary to adapt the
512 // video source using OnOutputFormatRequest, since the VideoStreamEncoder
513 // will apply downscaling if necessary. requested_resolution will also be
514 // propagated to the video source, this allows downscaling earlier in the
515 // pipeline which can be beneficial if the source is consumed by multiple
516 // encoders, but is not strictly necessary.
517 //
518 // The `requested_resolution` is subject to resource adaptation.
519 //
520 // It is an error to set both `requested_resolution` and
521 // `scale_resolution_down_by`.
522 absl::optional<Resolution> requested_resolution;
523
Seth Hampsona881ac02018-02-12 14:14:39 -0800524 // For an RtpSender, set to true to cause this encoding to be encoded and
525 // sent, and false for it not to be encoded and sent. This allows control
526 // across multiple encodings of a sender for turning simulcast layers on and
527 // off.
528 // TODO(webrtc.bugs.org/8807): Updating this parameter will trigger an encoder
529 // reset, but this isn't necessarily required.
deadbeefdbe2b872016-03-22 15:42:00 -0700530 bool active = true;
deadbeefe702b302017-02-04 12:09:01 -0800531
532 // Value to use for RID RTP header extension.
533 // Called "encodingId" in ORTC.
deadbeefe702b302017-02-04 12:09:01 -0800534 std::string rid;
535
Jakob Ivarsson39adce12020-06-25 14:09:58 +0200536 // Allow dynamic frame length changes for audio:
537 // https://w3c.github.io/webrtc-extensions/#dom-rtcrtpencodingparameters-adaptiveptime
538 bool adaptive_ptime = false;
539
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700540 bool operator==(const RtpEncodingParameters& o) const {
Florent Castellia8c2f512019-11-28 15:48:24 +0100541 return ssrc == o.ssrc && bitrate_priority == o.bitrate_priority &&
542 network_priority == o.network_priority &&
Seth Hampson24722b32017-12-22 09:36:42 -0800543 max_bitrate_bps == o.max_bitrate_bps &&
Åsa Persson8c1bf952018-09-13 10:42:19 +0200544 min_bitrate_bps == o.min_bitrate_bps &&
deadbeefe702b302017-02-04 12:09:01 -0800545 max_framerate == o.max_framerate &&
Åsa Persson23eba222018-10-02 14:47:06 +0200546 num_temporal_layers == o.num_temporal_layers &&
deadbeefe702b302017-02-04 12:09:01 -0800547 scale_resolution_down_by == o.scale_resolution_down_by &&
Jakob Ivarsson39adce12020-06-25 14:09:58 +0200548 active == o.active && rid == o.rid &&
Jonas Oreland0deda152022-09-23 12:08:57 +0200549 adaptive_ptime == o.adaptive_ptime &&
550 requested_resolution == o.requested_resolution;
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700551 }
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -0700552 bool operator!=(const RtpEncodingParameters& o) const {
553 return !(*this == o);
554 }
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700555};
556
Mirko Bonadei35214fc2019-09-23 14:54:28 +0200557struct RTC_EXPORT RtpCodecParameters {
Stefan Holmer1acbd682017-09-01 15:29:28 +0200558 RtpCodecParameters();
Mirko Bonadei2ffed6d2018-07-20 11:09:32 +0200559 RtpCodecParameters(const RtpCodecParameters&);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200560 ~RtpCodecParameters();
561
Artem Titov0e61fdd2021-07-25 21:50:14 +0200562 // Build MIME "type/subtype" string from `name` and `kind`.
deadbeefe702b302017-02-04 12:09:01 -0800563 std::string mime_type() const { return MediaTypeToString(kind) + "/" + name; }
564
565 // Used to identify the codec. Equivalent to MIME subtype.
566 std::string name;
567
568 // The media type of this codec. Equivalent to MIME top-level type.
569 cricket::MediaType kind = cricket::MEDIA_TYPE_AUDIO;
570
571 // Payload type used to identify this codec in RTP packets.
deadbeefe814a0d2017-02-25 18:15:09 -0800572 // This must always be present, and must be unique across all codecs using
deadbeefe702b302017-02-04 12:09:01 -0800573 // the same transport.
574 int payload_type = 0;
575
576 // If unset, the implementation default is used.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200577 absl::optional<int> clock_rate;
deadbeefe702b302017-02-04 12:09:01 -0800578
579 // The number of audio channels used. Unset for video codecs. If unset for
580 // audio, the implementation default is used.
deadbeefe814a0d2017-02-25 18:15:09 -0800581 // TODO(deadbeef): The "implementation default" part isn't fully implemented.
582 // Only defaults to 1, even though some codecs (such as opus) should really
583 // default to 2.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200584 absl::optional<int> num_channels;
deadbeefe702b302017-02-04 12:09:01 -0800585
586 // The maximum packetization time to be used by an RtpSender.
Artem Titov0e61fdd2021-07-25 21:50:14 +0200587 // If `ptime` is also set, this will be ignored.
deadbeefe702b302017-02-04 12:09:01 -0800588 // TODO(deadbeef): Not implemented.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200589 absl::optional<int> max_ptime;
deadbeefe702b302017-02-04 12:09:01 -0800590
591 // The packetization time to be used by an RtpSender.
592 // If unset, will use any time up to max_ptime.
593 // TODO(deadbeef): Not implemented.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200594 absl::optional<int> ptime;
deadbeefe702b302017-02-04 12:09:01 -0800595
596 // Feedback mechanisms to be used for this codec.
deadbeefe814a0d2017-02-25 18:15:09 -0800597 // TODO(deadbeef): Not implemented with PeerConnection senders/receivers.
deadbeefe702b302017-02-04 12:09:01 -0800598 std::vector<RtcpFeedback> rtcp_feedback;
599
600 // Codec-specific parameters that must be signaled to the remote party.
deadbeefe814a0d2017-02-25 18:15:09 -0800601 //
deadbeefe702b302017-02-04 12:09:01 -0800602 // Corresponds to "a=fmtp" parameters in SDP.
deadbeefe814a0d2017-02-25 18:15:09 -0800603 //
604 // Contrary to ORTC, these parameters are named using all lowercase strings.
Åsa Persson90bc1e12019-05-31 13:29:35 +0200605 // This helps make the mapping to SDP simpler, if an application is using SDP.
606 // Boolean values are represented by the string "1".
Johannes Kron72d69152020-02-10 14:05:55 +0100607 std::map<std::string, std::string> parameters;
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700608
609 bool operator==(const RtpCodecParameters& o) const {
deadbeefe702b302017-02-04 12:09:01 -0800610 return name == o.name && kind == o.kind && payload_type == o.payload_type &&
611 clock_rate == o.clock_rate && num_channels == o.num_channels &&
612 max_ptime == o.max_ptime && ptime == o.ptime &&
613 rtcp_feedback == o.rtcp_feedback && parameters == o.parameters;
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700614 }
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -0700615 bool operator!=(const RtpCodecParameters& o) const { return !(*this == o); }
skvladdc1c62c2016-03-16 19:07:43 -0700616};
617
Åsa Persson90bc1e12019-05-31 13:29:35 +0200618// RtpCapabilities is used to represent the static capabilities of an endpoint.
619// An application can use these capabilities to construct an RtpParameters.
Mirko Bonadei66e76792019-04-02 11:33:59 +0200620struct RTC_EXPORT RtpCapabilities {
Stefan Holmer1acbd682017-09-01 15:29:28 +0200621 RtpCapabilities();
622 ~RtpCapabilities();
623
deadbeefe702b302017-02-04 12:09:01 -0800624 // Supported codecs.
625 std::vector<RtpCodecCapability> codecs;
626
627 // Supported RTP header extensions.
628 std::vector<RtpHeaderExtensionCapability> header_extensions;
629
deadbeefe814a0d2017-02-25 18:15:09 -0800630 // Supported Forward Error Correction (FEC) mechanisms. Note that the RED,
631 // ulpfec and flexfec codecs used by these mechanisms will still appear in
Artem Titov0e61fdd2021-07-25 21:50:14 +0200632 // `codecs`.
deadbeefe702b302017-02-04 12:09:01 -0800633 std::vector<FecMechanism> fec;
634
635 bool operator==(const RtpCapabilities& o) const {
636 return codecs == o.codecs && header_extensions == o.header_extensions &&
637 fec == o.fec;
638 }
639 bool operator!=(const RtpCapabilities& o) const { return !(*this == o); }
640};
641
Florent Castellidacec712018-05-24 16:24:21 +0200642struct RtcpParameters final {
643 RtcpParameters();
Mirko Bonadei2ffed6d2018-07-20 11:09:32 +0200644 RtcpParameters(const RtcpParameters&);
Florent Castellidacec712018-05-24 16:24:21 +0200645 ~RtcpParameters();
646
647 // The SSRC to be used in the "SSRC of packet sender" field. If not set, one
648 // will be chosen by the implementation.
649 // TODO(deadbeef): Not implemented.
Danil Chapovalov0bc58cf2018-06-21 13:32:56 +0200650 absl::optional<uint32_t> ssrc;
Florent Castellidacec712018-05-24 16:24:21 +0200651
652 // The Canonical Name (CNAME) used by RTCP (e.g. in SDES messages).
653 //
654 // If empty in the construction of the RtpTransport, one will be generated by
655 // the implementation, and returned in GetRtcpParameters. Multiple
656 // RtpTransports created by the same OrtcFactory will use the same generated
657 // CNAME.
658 //
659 // If empty when passed into SetParameters, the CNAME simply won't be
660 // modified.
661 std::string cname;
662
663 // Send reduced-size RTCP?
664 bool reduced_size = false;
665
666 // Send RTCP multiplexed on the RTP transport?
667 // Not used with PeerConnection senders/receivers
668 bool mux = true;
669
670 bool operator==(const RtcpParameters& o) const {
671 return ssrc == o.ssrc && cname == o.cname &&
672 reduced_size == o.reduced_size && mux == o.mux;
673 }
674 bool operator!=(const RtcpParameters& o) const { return !(*this == o); }
675};
676
Mirko Bonadeiac194142018-10-22 17:08:37 +0200677struct RTC_EXPORT RtpParameters {
Stefan Holmer1acbd682017-09-01 15:29:28 +0200678 RtpParameters();
Mirko Bonadei2ffed6d2018-07-20 11:09:32 +0200679 RtpParameters(const RtpParameters&);
Stefan Holmer1acbd682017-09-01 15:29:28 +0200680 ~RtpParameters();
681
deadbeefe702b302017-02-04 12:09:01 -0800682 // Used when calling getParameters/setParameters with a PeerConnection
683 // RtpSender, to ensure that outdated parameters are not unintentionally
684 // applied successfully.
deadbeefe702b302017-02-04 12:09:01 -0800685 std::string transaction_id;
686
687 // Value to use for MID RTP header extension.
688 // Called "muxId" in ORTC.
689 // TODO(deadbeef): Not implemented.
690 std::string mid;
691
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700692 std::vector<RtpCodecParameters> codecs;
693
Danil Chapovalovb19eb392019-12-23 17:55:05 +0100694 std::vector<RtpExtension> header_extensions;
deadbeefe702b302017-02-04 12:09:01 -0800695
696 std::vector<RtpEncodingParameters> encodings;
697
Florent Castellidacec712018-05-24 16:24:21 +0200698 // Only available with a Peerconnection RtpSender.
699 // In ORTC, our API includes an additional "RtpTransport"
700 // abstraction on which RTCP parameters are set.
701 RtcpParameters rtcp;
702
Florent Castelli87b3c512018-07-18 16:00:28 +0200703 // When bandwidth is constrained and the RtpSender needs to choose between
704 // degrading resolution or degrading framerate, degradationPreference
705 // indicates which is preferred. Only for video tracks.
Florent Castellib05ca4b2020-03-05 13:39:55 +0100706 absl::optional<DegradationPreference> degradation_preference;
deadbeefe702b302017-02-04 12:09:01 -0800707
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700708 bool operator==(const RtpParameters& o) const {
deadbeefe702b302017-02-04 12:09:01 -0800709 return mid == o.mid && codecs == o.codecs &&
710 header_extensions == o.header_extensions &&
Florent Castellidacec712018-05-24 16:24:21 +0200711 encodings == o.encodings && rtcp == o.rtcp &&
deadbeefe702b302017-02-04 12:09:01 -0800712 degradation_preference == o.degradation_preference;
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -0700713 }
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -0700714 bool operator!=(const RtpParameters& o) const { return !(*this == o); }
skvladdc1c62c2016-03-16 19:07:43 -0700715};
716
717} // namespace webrtc
718
Steve Anton10542f22019-01-11 09:11:00 -0800719#endif // API_RTP_PARAMETERS_H_