52 Commits

Author SHA1 Message Date
Philipp Hancke
ff0256e8b6 Add unit test for "locking in" PTs offered by remote in subsequent O/A
C++ version of
  https://jsfiddle.net/fippo/ypj6mshr/3/

BUG=webrtc:360058654

Change-Id: Ieb6a149601093cafae337213d3e2b3b0bfc77831
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/377322
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@{#43904}
2025-02-17 06:37:07 -08:00
Henrik Boström
736f58f35f Test that follow-up offer respects prior PT assignment.
Using parameterized testing, ensure that every possible payload type
that can be negotiated via remote O/A continues to show up in the local
follow-up offer in a subsequent O/A exchange.

This was an attempt to reproduce https://crbug.com/395077842, however
we pass all combinations.

Bug: chromium:395077842
Change-Id: Id4fd6f07a0870c8cd80ff7cf419e21fd6e2dbade
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376862
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43876}
2025-02-12 02:29:30 -08:00
Philipp Hancke
f68df0b95c Restore primary/rtx payload type assignment logic
Changes the order of payload type assignment to keep the rtx_pt =
primary_pt+1 pattern (even if not required by the specification)

On https://webrtc.github.io/samples/src/content/peerconnection/pc1/ this
changes PTs as follows:

M132: m=video 9 UDP/TLS/RTP/SAVPF 96 97 102 103
104 105 106 107 108 109 127 125 39 40 45 46 98 99 100 101 112 113 114
(121 more lines) mid=1

M134: m=video 9 UDP/TLS/RTP/SAVPF 96 109 99 118 100 119 101 120 103 121
104 122 37 123 40 127 97 114 98 115 107 44 108 (121 more lines) mid=1

M134 with this patch: m=video 9 UDP/TLS/RTP/SAVPF 96 97 107 108 109 114
115 116 117 118 119 120 37 121 40 124 98 99 100 101 127 42 43 (121 more
lines) mid=1

Note that this pushes red and ulpfec into lower range but those codecs
are not widely used and it is possible to get them back into the upper
range e.g. by using setCodecPreferences to disable H264 (where ulpfec is
not supported)

BUG=chromium:391132280

Change-Id: I892f00a2f276728d16c37e8ba5f76d01f6322a7d
No-Iwyu: single include missing, keep it more merge-able
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/375847
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43833}
2025-01-31 06:41:50 -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
Evan Shrubsole
fa73a2ed79 Convert timeouts in integration_test_helpers to TimeDelta
Bug: webrtc:42223979
Change-Id: Ia77b34c5c30a32fcb520359b993ff0b976be378c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374880
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43771}
2025-01-20 02:58:26 -08:00
Evan Shrubsole
2a858e21f6 Migrate last uses of gunit.h macros
Bug: webrtc:381524905
Change-Id: I9bf00a61dfcc00355e81fea34625119ef3ac61b6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43769}
2025-01-20 02:06:48 -08:00
Philipp Hancke
cfaba8fd2d Measure SDP munging
by storing
  [[LastCreatedOffer]] / [[LastCreatedAnswer]]
which are similar to the W3C equivalent but as
description objects instead of serialized SDP strings.

While rejecting all SDP munging is not feasible, this lets us
measure and reject certain modifications gradually.

Chromium metrics CL:
  https://chromium-review.googlesource.com/c/chromium/src/+/6089633

This is measured at three points during the lifetime of a peerconnection:
* for the first SLD call
* when the connection is first established
* when the connection was established and is being closed

Note that the "first" SDP munging detected is returned which may hide that something uses more than one modification.

BUG=chromium:40567530

Change-Id: I964e3ee6e75f73b777d90556fac8691a6f3dc27f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43741}
2025-01-15 07:38:45 -08:00
Danil Chapovalov
acf26ce00a Refactor PC tests to use non-global field trials
In particular that avoids lifetime issues with the field trials passed into peerconnection, as now PC takes field trials object by unique_ptr and thus fully manages its lifetime.

Bug: webrtc:42220378
Change-Id: Ia863e9703b5c76ae1866d0ff995b83286c0b947e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371480
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43576}
2024-12-16 05:29:01 -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
Shigemasa Watanabe
e68cb78ee7 Include pt= in the answer if the simulcast recv offer has pt= in rid.
When the following offer is received,

a=rtpmap:96 VP8/90000
...
a=rtpmap:97 VP9/90000
...
a=rid:r0 recv pt=96
a=rid:r1 recv pt=97

generate the following answer:

