131 Commits

Author SHA1 Message Date
Harald Alvestrand
1a72c0ccb9 Move a test from media_session_unittest to codec_vendor_unittest
This test was only testing codec vendor functionality.

Bug: webrtc:360058654
Change-Id: I5763e766a44f6bb1542c4281b1d6c177a52c8c74
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375600
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43811}
2025-01-28 01:44:01 -08:00
Harald Alvestrand
13170bd177 Refactor media_session to move codec handling to new class
The new class "CodecVendor" is intended to handle all logic dealing
with codecs. This CL is a no-behavior-change CL, later CLs will
change the logic.

Bug: webrtc:360058654
Change-Id: I44e76f0e0bd364eeb7d4506f3e01e9e00e2843a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375500
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43806}
2025-01-27 07:52:12 -08:00
Tommi
76c8f303a8 Replace use of .name in test code with .mid()
Bug: webrtc:42233761
Change-Id: Iea64cc3d9831d59f4f937af6f779d99c276b3b8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374664
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43782}
2025-01-21 10:25:53 -08:00
Boris Tsirkin
825379f4dc Format /pc folder
Formatting done via:

git ls-files | grep -E '^pc\/.*\.(h|cc|mm)' | xargs clang-format -i

No-Iwyu: Includes didn't change and it isn't related to formatting
Bug: webrtc:42225392
Change-Id: I3d04503bab53c12927bf408dc63b92cde545b4c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373900
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43689}
2025-01-08 11:55:45 -08:00
Harald Alvestrand
486e3deba0 Expand use of CodecList to cover pc/media_session.cc
This allows us to verify consistency of codec lists in more places.

Bug: webrtc:360058654
Change-Id: Ibd0d10579c4b8058031db0df458e8fc9e2181152
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371921
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43594}
2024-12-18 01:41:51 -08:00
Emil Vardar
78ab1cf39c Enable negotiation of encrypted headers by default.
The negotiation of encrypted header extensions has already been enabled in Chromium, https://chromium-review.googlesource.com/c/chromium/src/+/5933829. Hence, it make sense to enable the encryption of header extensions by default also in webRTC environment so that all the tests run by taking this into considiration when new changes are made.

Bug: webrtc:358039777
Change-Id: I141fac01b0eb0f2ce5a0a365736f0dcf9f21ddcd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43573}
2024-12-16 01:22:18 -08:00
Harald Alvestrand
882b32d00f Reland "Use PayloadTypePicker for video PT assignment"
This reverts commit e046787a5a80a9d292b3aec7e946644e025a2b95.

Reason for revert: Revised codec matching to fix issue.

Changes also back out some changes that should not have been
included (using PayloadTypePicker for codec list merging).

Original change's description:
> Revert "Use PayloadTypePicker for video PT assignment"
>
> This reverts commit e5048949b0fcc275264e24f3b2a4c658fcc84aa3.
>
> Reason for revert: Broke internal tests.
>
> Original change's description:
> > Use PayloadTypePicker for video PT assignment
> >
> > This includes changes that change the order of codecs.
> > It is preparatory to doing late assignment of video PTs.
> >
> > Bug: webrtc:360058654
> > Change-Id: Id5ddaf94d4b9557c0502a373e42635108d8fdf26
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366400
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#43489}
>
> Bug: webrtc:360058654
> Change-Id: I5c94a7bafa49bdf17f665480398707155e458d26
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370240
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43490}

Bug: webrtc:360058654
Change-Id: I66b3b6bd657c66f8860c5e67a504266d7707f48d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370380
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43554}
2024-12-12 16:37:30 -08:00
Harald Alvestrand
e046787a5a Revert "Use PayloadTypePicker for video PT assignment"
This reverts commit e5048949b0fcc275264e24f3b2a4c658fcc84aa3.

Reason for revert: Broke internal tests.

Original change's description:
> Use PayloadTypePicker for video PT assignment
>
> This includes changes that change the order of codecs.
> It is preparatory to doing late assignment of video PTs.
>
> Bug: webrtc:360058654
> Change-Id: Id5ddaf94d4b9557c0502a373e42635108d8fdf26
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366400
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43489}

