Commit graph

143 commits

Author SHA1 Message Date
Philipp Hancke
4158678b46 Split "helpers" from SSL target to "crypto_random" and rename
since it contains helpers mostly related to cryptographically secure random numbers and strings.

BUG=webrtc:339300437

Change-Id: I10db939534b25dc792ac1600a4721d1b84521880
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352620
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42441}
2024-06-07 06:41:51 +00:00
Harald Alvestrand
c6c6971d97 Break out parsing of FMTP lines so that others can use it
Intended use is to convert between different representations of "codec".

Bug: webrtc:42226302
Change-Id: If6d985ad17c2ff6018c77c7858e602b9eefa9297
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350562
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42319}
2024-05-16 10:22:23 +00:00
Harald Alvestrand
d78e30e00b Deprecate cricket::VideoCodec and cricket::AudioCodec
These are aliases for cricket::Codec.
Also remove internal usage

Bug: b/42225532
Change-Id: I220b95260dc942368cb6280432a058159eec8700
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349321
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42194}
2024-04-29 16:24:51 +00:00
Tomas Gunnarsson
0242939296 Reland "Deprecate old constructors and set_type() in Candidate and Port"
This reverts commit ed8390d21a.

Reason for revert: Fix has landed in chrome, ready to reland.

Original change's description:
> Revert "Deprecate old constructors and set_type() in Candidate and Port"
>
> This reverts commit aaa6851d53.
>
> Reason for revert: breaks chromium webrtc import
>
> Original change's description:
> > Deprecate old constructors and set_type() in Candidate and Port
> >
> > * Deprecates constructors that use string based `type`
> > * Deprecates string based type functions in favor of enum based.
> > * Restrict possible values of Candidate::type. Ensure a valid value
> >   is assigned at construction.
> > * Make Port constructors protected to limit their use to subclasses.
> >   - The reason for this is to make sure that use of SharedSocket()
> >     is controlled (it adds a bit of complexity).
> > * Simplify construction of Port (remove Construct() etc)
> >
> > Bug: webrtc:15846
> > Change-Id: If24ed674e175642efa49da37fd2bc847dd14f613
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339860
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#41865}
>
> Bug: webrtc:15846
> Change-Id: Ic8b7cba97f8fb207ef51a88900e704658ade28b7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342140
> Auto-Submit: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Owners-Override: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#41867}

Bug: webrtc:15846
Change-Id: I3d52643bbb537d1c072643528828d26eb18fea94
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342200
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41875}
2024-03-08 20:39:59 +00:00
Ilya Nikolaevskiy
ed8390d21a Revert "Deprecate old constructors and set_type() in Candidate and Port"
This reverts commit aaa6851d53.

Reason for revert: breaks chromium webrtc import

Original change's description:
> Deprecate old constructors and set_type() in Candidate and Port
>
> * Deprecates constructors that use string based `type`
> * Deprecates string based type functions in favor of enum based.
> * Restrict possible values of Candidate::type. Ensure a valid value
>   is assigned at construction.
> * Make Port constructors protected to limit their use to subclasses.
>   - The reason for this is to make sure that use of SharedSocket()
>     is controlled (it adds a bit of complexity).
> * Simplify construction of Port (remove Construct() etc)
>
> Bug: webrtc:15846
> Change-Id: If24ed674e175642efa49da37fd2bc847dd14f613
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339860
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41865}

Bug: webrtc:15846
Change-Id: Ic8b7cba97f8fb207ef51a88900e704658ade28b7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/342140
Auto-Submit: Ilya Nikolaevskiy <ilnik@webrtc.org>
Owners-Override: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41867}
2024-03-07 09:43:38 +00:00
Tommi
aaa6851d53 Deprecate old constructors and set_type() in Candidate and Port
* Deprecates constructors that use string based `type`
* Deprecates string based type functions in favor of enum based.
* Restrict possible values of Candidate::type. Ensure a valid value
  is assigned at construction.
* Make Port constructors protected to limit their use to subclasses.
  - The reason for this is to make sure that use of SharedSocket()
    is controlled (it adds a bit of complexity).
* Simplify construction of Port (remove Construct() etc)

Bug: webrtc:15846
Change-Id: If24ed674e175642efa49da37fd2bc847dd14f613
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41865}
2024-03-06 18:36:14 +00:00
Tommi
0ba663c245 Change a few uses of Candidate::type() to Candidate::type_name()
Switch to type_name() for things like logging since `type()` will
change to returning an enumeration value.