a=rtpmap:96 VP8/90000
...
a=rtpmap:97 VP9/90000
...
a=rid:r0 send pt=96
a=rid:r1 send pt=97

Bug: webrtc:362277533
Change-Id: Ibd256d38acb0e2d95ce24e092d27499230d08b13
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362880
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43141}
2024-10-02 12:23:45 +00:00
Shigemasa Watanabe
d2123d9a38 Associate payload_type with rid
When a value is set in RtpEncodingParameters::codec, the corresponding
payload_type will be set in the SDP a=rid: line.

a=rtpmap:96 VP8/90000
...
a=rtpmap:97 VP9/90000
...
a=rid:r0 send pt=96
a=rid:r1 send pt=97

Bug: webrtc:362277533
Change-Id: Ia9688a5fc83c53cf46621d97e87f8dd363a4d7f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361240
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43049}
2024-09-19 10:18:13 +00:00
Philipp Hancke
635d365d49 deflake rtcp-rsize test in TSAN
which is showing up too often in
  https://ci.chromium.org/ui/p/webrtc/builders/try/linux_tsan2
The actual failure seems to be around ice candidate destructors and what
makes this test special is that it accessed local_description() which is now avoided. MsidSignalingInSubsequentOfferAnswer shows a similar usage but seems much less flaky.

BUG=webrtc:340041654

Change-Id: Iba1369c62918c56b0904724f28109a7308cefee3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351565
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42384}
2024-05-27 12:51:11 +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
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
Philipp Hancke
89679bfd02 sdp: document existing mid backfill cornercases
mids get backfilled starting with 0 which means they are always
present in the answer (even though JSEP says otherwise) and may
even be backfilled in a manner compatible with their usage in a
BUNDLE group. Those cases are ok-ish but should be documented by
tests.

BUG=None

Change-Id: I69f0475c279da5022109a56f0006169dbc2de147
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349380
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42234}
2024-05-06 16:38:37 +00:00
Florent Castelli
f4673f97ed Move webrtc::AudioDeviceModule include to api/ folder
Bug: webrtc:15874
Change-Id: I5bdb19d5e710838b41e6ca283d406c9f1f21286b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348060
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42137}
2024-04-22 08:56:31 +00:00
Florent Castelli
0afde7614d Move webrtc::AudioProcessing include to api/ folder
Bug: webrtc:15874
Change-Id: Ie8a6e031c0f0505cfe238f7d252c47e9c34408d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347983
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42128}
2024-04-20 07:02:50 +00:00
Philipp Hancke
51532fd355 Test handling of rejected m-lines without transport description
adds a unit test for
  https://webrtc-review.googlesource.com/c/src/+/340322
which is a single m-line variant of the original
fiddle that does not require renegotiation

BUG=chromium:326493639

Change-Id: Icc5ebb1dda6502b00828a77e13b9f5fc865d34c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340500
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41818}
2024-02-27 08:28: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
Philipp Hancke
601ac2eea8 Reject offer content with no common codecs
instead of throwing an error when trying to pick a send codec.

BUG=webrtc:15145,webrtc:4957

Change-Id: I056b145c093348576e1aeaf5def50d5414f2de70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330122
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41360}
2023-12-12 10:04:59 +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
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
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
5551776035 Reject attempts to change the media kind for a m-line with a previously used mid
which can happen if the remote end reuses a mid.

BUG=webrtc:15471

Change-Id: I38da7dced712400002bc61d616e481a1255aa896
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319460
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@{#40776}
2023-09-20 12:21:24 +00:00
Philipp Hancke
745641e589 sdp: remove WebRTC-PreventBundleHeaderExtensionIdCollision killswitch
and the associated UMA metrics after rollout in M116 stable.

BUG=webrtc:14782

Change-Id: Ib2e0f96e8aa0c1ffbf48aea30f93195aa8b44bb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317280
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40754}
2023-09-15 12:27:22 +00:00
Philipp Hancke
b64615a194 sdp: reject RTP payload types in the 64-95 range w/rtcp-mux
which is forbidden by
  https://tools.ietf.org/html/rfc5761#section-4

BUG=webrtc:12197

Change-Id: I6227f01e7dcbca3f5871a2e4a8cea3c4db0b16cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319120
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@{#40752}
2023-09-15 09:18:52 +00:00
Philipp Hancke
5ded8ff524 Fix DCHECK crash when processing a remote answer
after the local offer stopped the only transceiver

BUG=None

Change-Id: I563207a26b6f0d8f41e5853521f05215b6a0eb09
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/319520
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40722}
2023-09-08 10:08:30 +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
7cc1ca26c8 Improve ssrc-group validation
disallowing more than one ssrc-group with the same semantic
and primary ssrc.