Bug: webrtc:360058654
Change-Id: I5c94a7bafa49bdf17f665480398707155e458d26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370240
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43490}
2024-12-03 22:24:21 +00:00
Harald Alvestrand
e5048949b0 Use PayloadTypePicker for video PT assignment
This includes changes that change the order of codecs.
It is preparatory to doing late assignment of video PTs.

Bug: webrtc:360058654
Change-Id: Id5ddaf94d4b9557c0502a373e42635108d8fdf26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366400
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43489}
2024-12-03 18:18:28 +00:00
Qiu Jianlin
c596dd5eb6 Fix setCodecPreference issue with asymmetrical send/recv level
For an offer in sendrecv direction, if for example it can send H.265
level 5.2 while receiving 6.0, setCodecPreferences on offerer's transceiver will currently remove H.265 from the offer SDP, since currently we do a precise level match on send_recv_codecs with the codecs from setCodecPreferences.
Update the matching logic to ignore the level when matching.

Bug: chromium:41480904
Change-Id: Id0f89cbf117ce62249a99257dcce18b35f407cb9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/369960
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43477}
2024-12-02 09:41:56 +00:00
Qiu Jianlin
2d47c9395b Correct H.265 level-id in fmtp line for offer/answer.
On a sendrecv m-line, the offered level-id represents the maximum that
can be both sent and received; on a sendonly m-line, the offered
level-id represents the maximum that can be sent; on a recvonly m-line,
the offered level-id represents the maximum that can be received.
Also according to RFC 7798 section 5, the highest level indicated by the
answer is either equal to or lower than that in the offer

Bug: chromium:41480904
Change-Id: I1729c8edc3aed0c00c41cea96204abafc37c002b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367322
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Cr-Commit-Position: refs/heads/main@{#43425}
2024-11-19 13:09:13 +00:00
Björn Terelius
fabe3a1173 Minor cleanup in media_session
- Avoid redundant get() when dereferencing smartpointers
- Use const ref instead of copy for RtpExtension
- Use `.empty()` instead of `.size() == 0`
- Remove some unused using declarations

Bug: None
Change-Id: I0dfdc0dfdf165f153c9ba119c115cd492e9599fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367100
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43334}
2024-10-30 15:15:38 +00:00
Harald Alvestrand
b7abaee819 Revert "Use Payload Type suggester for all codec merging"
This reverts commit 0bac2aae596771db020f01a57fee4828081fbc38.

Reason for revert: Suspected breakages downstream

Original change's description:
> Use Payload Type suggester for all codec merging
>
> Bug: webrtc:360058654
> Change-Id: Id475762253c427c1800c2352a60fc0121c2dc388
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364783
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43267}

Bug: webrtc:360058654, b/375132036
Change-Id: Ieda626270193e7e6c93903b3c03a691b2bf0c1e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366540
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43290}
2024-10-23 11:37:18 +00:00
Harald Alvestrand
0bac2aae59 Use Payload Type suggester for all codec merging
Bug: webrtc:360058654
Change-Id: Id475762253c427c1800c2352a60fc0121c2dc388
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364783
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43267}
2024-10-18 16:58:42 +00:00
Emil Vardar
6099b6481f Improve error message for tests comparing RTP header extensions.
Bug: None
Change-Id: I8d63abb5a2d094f2b36c3d6a1d7cf8d10706ecb7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364960
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Cr-Commit-Position: refs/heads/main@{#43204}
2024-10-09 09:45:25 +00:00
Emil Vardar
fb4311660b Improve SDP negotiation for mixed encrypted/unencrypted offers.
According to RFC 6904 a header extension MAY be offered both encrypted and unecrypted. In the case when encryption is enabled the encrypted version SHOULD be used and vice versa. However, this is under the assumption that both peers actually offer the same extension header both encrypted and unecrypted. With this PR we tighten the negotiation rules to the encryption option SHOULD be the same both in the sender and receiver in order to not drop the extension. Especially, see test `TestOfferAnswerPreferEncryptedRtpHeaderExtensionsWhenEncryptionEnabled` and `TestOfferAnswerPreferEncryptedRtpHeaderExtensionsWhenEncryptionDisabled`.

Bug: chromium:40623740
Change-Id: I68c65a776fcf7be97aaf60a797594c4361a06800
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363940
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43191}
2024-10-08 12:18:07 +00:00
Harald Alvestrand
b3ac753f26 Iteratively fix unit tests to work with late assignment.
A number of unit tests assume that payload types will be assigned
without generating an offer. These are flushed out by running tests
with the --force_fieldtrials=WebRTC-PayloadTypesInTransport argument.

