178 Commits

Author SHA1 Message Date
Philipp Hancke
e828c6dba3 red: remove hardcoded parameters in favor of taking them from the codec
and make it less opus-specific.

BUG=None

Change-Id: I6fe2975ba6e45a3758fedc5b950de90e8d9df362
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375436
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43846}
2025-02-04 10:28:30 -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
a70cc7886c Make mid_ a private member variable
Bug: webrtc:42233761
Change-Id: I17458a5b8c2d1999b40e4272dd51502ca6099219
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374665
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43791}
2025-01-23 00:53:11 -08:00
Fabian Reddig
a85040ffd9 Revert "Reland "Use Payload Type suggester for all codec merging""
This reverts commit f5d13267aee114aa60e9718fc6f5032c8a5450f3.

Reason for revert: Caused downstream test failures

Original change's description:
> Reland "Use Payload Type suggester for all codec merging"
>
> This reverts commit b7abaee819771ca297bac4c51ec0daf62bd9a3fc.
>
> Reason for revert: Suspicion that suspected breakage wasn't real
>
> Original change's description:
> > 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}
>
> Bug: webrtc:360058654, b/375132036
> Change-Id: Id6e72f7aac81023da43de7627c24dd1a792ea461
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374304
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#43739}

Bug: webrtc:360058654, b/375132036
Change-Id: I3fb302d6ddb7d9e4b0acc3eefdac74edf55ca01a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374700
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43763}
2025-01-17 23:49:26 -08:00
Harald Alvestrand
f5d13267ae Reland "Use Payload Type suggester for all codec merging"
This reverts commit b7abaee819771ca297bac4c51ec0daf62bd9a3fc.

Reason for revert: Suspicion that suspected breakage wasn't real

Original change's description:
> 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}

Bug: webrtc:360058654, b/375132036
Change-Id: Id6e72f7aac81023da43de7627c24dd1a792ea461
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374304
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43739}
2025-01-15 02:17:56 -08:00
Philipp Hancke
da8a535ad4 Fix RTX/sCP behavior
which was not filtering RTX when it was removed from the codec preferences but RED was still there.

BUG=chromium:387077342

Change-Id: I7d14e8361c6405298b71718665194f2622e21501
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373661
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43723}
2025-01-13 09:09:28 -08:00
Harald Alvestrand
33f38f2f38 Add some tests for CodecList consistency
Bug: webrtc:360058654
Change-Id: Ida26eca237c4f882cf03204a3d87780c25c1890c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371640
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43604}
2024-12-18 17:34:32 -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
Harald Alvestrand
611d7f610c Introduce the CodecList class
Lists of codecs have a lot of cross references (RTX/APT and the like).
We should introduce functionality to verify that those linkages are correct
before modifying the handling of these.

This CL introduces the CodecList class, which can be extended to do
that verification. It is used by pc/media_session.cc, but inter-module
APIs are not changed in this version (they will be later).

Bug: webrtc:360058654
Change-Id: Ifd6313d0289cfa090e51ac28bc775265d18fe6f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371600
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43582}
2024-12-16 14:15:21 -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
Harald Alvestrand
2e7e049bb4 Don't use transport-cc if RFC8888 feedback is negotiated.
Bug: webrtc:378698658
Change-Id: I06536445d32577b7b4d24ae7ca529d9b270b34d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368863
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43435}
2024-11-21 18:15:05 +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
Harald Alvestrand
9317a307e1 Add generation of CCFB in answer (RFC8888 support)
Note: This still doesn't enable CCFB - it just completes the signalling.

Bug: webrtc:42225697
Change-Id: I2dfd346075f2adcc438588f592c8f735f4101c89
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367260
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43348}
2024-11-01 15:01:29 +00:00
Harald Alvestrand
a25c1c061c Add generation of CCFB in offer (RFC8888 support)
Bug: webrtc:42225697
Change-Id: I288a808c4aae852212b09fdf9551e20fe3066e39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367205
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43341}
2024-10-31 21:15:48 +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
Harald Alvestrand
19bbd6f02f Move some codec-comparing functions to a single file.
This CL is a pure move; later CLs will try to increase consistency
between the functions.

Bug: webrtc:360058654
Change-Id: I6662b3d35f8e2dab60c2778a4755454fe3029fe2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365100
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43210}
2024-10-09 22:10:36 +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
62b245c64f Modify codec matching to handle RED so that test pass.
Bug: webrtc:360058654
Change-Id: I9e31a75691fe7fca51d888b898ea7d6dc047a559
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364562
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43167}
2024-10-03 14:32:13 +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
59ba4ef4b5 Simplify MergeRtpHdrExts function.
Based on https://webrtc-review.googlesource.com/c/src/+/362740 we can now simplify the MergeRtpHdrExts since there is no longer need to keep track of the `regular_extensions` and `encrypted_extensions` separately.