BUG=chromium:1477075

Change-Id: I4bce0555cd49834725d9b97693d26c971bc5d5c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318822
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40694}
2023-09-05 08:38:52 +00:00
Philipp Hancke
fd7b27ef67 Validate SIM ssrc-group parameters
similar to what is done for FID and FEC-FR but SIM can have more than
one secondary SSRC.

BUG=chromium:1477075

Change-Id: I4c9b4feaa421f53e424fc17bfc9ee2c185c68fb0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318520
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40679}
2023-09-01 12:13:40 +00:00
Philipp Hancke
1f1b0b31e7 sdp: add validation for the number of ssrcs in the ssrc group
for the known standard semantics FID (used by rtx) and
FEC-FR (used byFlexFEC) they should match the expected two SSRCs.
For the nonstandard SIM group this should be limited by the maximum
number of simulcast layers supported.

BUG=chromium:1459124

Change-Id: I7cc2417a3ab207658ec80e8d7e9984c1ae631f53
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315323
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@{#40652}
2023-08-29 11:33:51 +00:00
Philipp Hancke
465bc0fd87 Validate rejected m-lines less strictly
since their content typically is not processed further.

BUG=webrtc:142258

Change-Id: I5bcfb6c3a6f3a301acb497b83f8a4dbc3023c5db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317603
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@{#40649}
2023-08-29 09:42:11 +00:00
Philipp Hancke
2206b63af0 Prevent SDP munging of duplicate SSRCs
BUG=chromium:1459124

Change-Id: Ifa901955b79dc9ff40d198bc367e89a8a535c3e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/311802
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40447}
2023-07-19 19:39:06 +00:00
Philipp Hancke
0776415a41 Generalize stream parameter primary/secondary ssrc checks
to ensure consistency for both FID and FEC-FR ssrc-groups.

BUG=chromium:1454860

Change-Id: I61277e73e0a28f5773260ec62c268bdc8c2cd738
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/309760
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@{#40347}
2023-06-26 14:55:48 +00:00
Philipp Hancke
3488726163 sdp: reject spec simulcast answers without the rid extension
which is mandatory to implement per
  https://datatracker.ietf.org/doc/html/rfc8853#section-5.5

BUG=chromium:1422258

Change-Id: I3639b15453aaa074fbe9f26b722f5997b439224a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306661
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40208}
2023-06-02 12:44:32 +00:00
Philipp Hancke
4bf52387e7 sdp: reject BUNDLE with RTP header extension id collisions
after measurements have shown this is quite rare. Rollout is guarded by
  WebRTC-PreventBundleHeaderExtensionIdCollision
which acts as a killswitch.

BUG=webrtc:14782,chromium:1447758

Change-Id: Ib314c2c8099c05ace761710fdf0e01a77fc89f76
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/306223
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40177}
2023-05-30 10:58:27 +00:00
Philipp Hancke
522380ff73 Attempt to recycle a stopped data m-line before creating a new one
which avoids an infinitely growing SDP if the remote end rejects
the datachannel section. This will reactivate the m-line even if
all datachannels are closed.

BUG=chromium:1442604

Change-Id: If60f93b406271163df692d96102baab701923602
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304241
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@{#40029}
2023-05-09 15:11:24 +00:00
Åsa Persson
0587aaea1a Replace BuiltinVideo{Encoder,Decoder}Factory with Video{Encoder,Decoder}FactoryTemplate.
Bug: webrtc:13573
Change-Id: I69e500f2a18b735396cd00e1ab925243f1a807a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299702
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39744}
2023-04-03 10:44:34 +00:00
Florent Castelli
b3d424cd48 Preserve mid of sections added with AddTrack after a rollback
Since AddTrack now has an implicit init_encodings value, it will also
have a StableState saved when associating a transceiver.
That state may not have a saved mid and mline_index, and so on a
rollback, it could blindly reset the mid and mline_index of an
associated transceiver.

This is wrong, the mid and mline_index of associated transceivers
should only be updated when the StableState objects actually
have one saved.

Bug: chromium:1424238
Change-Id: I8e80a04cd072d90200ca7643de892c0ef29b1f1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/297920
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39577}
2023-03-16 11:17:26 +00:00
Philipp Hancke
a2f5d45b81 Reland "sdp: measure rtp header extension collisions"
This is a reland of commit 6c27d56a2aeb2cff10a216d714552f4970d99d32
avoiding the Fuchsia/C++17 compilation issues.