Bug: webrtc:360058654
Change-Id: I17cd5bfa275904a9630068190b1cd246e9ce8741
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362500
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43127}
2024-10-01 13:22:40 +00:00
Emil Vardar
f5a547aa99 Make encrypted versions of RTP extension headers be stopped by default.
By this change we aim to remove the flag enable-webrtc-srtp-encrypted-headers.

Bug: chromium:40623740
Change-Id: I74692c90ff1caf2a11d7b73211c1ae4472edfb4d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362740
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43105}
2024-09-30 09:22:39 +00:00
Harald Alvestrand
d153de6d33 Add payload type assignment to offer/answer generation.
This adds payload types to the codecs at the time when offer
is being generated, if they are unassigned at that point.

Bug: webrtc:360058654
Change-Id: I231ed057ebaf7fb0fffaf6ff5d600b064ba21f5b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362282
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43033}
2024-09-17 12:31:25 +00:00
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Philipp Hancke
4f1dcd9d00 rename shadowing variable "offer" in unit test
BUG=None

Change-Id: I34a17010d5ff02d0b8fad27ad0a69bc0e26b8c13
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360300
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42842}
2024-08-26 05:39:55 +00:00
Philipp Hancke
db519e75b7 Reland "Clean up SRTP helper functions"
This is a reland of commit c47f649e67cdcd27842aa370c693154b67e66116

Original change's description:
> Clean up SRTP helper functions
>
> BUG=None
>
> Change-Id: If1df1828a09aef2e335c028cf4425c9507906aac
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/354649
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Cr-Commit-Position: refs/heads/main@{#42525}

Bug: None
Change-Id: Ib98842407b1c15b4e4b72a3ce2f0833f07f60da6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355540
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42603}
2024-07-08 15:33:47 +00:00
Björn Terelius
e71fa4e8b9 Revert "Clean up SRTP helper functions"
This reverts commit c47f649e67cdcd27842aa370c693154b67e66116.

Reason for revert: Breaks downstream build

Original change's description:
> Clean up SRTP helper functions
>
> BUG=None
>
> Change-Id: If1df1828a09aef2e335c028cf4425c9507906aac
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/354649
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Cr-Commit-Position: refs/heads/main@{#42525}

Bug: None
Change-Id: Iff893decb2be00545b623b72383240926cb0d553
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355481
Auto-Submit: Björn Terelius <terelius@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42529}
2024-06-25 09:58:52 +00:00
Philipp Hancke
c47f649e67 Clean up SRTP helper functions
BUG=None

Change-Id: If1df1828a09aef2e335c028cf4425c9507906aac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/354649
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42525}
2024-06-24 15:34:11 +00:00
Harald Alvestrand
141f4c153f Provide mechanism to make codec decisions per-transceiver
This provides a way to tell the SDP generator to use a specific list
of codecs, rather than trying to compute what list to send.

Preparatory to making codec decisions per-transceiver.

Bug: webrtc:42226302
Change-Id: I1b7d4e55ed7a0546394b74820b4e51434ef86ad9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349620
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#42247}
2024-05-07 14:32:18 +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
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
657b65fa18 Remove special-casing of TWCCv2 negotiation
since it can be enabled locally using the RTP header extensions API

Bug: webrtc:15057
Change-Id: Id15d26ab858d88769939974f2a7ae4327df925b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336720
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41650}
2024-02-01 09:25:36 +00:00
Qiu Jianlin
b3488d08db Add SDP negotiation support for HEVC.
This adds neccessary checks for SDP negotiation with HEVC.

Test: Manually apply the CL on Chromium and enable HEVC HW encoder,
and add HEVC profiles in rtc video decoder/encoder factory, H265 is
negotiated in SDP with correct FMTP lines added.