The functional change that this has is that log statements and
Connection::ToString() (used for logging) will contain "host"
instead of "local" and "srflx" instead of "stun".

Bug: webrtc:15846
Change-Id: I35c50d026e4578a25d51765d59c6f2e01b850c94
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339180
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41757}
2024-02-17 18:41:38 +00:00
Harald Alvestrand
6a8236617d Reject SDP with duplicate msid lines
This is an obscure error that was found by a fuzzer.

Bug: webrtc:15845
Change-Id: I3509fa264a3af6f0f5e8e6b75a8b7dcd8fb0da1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339681
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41743}
2024-02-15 11:06:41 +00:00
Philipp Hancke
7a6a8ebf23 sdp: backfill default codec parameters for H265
with default values for level-id and tx-mode defined in
  https://datatracker.ietf.org/doc/html/draft-aboba-avtcore-hevc-webrtc

BUG=webrtc:15703

Change-Id: I07d77d69c6376313e693e8ddda1cc0135033549a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/338620
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41732}
2024-02-14 11:20:53 +00:00
Harald Alvestrand
974044efca Remove code for supporting SDES
Rework transport_description_factory to only have non-DTLS mode for
testing, and rewrite tests accordingly.

Bug: webrtc:11066, chromium:804275
Change-Id: Ie7d477c4331c975e4e0a3034fbbb749ed9009446
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336880
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41697}
2024-02-08 14:34:04 +00:00
Philipp Hancke
c1cc6a36b2 sdp: backfill default codec parameters for AV1
as required by
  https://aomediacodec.github.io/av1-rtp-spec/#72-sdp-parameters
Also unify usage of profile fmtp parameter. Most notably this causes
SDP answers to include the default values.

These default values correspond to libaom's default values for AV1E_SET_TARGET_SEQ_LEVEL_IDX, AV1E_SET_TIER_MASK as used in
https://source.chromium.org/chromium/chromium/src/+/main:third_party/libaom/source/libaom/aom/aomcx.h
and g_profile in aom_codec_enc_cfg
https://source.chromium.org/chromium/chromium/src/+/main:third_party/libaom/source/libaom/aom/aom_encoder.h;l=415;drc=b58207f5aecc39db7d3da766e7d171e5d2c3598e

Note: AV1 is inconsistently cased in variable/struct/method/class names. The canonical casing should probably be "Av1" since it is an acronym standing for "AOMedia Video 1".

BUG=webrtc:15703

Change-Id: I11864b7666fea906cd1a0759c7ad45997beab90e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331360
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41654}
2024-02-01 13:11:09 +00:00
Tommi
be2786cd23 Move candidate type preference defaults to the Candidate class
Bug: none
Change-Id: Ibd875230b22e878967bcce7d5e967bc28e0f308e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335380
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41596}
2024-01-22 18:27:38 +00:00
Tommi
0a7fc84887 Use is_* getters when checking the Candidate type
This removes several references across the code base that depended on
the global string constants.

Bug: none
Change-Id: I007bd4b195c35261039f655f1a8f52e632c3691f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335320
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41578}
2024-01-19 15:37:32 +00:00
Philipp Hancke
80a8683e30 sdp: tweak msid signaling further
* changing the defaults to unified-plan,
* expect unified-plan by default
* only include the msid-semantic line in answers when the
offer contained a sign of msid being used

BUG=webrtc:10421

Change-Id: I79364c2dd801d37adea119375e4dc01edf55b3be
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331800
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41480}
2024-01-08 14:03:19 +00:00
Philipp Hancke
de17252e8e Reland "Unify access to SDP codec parameters"
This is a reland of commit 63d03f586b

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I5f8f45688df232eb37b12fa3e56a893a1c754e17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331402
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41467}
2024-01-03 12:03:11 +00:00
Philipp Hancke
6f0f158af0 sdp: make msid support parsing more robust
by also taking into account any a=msid: line in addition to
msid-semantic. Also document issues with msid-semantic generation and unify support determination by removing the msid_supported flag.

BUG=webrtc:10421

Change-Id: Icea554ebd1998f2b526846457029eff6854a772a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329760
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41386}
2023-12-14 14:50:31 +00:00
Mirko Bonadei
6c9c958c69 Revert "Unify access to SDP codec parameters"
This reverts commit 63d03f586b.