Original change's description:
> sdp: measure rtp header extension collisions
>
> since extension ids are required to be unique in a BUNDLE group:
>   https://www.rfc-editor.org/rfc/rfc8843#name-rtp-header-extensions-consi
>
> Measure how much enforcing this would break in UMA first.
>
> BUG=webrtc:14782
>
> Change-Id: Ieaf7a436feea677032499e11ca14973eebda322e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288362
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38914}

Bug: webrtc:14782
Change-Id: If9449b0381ebe33ba30eff0d733a1f3c94470d5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288383
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38919}
2022-12-19 15:19:35 +00:00
Andrey Logvin
de57c57e1e Revert "sdp: measure rtp header extension collisions"
This reverts commit 6c27d56a2aeb2cff10a216d714552f4970d99d32.

Reason for revert: Breaks C++ 17 compilation (https://ci.chromium.org/ui/p/webrtc/builders/perf/Fuchsia%20Builder/157/overview). While the proposed fix doesn't seem to be trivial and causes some disagreements: https://webrtc-review.googlesource.com/c/src/+/288460

The bot will be added to CQ.

Original change's description:
> sdp: measure rtp header extension collisions
>
> since extension ids are required to be unique in a BUNDLE group:
>   https://www.rfc-editor.org/rfc/rfc8843#name-rtp-header-extensions-consi
>
> Measure how much enforcing this would break in UMA first.
>
> BUG=webrtc:14782
>
> Change-Id: Ieaf7a436feea677032499e11ca14973eebda322e
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288362
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Johannes Kron <kron@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38914}

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I454acc80ac222395acd640dc9f8bcea941855861
Bug: webrtc:14782
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288382
Commit-Queue: Andrey Logvin <landrey@google.com>
Owners-Override: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Owners-Override: Andrey Logvin <landrey@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#38915}
2022-12-19 09:36:05 +00:00
Philipp Hancke
6c27d56a2a sdp: measure rtp header extension collisions
since extension ids are required to be unique in a BUNDLE group:
  https://www.rfc-editor.org/rfc/rfc8843#name-rtp-header-extensions-consi

Measure how much enforcing this would break in UMA first.

BUG=webrtc:14782

Change-Id: Ieaf7a436feea677032499e11ca14973eebda322e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288362
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38914}
2022-12-17 09:35:53 +00:00
Philipp Hancke
e2652e168a sdp: limit mid attribute to 16 characters
removing the temporary limitation to 32 characters
since metrics suggests this is now fixed.

Metrics removal:
  https://chromium-review.googlesource.com/c/chromium/src/+/4079261

BUG=webrtc:12517,chromium:1375724

Change-Id: I11bec89463044afa99eeef2b3ecbe108eaa5c954
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286620
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38836}
2022-12-07 12:19:33 +00:00
Philipp Hancke
f0ea56a0a2 sdp: measure codec collisions in bundle
as described in
  https://www.rfc-editor.org/rfc/rfc8843#name-payload-type-pt-value-reuse

... all codecs associated with the payload type number MUST share an
identical codec configuration

See also https://github.com/w3c/webrtc-stats/issues/664

Measure how much this would break in UMA first

BUG=webrtc:14420,webrtc:12716

Change-Id: Iafdc70248aa22bc37c15cc88a0c244398cb58176
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273881
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@{#38759}
2022-11-29 14:09:30 +00:00
Niels Möller
83830f316e Delete TestListener and top-level thread wrapping.
Instead use rtc::AutoThread in tests that need that.

Bug: webrtc:9714
Change-Id: I1f33b1b2d321770d062504dd9ef86d66a345dd42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254681
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36950}
2022-05-20 15:21:21 +00:00
Niels Möller
afb246b5a9 Update pc/ to not use implicit conversion from scoped_refptr<T> to T*.
Bug: webrtc:13464
Change-Id: I768646af8ded6338ef51486b8d69db1ad71e9a2c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259500
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36588}
2022-04-20 13:18:33 +00:00
Florent Castelli
72424408ed Remove calls to deprecated CreatePC() and CreateDC()
Anything linking to //third_party/jsoncpp is hiding deprecated usage
warnings, so these were not discovered earlier.

Bug: chromium:983223
Change-Id: Id0ade4ca016f19db16377dbeeb756358a7e94fa2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258124
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36463}
2022-04-06 11:57:50 +00:00