Bug: chromium:40623740
Change-Id: Iff94931e87a7b9301ac58d4c5c2c975b9f9fe57a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/363880
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Emil Vardar (xWF) <vardar@google.com>
Cr-Commit-Position: refs/heads/main@{#43107}
2024-09-30 14:07:42 +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
Bjorn Terelius
1766a3dbce Treat negative SCTP message size limit as maximal (only bounded by buffer size)
Bug: webrtc:350362794
Change-Id: Ie80e89a1359fbe7229452e59715b66e951a2592b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357240
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42641}
2024-07-16 09:21:06 +00:00
Philipp Hancke
bad99ab253 RTCP: implement reduced size RTCP for audio
reduced-size RTCP, i.e. not prefixing RTCP packets with either a sender report or receiver report has been implemented for a long time but only for video.

This CL adds it for audio as well. This reduces the size of audio NACKs (16 bytes, typically one NACK per packet) sent by not prefixing it with a receiver report (32 bytes).
Other packets are not affected as e.g. transport-cc feedback does not add a RR even though that is technically required.

The effect on NACK can be tested by running Chromium with
  --disable-webrtc-encryption --force-fieldtrials=WebRTC-FakeNetworkReceiveConfig/loss_percent:5/
against this fiddle negotiating audio nack:
https://jsfiddle.net/fippo/8ubtLnfx/1/

BUG=webrtc:340041654

Change-Id: I06fb94742ff1b6f9a464c404bfc53913f23498d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350269
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42330}
2024-05-16 18:24:10 +00:00
Harald Alvestrand
f42d2b9ab5 Include-what-you-use pc/media_session
Bug: webrtc:42226242
Change-Id: I25743717d1f0e7a0305589139bd386353b4e5054
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350122
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42262}
2024-05-08 15:07:53 +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
Philipp Hancke
3f10f65713 sdp: answer with spec msid when msid support is unknown
this removes the reliance on the no-longer-spec a=msid-semantic lines
in case the offer did not signal any msid. Endpoints not supporting
msid should silently ignore the resulting a=msid: line. This also changes behavior such that a "legacy" offer without msid-semantic
line will be responded to with both msid-semantic and msid for any tracks present.
Plan-B ssrc-specific msid attributes are not signalled in that case.

See https://datatracker.ietf.org/doc/html/rfc8829#section-5.3.1
which includes it in the answer depending on the transceiver direction
but not if and only if the offer signalled a msid.

This also avoids recreating the stream and changing the SSRC
which could happen if the answer object was serialized to SDP
(which most unit tests do not do)

BUG=chromium:328522463

Change-Id: Id2f890b7756721d7c50460359950826d392483ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346741
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42237}
2024-05-06 19:20:48 +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
Philipp Hancke
20a90295fc sdp: set content to rejected if the list of common codecs is empty
which avoids throwing an error when using setCodecPreferences
to set a recvonly codec on a sendonly transceiver. See
  https://github.com/w3c/webrtc-pc/issues/2936

BUG=webrtc:15396

Change-Id: I435a98c944ed2eeef87d9b8a7f791d095ec25502
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/338642
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@{#41843}
2024-02-29 08:02:26 +00:00
Philipp Hancke
845d6bef52 Fix handling of rejected m-lines without transport description
A fingerprint should not be required for m-lines which are rejected.

BUG=chromium:326493639,webrtc:11066

Change-Id: I7428c91a144ca46650e13d72868f160652a98339
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340322
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@{#41794}
2024-02-23 14:49:17 +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
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
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
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
Philipp Hancke
0322493aed Refactor MediaSession to unify audio/video codec handling
since the offer/answer rules do not depend on the media type for
the most part. Also make use of recently introduced Codec types.

BUG=webrtc:15214

Change-Id: Ieae27247a8910c3fcaa9609dca0297985907f86a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327740
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@{#41221}
2023-11-23 14:27:54 +00:00
Philipp Hancke
db1d4281d4 Merge Add(Audio|Video)ContentFor(Offer|Answer)
since the algorithms are the same, the codec-specifics have been
separated out in the previous CL.

Manual rebase of https://webrtc-review.googlesource.com/c/src/+/326101

BUG=webrtc:15214

Change-Id: Ic3effe63f3af2ccc22f326d1685f6f55afa2db52
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327420
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41181}
2023-11-17 11:54:11 +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
Philipp Hancke
7946be7429 Refactor audio/video offer/answer creation helpers
BUG=webrtc:15214

Change-Id: I35dcac465221760e54b09bc6c5e4126df4193289
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326141
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41093}
2023-11-07 06:23:26 +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
Philipp Hancke
635061b65e Add test for m-line recycling
which adds test coverage for the offer path.
Removes a DCHECK which is no longer required as the error
is handled in the individual handlers.

BUG=webrtc:15471

Change-Id: I982d517a313cd84574c57974e9d8390a6b78012c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/321840
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@{#40928}
2023-10-13 11:37:22 +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
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
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