Reason for revert: Breaks downstream project (not backwards compatible API change)

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I841735d98533d3b66850b9cfcf7ee0a99ddde078
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331400
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41377}
2023-12-13 16:28:44 +00:00
Philipp Hancke
63d03f586b Unify access to SDP codec parameters
which come from the a=fmtp:<pt> lines in the SDP and were used as either
  std::map<std::string, std:string>
with three aliases,
  cricket::CodecParameterMap
  SdpAudioFormat::Parameters
  SdpVideoFormat::Parameters

Use webrtc::CodecParameterMap in all places.

BUG=None

Change-Id: If47692bde7347834c349c6539b43309d8770e67b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41375}
2023-12-13 14:22:15 +00:00
Philipp Hancke
cdd92da549 sdp: backfill default codec parameters for H264 and VP9
as preparation for H265 work.

BUG=webrtc:15703

Change-Id: Ib6e0afa5ccbb8172a70d4e4eb876639559070fd6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329981
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41350}
2023-12-11 10:48:11 +00:00
Harald Alvestrand
a6544377bc Remove not-needed webrtc:: prefixes in pc/
This test drives the new tools_webrtc/remove_extra_namespace.py tool.

Bug: None
Change-Id: I9b590aa1213e4cace2d64d555f4dafd893f03606
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327021
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41141}
2023-11-13 13:23:04 +00:00
Philipp Hancke
4f4ae8a8f9 Remove templated fmtp SDP helper
and modernize surrounding code.

BUG=webrtc:15214

Change-Id: I2cc9710d4bb4be52469116d7f80ac6ef57116e69
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325186
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41060}
2023-11-01 13:00:21 +00:00
Philipp Hancke
b527699a53 Reduce usage of audio/video codec specifics
BUG=webrtc:15214

Change-Id: I8e68ac149af53529321ab44776c62afe4cc2f61e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324020
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40960}
2023-10-18 11:34:45 +00:00
Philipp Hancke
19fe2437b7 Remove more codec-related templating
BUG=webrtc:15214

Change-Id: Ia597f674e5650dad31796c9a13769fbe873554fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/322122
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40920}
2023-10-12 15:36:42 +00:00
Philipp Hancke
f14dfed72a Move codecs() to MediaContentDescription
allowing for a lot of de-templating

BUG=webrtc:15214

Change-Id: Ibe1a5f5d704564566f24c496822a4308ba23c4dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319160
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40774}
2023-09-20 10:16:36 +00:00
Philipp Hancke
96bc094d38 Rename simulcast SDP serializer
which is not a generic SDP serializer but only deals with the
simulcast SDP.

BUG=None

Change-Id: I6bed6ada28ad5b96f07fd7670ad3d635bd4bc732
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320280
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40761}
2023-09-18 10:09:02 +00:00
Philipp Hancke
7b6faa1243 Move assignment of a streams random-msid
move this a bit later in the process since the current handling will consider two ssrc-lines with a cname in the same RTX FID ssrc-group to be part of separate streams due to the different randomly assigned msids. This leads to a misdetection as plan-b SDP.

BUG=None

Change-Id: Ie8acce9c2c7fb9eabda479b90e8cc7406dcb1696
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318820
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40701}
2023-09-05 11:48:10 +00:00
Philipp Hancke
55b89a8068 Rename cipher_suite to crypto_suite
and replace "cs" in the appropriate places.

This is the terminology used by
https://www.rfc-editor.org/rfc/rfc4568#section-10.3.2.1
and
https://www.iana.org/assignments/sdp-security-descriptions/sdp-security-descriptions.xhtml

BUG=None

Change-Id: I45f2c52eb266c0f94bdd710a9b941142b9411827
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314483
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40502}
2023-08-02 11:45:24 +00:00
Philipp Hancke
8c9e035edb Move codecs() to base MediaDescription
remove some of the templating around the Codec-derived types and
use more modern C++ loops.

BUG=webrtc:15214

Change-Id: I2710628741deca647e7ae88f5966ec7c7f12669a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311260
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40475}
2023-07-26 05:37:51 +00:00
Florent Castelli
d0b8e8e4ee Reland "Merge the codec types"
This is a reland of commit 49ace8b654

Original change's description:
> Merge the codec types
>
> This allows simplifying code in the codebase to be able to remove a lot
> of templated code and special casing for either AudioCodec and VideoCodec.
> Code simplifications will come in later changes.
>
> Bug: webrtc:15214
> Change-Id: I6e75e6ea725163feb6cc4eb49f37b4722d6c6689
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308501
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40276}