Bug: webrtc:13485
Change-Id: I5557b20b646cc96c5acb578521204fe10df0dcf0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330202
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jianlin Qiu <jianlin.qiu@intel.com>
Cr-Commit-Position: refs/heads/main@{#41357}
2023-12-12 02:09:11 +00:00
Tony Herre
a5c8ee1672 Revert "Make Codec::Matches also consider packetization"
This reverts commit 1ae700a9233ed647e1b4080c0fcb48f61a0cca0a.

Reason for revert: Potential root cause of crbug.com/1504351

Original change's description:
> Make Codec::Matches also consider packetization
>
> If it's not considered it can lead to payload IDs erroneously being
> reused if the SDP is munged, see https://crbug.com/webrtc/15473#c10.
>
> Bug: webrtc:15473
> Change-Id: I195a06d556e8a57dbeeb946effc4e0f27cc930b0
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326522
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41153}

Bug: webrtc:15473 chromium:1504351
Change-Id: I87fb671d76c3b17beb65124603cc040bb9bf4fa5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329201
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41285}
2023-11-30 14:06:01 +00:00
Philipp Hancke
d0f0f38f72 Remove most usage of MediaContentDescription::as_audio()/as_video()
and unify algorithms a bit more.

BUG=webrtc:15214

Change-Id: Ie9903f3e56d25b1dc026367e8ae6817275faa07b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328442
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@{#41244}
2023-11-27 09:35:39 +00:00
Emil Lundmark
1ae700a923 Make Codec::Matches also consider packetization
If it's not considered it can lead to payload IDs erroneously being
reused if the SDP is munged, see https://crbug.com/webrtc/15473#c10.

Bug: webrtc:15473
Change-Id: I195a06d556e8a57dbeeb946effc4e0f27cc930b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326522
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41153}
2023-11-14 08:14:14 +00:00
Emil Lundmark
f268afd791 Remove unused propagation of field trials in Codec::Matches
Bug: None
Change-Id: I7e56bae37a7fd9f8ca9c3bb8c8f55631a19a1a00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326521
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41152}
2023-11-14 08:14:14 +00:00
Emil Lundmark
7d2e616968 Cleanup media_session_unittest.cc
- Adds namespaces which allows removing redundant using declarations and
  static keywords.
- Adds some new using declarations and make sure they are all fully
  qualified.
- Use std::tuple instead of testing::tuple.

Bug: None
Change-Id: If2ca3c0b94efc8a96da8d2dada0585370e85a7e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326520
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41151}
2023-11-14 08:14:14 +00:00
Philipp Hancke
7fbcc8cef7 Rename PlanB helper function in tests
which is not doing anything specific to plan-b.

BUG=None

Change-Id: Ic214b10a9c3021a8ca93601453d6eb42b84f2d84
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325529
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@{#41082}
2023-11-06 07:08:36 +00:00
Tomas Lundqvist
a26d6ed26f Makes sure that RED is not added twice to the list of codecs when it is used with Opus.
Bug: webrtc:15606
Change-Id: I3ab3ee287f5d2e3a0a46520608e5c0931e0bff90
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325180
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Tomas Lundqvist <tomasl@google.com>
Cr-Commit-Position: refs/heads/main@{#41028}
2023-10-27 15:00:55 +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
Saúl Ibarra Corretgé
4408575d18 Reland "Enable SRTP GCM ciphers by default"
This is a reland of commit d8633868b34dc1d841f0a9fd1afe2bc22aa8bde6

Original change's description:
> Enable SRTP GCM ciphers by default
>
> Bug: webrtc:15178
> Change-Id: I0216ce8f194fffc820723d82b9c04a76573c2f4f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305381
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Victor Boivie <boivie@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40828}

Bug: webrtc:15178
Change-Id: I5ea939ed6263547ebc177d9dd1763ba888936866
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321961
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40862}
2023-10-03 22:39:48 +00:00
Philipp Hancke
012c5a3419 Remove more Codec-related templating in MediaSession
BUG=webrtc:15214

Change-Id: I6b4db5e8ef1523e06fdaaa321f3df10fa19bff86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321841
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40840}
2023-09-29 10:52:27 +00:00
Manashi Sarkar
c2bbe4b952 Revert "Enable SRTP GCM ciphers by default"
This reverts commit d8633868b34dc1d841f0a9fd1afe2bc22aa8bde6.