Bug: webrtc:15214
Change-Id: I123d1134a212f65cfbc90ecec9013d0aafebd9ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308721
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40294}
2023-06-15 15:53:29 +00:00
Philipp Hancke
6a38a3eb38 sdp: reject duplicate ssrcs in ssrc-groups
while not really covered by
  https://www.rfc-editor.org/rfc/rfc5576.html#section-4.2
and using the same SSRC for RTX and primary payload may work
since payload type demuxing *could* be used is not a good idea.
This also applies to flexfec's FEC-FR.

For the nonstandard SIM ssrc-group duplicates make no sense.
This rejects duplicates for unknown ssrc-groups as well.

BUG=chromium:1454860

Change-Id: I3e86101dbd5d6c4099f2fdb7b4a52d5cd0809c5f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308820
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40292}
2023-06-15 14:24:54 +00:00
Florent Castelli
b7af6b963b Revert "Merge the codec types"
This reverts commit 49ace8b654.

Reason for revert: Breaks downstream projects

Original change's description:
> Merge the codec types
>
> This allows simplifying code in the codebase to be able to remove a lot
> of templated code and special casing for either AudioCodec and VideoCodec.
> Code simplifications will come in later changes.
>
> Bug: webrtc:15214
> Change-Id: I6e75e6ea725163feb6cc4eb49f37b4722d6c6689
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308501
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40276}

Bug: webrtc:15214
Change-Id: I57778cccc3a13eb9f955f6ece054dee0ff5a7e92
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308720
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40278}
2023-06-14 11:43:57 +00:00
Florent Castelli
49ace8b654 Merge the codec types
This allows simplifying code in the codebase to be able to remove a lot
of templated code and special casing for either AudioCodec and VideoCodec.
Code simplifications will come in later changes.

Bug: webrtc:15214
Change-Id: I6e75e6ea725163feb6cc4eb49f37b4722d6c6689
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308501
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40276}
2023-06-14 09:26:04 +00:00
Florent Castelli
8c4b9ea535 Remove references to AudioCodec and VideoCodec constructors
The preferred method to create codecs is to use the function
cricket::CreateAudioCodec or cricketCreateVideoCodec.
Empty codec objects are deprecated and should be replaced
with alternatives such as methods returning an
absl::optional object instead.

Bug: webrtc:15214
Change-Id: I7fe40f64673cd407830dbbb0e541b85a3aee93aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307521
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40226}
2023-06-05 23:23:40 +00:00
Mikhail Pavlov
55c5173220 Revert "sdp: add rtcp-fb:* lines for common feedback"
This reverts commit 815522782a.

Reason for revert: Breaks a downstream project.

The internal investigation is still in-progress.

Original change's description:
> sdp: add rtcp-fb:* lines for common feedback
>
> which potentially allows switching to that pattern in the future.
> Video FEC mechanisms (ulpfec, flexfec-03, RED) that currently
> do not have any feedback parameters but will still be considered "common" and feedback may be sent for them.
>
> For audio this causes rtcp-feedback to be sent for G711 and G722 if negotiated.
>
> BUG=webrtc:14802
>
> Change-Id: I54852d39e176f918d4b36462526ceb40617b8fbe
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290702
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39224}

Bug: webrtc:14802
Change-Id: I4dc3c0c53ad1bc06050c0d73b088303312ac58b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/293020
Owners-Override: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#39296}
2023-02-10 19:42:14 +00:00
Dor Hen
d1831cb4f8 Treat non DTLS/SCTP Protocol Based Data Channels as Unsupported Media
In current state, the SDP parser in webrtc is not backward compatible with clients that might still be using RTP data channels.
Obviously, this isn't there is no such usecase in webrtc since the code is deleted, but in Meta we still use it and would like
to be able to negotiate between clients that offer RTP data channels.
Instead of erroring the parsing procedure, we can parse it as unsupported media in the client that no longer supports RTP data channels.

Replaced the existing test that expects parsing failures with a test that validates that the content was parsed as unsupported media.

Bug: webrtc:14872
Change-Id: I4c105cf55e33b8c19b2849e16148b8175053c40c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291190
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39252}
2023-02-03 06:56:37 +00:00
Philipp Hancke
815522782a sdp: add rtcp-fb:* lines for common feedback
which potentially allows switching to that pattern in the future.
Video FEC mechanisms (ulpfec, flexfec-03, RED) that currently
do not have any feedback parameters but will still be considered "common" and feedback may be sent for them.

For audio this causes rtcp-feedback to be sent for G711 and G722 if negotiated.

BUG=webrtc:14802

Change-Id: I54852d39e176f918d4b36462526ceb40617b8fbe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290702
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39224}
2023-01-30 10:20:50 +00:00
Philipp Hancke
bf0223b3a0 sdp: move serialization of ice, dtls and header extensions to helpers
preparing to put them at session level when max-bundle is set.

Drive-by: move m= serialization to helper.

BUG=None

Change-Id: I04d918ee8eb70c0cc40baf8ebc12054c6b3a2a15
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288820
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38950}
2022-12-23 11:47:42 +00:00
Philipp Hancke
3c529893e0 sdp: ignore duplicate stream ids in msid parsing
https://www.rfc-editor.org/rfc/rfc8830.html#section-3.2.2
says
  Check if a MediaStream with the same WebIDL "id"
  attribute already exists. If not, create it.

Ignoring duplicates here satisfies this and brings the behavior
closer to Firefox:
  https://github.com/w3c/webrtc-pc/issues/2803

Also make tests use a std::string for the sdp input string.

BUG=webrtc:14745

Change-Id: Iccaabc08d865b779416f6ba4d2dfd5cff04133f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286422
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38840}
2022-12-07 18:03:59 +00:00
Philipp Hancke
e093c481bf sdp: parse a=msid:<stream_id> w/o msid-appdata
parse
  a=msid:<stream_id>
since JSEP stipulates sending this syntax as track identifers
have become meaningless. The track id will be set to a random string.

  a=msid:<stream_id> <track_id>
remains supported for backward compability.

BUG=webrtc:14729

Change-Id: I86c073eb97cd613324271125de18a773235fc79d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285783
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38814}
2022-12-05 16:44:54 +00:00
Shaofan Qi
45c882e4be Allow maxptime equal to minptime in the SDP.
The DCHECK crashes debug builds running some applications such as Webex.

Bug: None
Change-Id: I0061286c4c1d04964678a00014896f1fccd4685d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276460
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38644}
2022-11-16 10:54:03 +00:00
Philipp Hancke
c501f30333 sdp: temporarily relax channel requirements for statically assigned payload types
to allow for downstream users to upgrade.

BUG=chromium:1338902

Change-Id: Ie1205ad2c9c1be3f4ed8e133b1a5e54afd04ebd9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268193
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37501}
2022-07-11 14:32:55 +00:00
Philipp Hancke
62c20f305e sdp: temporarily relax clockrate requirements for statically assigned payload types
to allow for downstream users to upgrade.

BUG=chromium:1338902

Change-Id: If6b56ab63f7859c13e9ebc70326e1088e5dfff1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268141
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37475}
2022-07-07 09:49:54 +00:00
Harald Alvestrand
1c5808145e Ignore RID that appears without an a=simulcast entry
RID is defined for multiple usages in RFC 8851, but we only support
usage with a=simulcast as specified in RFC 8853.

Bug: chromium:1341043
Change-Id: Ie72074c5b394bdc41865938a86ec9c7629e1f5e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267628
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37417}
2022-07-04 11:04:12 +00:00
Andrey Logvin
1d848e1c2e Reland "pc: make codec comparison for static codecs case-insensitive"
This reverts commit e130f29aaa.

Reason for revert: Reland as the downstream project error turned out to be unrelated to the CL

Original change's description:
> Revert "pc: make codec comparison for static codecs case-insensitive"
>
> This reverts commit dcc3d046e2.
>
> Reason for revert: Speculative revert. Presumably breaks downstream project
>
> Original change's description:
> > pc: make codec comparison for static codecs case-insensitive
> >
> > BUG=webrtc:14211,webrtc:14140
> >
> > Change-Id: Ib51de4c8961a4cf7c71aea27a55c115613296aae
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266371
> > Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#37295}
>
> Bug: webrtc:14211,webrtc:14140
> Change-Id: Iead89fc597a634fe24a3d0e0f65f60215b62262d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266483
> Owners-Override: Andrey Logvin <landrey@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Andrey Logvin <landrey@webrtc.org>
> Commit-Queue: Andrey Logvin <landrey@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37300}

Bug: webrtc:14211,webrtc:14140
Change-Id: I74d4c1099182612d26b34ca983054688c7e67c42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266484
Auto-Submit: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37304}
2022-06-22 11:56:51 +00:00
Andrey Logvin
e130f29aaa Revert "pc: make codec comparison for static codecs case-insensitive"
This reverts commit dcc3d046e2.