Reason for revert: Breaks downstream project.

Original change's description:
> Enable SRTP GCM ciphers by default
>
> Bug: webrtc:15178
> Change-Id: I0216ce8f194fffc820723d82b9c04a76573c2f4f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305381
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Victor Boivie <boivie@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#40828}

Bug: webrtc:15178
Change-Id: I88433e899cb4b705eafa3fceff3edc520629f603
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321863
Owners-Override: Artem Titov <titovartem@webrtc.org>
Auto-Submit: Manashi Sarkar <manashi@google.com>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40832}
2023-09-28 14:42:18 +00:00
Saúl Ibarra Corretgé
d8633868b3 Enable SRTP GCM ciphers by default
Bug: webrtc:15178
Change-Id: I0216ce8f194fffc820723d82b9c04a76573c2f4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/305381
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40828}
2023-09-28 10:18:56 +00:00
Philipp Hancke
332c56f087 MediaSession: ensure transport description factory exists
BUG=None

Change-Id: Ic29526c0c182257331d81ff3e66c5ae91ddf4ce1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321186
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@{#40826}
2023-09-28 08:26:05 +00:00
Philipp Hancke
2bf1b99c6d Make CreateOffer/CreateAnswer return RTCErrorOr<SessionDescription>
BUG=webrtc:15499

Change-Id: I8b128fcd9a1114ae4625777a27f074a8314ef190
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320720
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@{#40812}
2023-09-26 09:41:30 +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
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
Florent Castelli
811e24a117 Move functionality from AudioCodec and VideoCodec into cricket::Codec
Part 1 of the migration towards merging the types.
Any method that could belong to the Codec type was moved, the others
are deprecated.
Alternatives to the AudioCodec and VideoCodec constructors are introduced
to allow creating objects of an indefinite type without having to
reference the old classes.

Bug: webrtc:15214
Change-Id: I20e1aa32962821cad98e9a92c2ec86f8f75e5dd8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307220
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40213}
2023-06-02 15:26:46 +00:00
Philipp Hancke
49e5587e64 Integrate RTP Header extension API with SDP munging
in order to not regress existing use-cases while following rules
described by the specification. This change now makes the existing
regression test pass after the spec-compliant modifications.

BUG=chromium:1051821

Change-Id: Ia384adf9a172ed88b5ec6a3cc5c478764a686cb9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299002
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@{#39726}
2023-03-31 10:08:39 +00:00
Philipp Hancke
b396e2b159 Revert "Only serialize non-stopped RTP header extensions"
This reverts commit be03c0971863c9e6807fcbdb4175754e8242a652.
Causes regression in web projects that
1/ add a stopped-by-default extension in SRD
2/ call createAnswer
3/ munge the stopped-by-default extension back in SLD
4/ create a subsequent offer and expect the extension to be present

BUG=chromium:1051821

Change-Id: If77f77c2c0ac19625f502fb8a07facd151475807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298744
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39655}
2023-03-23 14:06:30 +00:00
Philipp Hancke
be03c09718 Only serialize non-stopped RTP header extensions
as described in https://w3c.github.io/webrtc-extensions/#modifications-to-existing-procedures-0
 "For each RTP header extension "e" listed in
 [[HeaderExtensionsToOffer]] where direction is not "stopped", an
 "a=extmap" line, as specified in [RFC5285], section 5

This avoids including them in case they are stopped on one
transceiver but not the other. Also, this allows extensions to
be removed from a subsequent offer.

See also
  https://github.com/w3c/webrtc-extensions/issues/140

BUG=chromium:1051821

Change-Id: I4d7462f939ce4cd5d8c2331bc038200fe18f70e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291703
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39242}
2023-02-01 12:37:44 +00:00
Philipp Hancke
2f3168ff38 peerconnection: reject content if there are no common media codecs
for video dealing with both the case where there is no common media
codec as well as only a red/ulpfec/flexfec codec in common for video
and only RED/CN in common for audio

BUG=webrtc:4957,webrtc:14069

Change-Id: I1c888b4f77199aade8122051c31b690dc2fd5925
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262642
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36920}
2022-05-18 09:00:00 +00:00