Reason for revert: Speculative revert. Presumably breaks downstream project

Original change's description:
> pc: make codec comparison for static codecs case-insensitive
>
> BUG=webrtc:14211,webrtc:14140
>
> Change-Id: Ib51de4c8961a4cf7c71aea27a55c115613296aae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266371
> Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37295}

Bug: webrtc:14211,webrtc:14140
Change-Id: Iead89fc597a634fe24a3d0e0f65f60215b62262d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266483
Owners-Override: Andrey Logvin <landrey@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37300}
2022-06-22 08:46:21 +00:00
Philipp Hancke
dcc3d046e2 pc: make codec comparison for static codecs case-insensitive
BUG=webrtc:14211,webrtc:14140

Change-Id: Ib51de4c8961a4cf7c71aea27a55c115613296aae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266371
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37295}
2022-06-22 04:16:52 +00:00
Niels Möller
f1d822b03b Delete variant of rtc::split that copies the output fields
Bug: webrtc:13579
Change-Id: I065a32704d48d5eed21aee0e9757cac9ecf7aa99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261951
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ali Tofigh <alito@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37160}
2022-06-09 08:29:33 +00:00
Philipp Hancke
32c60b84c3 Reland "sdp: reject duplicate codecs with the same id but different name or clockrate"
This is a reland of commit ad6807805d

Original change's description:
> sdp: reject duplicate codecs with the same id but different name or clockrate
>
> since something like
>   rtpmap:96 VP8/90000
>   rtpmap:96 VP9/90000
> or
>   rtpmap:97 ISAC/32000
>   rtpmap:97 ISAC/16000
> is wrong. Note that fmtp or rtcp-fb are not taken into account.
> Also note that sending invalid static payload types now throws an error.
>
> Drive-by: replace "RtpMap" with "Rtpmap" for consistency.
>
> BUG=None
>
> Change-Id: I2574b82a6f1a0afe3edc866e514a5dbca0798e8c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263641
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
> Cr-Commit-Position: refs/heads/main@{#37028}

Bug: webrtc:14140
Change-Id: I63a37aacea6b9e0a9d7570b8422849275eb69aae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264544
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37066}
2022-05-31 16:09:17 +00:00
Henrik Boström
874517b5f5 Revert "sdp: reject duplicate codecs with the same id but different name or clockrate"
This reverts commit ad6807805d.

Reason for revert: Speculative revert due to consistent Mac browser
test failures preventing WebRTC from rolling int Chromium:
https://ci.chromium.org/ui/p/chromium/builders/webrtc.fyi/WebRTC%20Chromium%20FYI%20Mac%20Tester/10410/overview

"Failed to parse SessionDescription. a=rtpmap:103 ISAC/16000 Duplicate payload type with conflicting codec name, clock rate or number of channels."

Original change's description:
> sdp: reject duplicate codecs with the same id but different name or clockrate
>
> since something like
>   rtpmap:96 VP8/90000
>   rtpmap:96 VP9/90000
> or
>   rtpmap:97 ISAC/32000
>   rtpmap:97 ISAC/16000
> is wrong. Note that fmtp or rtcp-fb are not taken into account.
> Also note that sending invalid static payload types now throws an error.
>
> Drive-by: replace "RtpMap" with "Rtpmap" for consistency.
>
> BUG=None
>
> Change-Id: I2574b82a6f1a0afe3edc866e514a5dbca0798e8c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263641
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
> Cr-Commit-Position: refs/heads/main@{#37028}

Bug: None
Change-Id: Ic9c06c9309bb68bd94bfdd2e30ffd6ff96f6812b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264540
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Christoffer Jansson <jansson@webrtc.org>
Reviewed-by: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37064}
2022-05-31 13:31:56 +00:00
Philipp Hancke
ad6807805d sdp: reject duplicate codecs with the same id but different name or clockrate
since something like
  rtpmap:96 VP8/90000
  rtpmap:96 VP9/90000
or
  rtpmap:97 ISAC/32000
  rtpmap:97 ISAC/16000
is wrong. Note that fmtp or rtcp-fb are not taken into account.
Also note that sending invalid static payload types now throws an error.

Drive-by: replace "RtpMap" with "Rtpmap" for consistency.

BUG=None

Change-Id: I2574b82a6f1a0afe3edc866e514a5dbca0798e8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263641
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37028}
2022-05-30 08:16:25 +00:00