2940 Commits

Author SHA1 Message Date
Harald Alvestrand
dc56a36ff8 Use PayloadTypePicker in WebRtcVoiceEngine
This entails passing in a PayloadTypeSuggester as a dependency. PT suggesting is still done according to the old method, but with new code.

Bug: webrtc:360058654
Change-Id: I12a7d2aa6aa482fb62ff3dfb34b9761ebb7dddef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361200
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42989}
2024-09-09 18:44:21 +00:00
Harald Alvestrand
927244db7e Set MID in AudioReceiveChannel
This variable was present but unset.

Bug: webrtc:360058654
Change-Id: I492069a1e87208c6fbb5ad5f0a00fcc2ccc0bc25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361824
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42988}
2024-09-09 17:58:33 +00:00
Florent Castelli
64d68c3984 Add WebRTC-MixedCodecSimulcast field trial
Disable the checks ensuring we reject mixed-codec simulcast
when the field trial is enabled.
The feature is however not yet implemented.

Bug: webrtc:362277533
Change-Id: Ib1601767c951d61aaa37a3d8767d0a81444d626c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361404
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42942}
2024-09-04 08:45:44 +00:00
Harald Alvestrand
c17ca01f54 Move the payload type picker to call/
Since media/ and pc/ both have to use this, and both
depend on call/, this seems to be the right place to put it.

Also factor out the interface that media will use in a separate
interface class.

Bug: webrtc:360058654
Change-Id: I34acbecc618f23e19542ce4b0110d0e8ed9e55ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361281
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42933}
2024-09-03 12:36:50 +00:00
Florent Castelli
c5b9a609ea Propagate environment to RtpSenders
Will be later used to conditionally enable mixed codec simulcast
with a field trial.

Bug: webrtc:42220378
Change-Id: I527a488c04cd2b5a9f4ec703504b67943e966ab0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361403
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42929}
2024-09-03 11:56:22 +00:00
Philipp Hancke
86ac1df5ae Fix libsrtp openssl build
which broke since libsrtp included openssl/srtp.h instead of
its own srtp.h due to the order of include directories

BUG=webrtc:42234521

Change-Id: Idc5cba2114febd1e0835d201b6c23424a88e62d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360705
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42913}
2024-09-02 15:35:10 +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
Per K
b4c1f2f6fc Remove DegradedCall - To be submitted after 2024-07-01
Bug: webrtc:343801362
Change-Id: Icae19ab2f4c87521483d25ae8d44c849c5f8ed2e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353140
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42892}
2024-08-30 08:08:39 +00:00
Jonas Oreland
a49abbb3b6 Extend testing of prAnswer
- Modify munger to take (mutable)
  std::unique_ptr<SessionDescriptionInterface> rather than
  cricket::SessionDescription (that latter is embedded in the former)

- For all pranswer test cases, do a final SetRemoteDescription(kAnswer) and
check that signaling_state == stable

Add new test cases:
1) A test case that only applies it as prAnswer on caller (callee is stable)
2) A test case that "scramble" sdb between prAnswer and Anser.

Bug: None
Change-Id: Ifedd92ade01ae781a2e59d0569133c486c7093fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360781
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42891}
2024-08-30 08:06:47 +00:00
Devon Loehr
058c0059c8 Remove implicit this captures
When declaring a lambda with a value-capture default `[=, ...]`, the
this pointer is implicitly captured by value as well. This results
in potentially-unintuitive behavior and has been deprecated in C++20.
It produces a warning in newer versions of clang
(https://reviews.llvm.org/D142639).

Unfortunately, the preferred C++20 pattern `[=, this, ...]` is not compatible with previous C++ versions. To maintain compatibility with C++14, 17, and 20, this CL modifies all lambdas which capture `this` to explicitly capture all the necessary variables, with no capture-default.

Bug: chromium:351004963
Change-Id: I10c4a9669f340efba75a3e4016f0988a2d606d1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357322
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Devon Loehr <dloehr@google.com>
Cr-Commit-Position: refs/heads/main@{#42886}
2024-08-29 19:30:52 +00:00
Henrik Boström
41fffaa6f4 Fix requested_resolution bug where we get stuck with old restrictions.
Normally (scaleResolutionDownBy) restrictions are applied at the source
which changes the input frame size which triggers reconfiguration with
appropriate scaling factors.

But when requested_resolution is used, encoder settings are by
definition not relative to the input frame size. In order for
restrictions to have an effect, they are applied inside
ReconfigureEncoder(): you get the minimum between the requested
resolution and the restricted resolution.

ReconfigureEncoder() happens when you SetParameters(), but the bug
here is that we don't do it again once the restrictions are updated.
So if restrictions are 540p when you ask for 720p, you get 540p and
after restrictions change to unlimited you're still stuck in 540p.

The fix is to also trigger ReconfigureEncoder() inside
OnVideoSourceRestrictionsUpdated() when the restricted resolution is
changing and a requested_resolution is configured.

To ensure reconfiguring the encoder "on the fly" like this does not
reset initial frame dropping logic, InitialFrameDropper caring about
input frame size changing is made conditional on not using
requested_resolution.

# Slow purple bots failing but they are not affected by this change.
NOTRY=True

Bug: webrtc:361477261
Change-Id: I1389aa16cf408b0d14e0b5b6f68c2442db955be9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360200
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42882}
2024-08-29 12:26:17 +00:00
Per K
b60f0ffbce Dont signal ReadyToSend in RtpTransport::SendPacket
Before this cl, ReadyToSend signaled false if sending a packet failed and transport->GetError() returns ECONN.
ECONN may be reported by the TCP connection (TcpConnection) if the remote closed the connection. TcpConnection will attempt to reconnect and should change the writable state if it fail.
Changing the state in the context of sending packets may cause recursive
calls and seems to cause problems with incorrect states.
It is simpler if RtpTransport::SendPacket ignore these failures and
upper layers treat these lost packets similar to if the packets had been
lost via UDP.
For safety, this change can be reverted by field trial WebRTC-SetReadyToSendFalseIfSendFail/Enabled/.

Bug: webrtc:361124449 b/359989715
Change-Id: I8e7016dfb4301862286215c4512aa8ac03a16685
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360120
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42868}
2024-08-27 14:16:53 +00:00
Harald Alvestrand
90e0829c59 Add test for PR-Answer functionality
Bug: None
Change-Id: I29bf1e40d47361917eb6f52424df23f7697bde0d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360721
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42859}
2024-08-27 08:17:32 +00:00
Philipp Hancke
06a49f02bd build: add options to configure libsrtp for boringssl or other libraries
Depends on
  https://webrtc-review.googlesource.com/c/src/+/359928

BUG=webrtc:42234521,webrtc:42224104

Change-Id: I0d6335aa5fb3f090c781bed234ed34d6c98ec299
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359928
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42857}
2024-08-27 07:17:52 +00:00
Harald Alvestrand
84ce5453ad Reland "Add PT lookup function to JsepTransportController"
This reverts commit 0e3a3266afc50218747134bec7c40f1c6e82ab19.

Reason for revert: Ancestor CL fixed

Original change's description:
> Revert "Add PT lookup function to JsepTransportController"
>
> This reverts commit d178532ff9416f8b4272b9b8622afa9bab2ed558.
>
> Reason for revert: break pw-answer
>
> Original change's description:
> > Add PT lookup function to JsepTransportController
> >
> > Bug: webrtc:360058654
> > Change-Id: I9db58bf872f8659622e9f626fc21ce84993cfdfb
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360143
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Florent Castelli <orphis@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#42829}
>
> Bug: webrtc:360058654
> Change-Id: Ic082dd3e86ed11d05b65710463fa9e57715bf07a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360360
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Jonas Oreland <jonaso@google.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42832}

Bug: webrtc:360058654
Change-Id: Ice9c118f9a5d4e0fa2cff89f504a25b80ec625ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360662
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#42853}
2024-08-26 17:24:15 +00:00
Harald Alvestrand
9e8652853e Reland "Add first iteration of PayloadTypePicker.SuggestPayloadType"
This reverts commit 2e376cd36dc4beb224c2a4b858841a6b46a1c5df.

Reason for revert: Ancestor CL fixed.

Original change's description:
> Revert "Add first iteration of PayloadTypePicker.SuggestPayloadType"
>
> This reverts commit e2869de9efb8633e51815061242fe5eefd43dad7.
>
> Reason for revert: pr-answer
>
> Original change's description:
> > Add first iteration of PayloadTypePicker.SuggestPayloadType
> >
> > Bug: webrtc:360058654
> > Change-Id: I8f9242a97dc871a39ae72f325b8ca039b2285bae
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360061
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Florent Castelli <orphis@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#42828}
>
> Bug: webrtc:360058654
> Change-Id: I3a6b20595aa8420983f692048a8abdb254bf20d8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360343
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Jonas Oreland <jonaso@google.com>
> Cr-Commit-Position: refs/heads/main@{#42833}

Bug: webrtc:360058654
Change-Id: I09c16b50abe85f1423c449190e74b63654158322
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360681
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42849}
2024-08-26 15:47:52 +00:00
Harald Alvestrand
5308652c73 Reland "Add recording of PT->Codec mappings on setting SDP for transport"
This reverts commit 6793f831ffdc598e12aced80a4d97956ca50e436.

Reason for revert: Removed the check that caused the error.

Original change's description:
> Revert "Add recording of PT->Codec mappings on setting SDP for transport"
>
> This reverts commit 15717236c8621cb684bb7753acfedbf34d931c80.
>
> Reason for revert: pr-answer
>
> Original change's description:
> > Add recording of PT->Codec mappings on setting SDP for transport
> >
> > Bug: webrtc:360058654
> > Change-Id: I2aa5e0058346cd3fcda47a8ea5115848fbc4f3e2
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360041
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Florent Castelli <orphis@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#42819}
>
> Bug: webrtc:360058654
> Change-Id: I1fea51b3a0cecfa7e7de75f94f47a85fa064be59
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360380
> Reviewed-by: Jonas Oreland <jonaso@google.com>
> Commit-Queue: Jonas Oreland <jonaso@google.com>
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42835}

Bug: webrtc:360058654
Change-Id: I2b60ccd60df3bacbeecd848c3cb86f6725b1505a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360400
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42847}
2024-08-26 11:11:43 +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
Jonas Oreland
6793f831ff Revert "Add recording of PT->Codec mappings on setting SDP for transport"
This reverts commit 15717236c8621cb684bb7753acfedbf34d931c80.

Reason for revert: pr-answer

Original change's description:
> Add recording of PT->Codec mappings on setting SDP for transport
>
> Bug: webrtc:360058654
> Change-Id: I2aa5e0058346cd3fcda47a8ea5115848fbc4f3e2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360041
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42819}

Bug: webrtc:360058654
Change-Id: I1fea51b3a0cecfa7e7de75f94f47a85fa064be59
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360380
Reviewed-by: Jonas Oreland <jonaso@google.com>
Commit-Queue: Jonas Oreland <jonaso@google.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42835}
2024-08-23 08:56:51 +00:00
Jonas Oreland
2e376cd36d Revert "Add first iteration of PayloadTypePicker.SuggestPayloadType"
This reverts commit e2869de9efb8633e51815061242fe5eefd43dad7.

Reason for revert: pr-answer

Original change's description:
> Add first iteration of PayloadTypePicker.SuggestPayloadType
>
> Bug: webrtc:360058654
> Change-Id: I8f9242a97dc871a39ae72f325b8ca039b2285bae
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360061
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42828}

Bug: webrtc:360058654
Change-Id: I3a6b20595aa8420983f692048a8abdb254bf20d8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360343
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@google.com>
Cr-Commit-Position: refs/heads/main@{#42833}
2024-08-23 07:23:54 +00:00
Jonas Oreland
0e3a3266af Revert "Add PT lookup function to JsepTransportController"
This reverts commit d178532ff9416f8b4272b9b8622afa9bab2ed558.

Reason for revert: break pw-answer

Original change's description:
> Add PT lookup function to JsepTransportController
>
> Bug: webrtc:360058654
> Change-Id: I9db58bf872f8659622e9f626fc21ce84993cfdfb
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360143
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42829}

Bug: webrtc:360058654
Change-Id: Ic082dd3e86ed11d05b65710463fa9e57715bf07a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360360
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jonas Oreland <jonaso@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42832}
2024-08-23 07:02:50 +00:00
Harald Alvestrand
d178532ff9 Add PT lookup function to JsepTransportController
Bug: webrtc:360058654
Change-Id: I9db58bf872f8659622e9f626fc21ce84993cfdfb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360143
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42829}
2024-08-22 12:11:30 +00:00
Harald Alvestrand
e2869de9ef Add first iteration of PayloadTypePicker.SuggestPayloadType
Bug: webrtc:360058654
Change-Id: I8f9242a97dc871a39ae72f325b8ca039b2285bae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360061
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42828}
2024-08-22 11:05:17 +00:00
Henrik Boström
da72666d94 Support standard simulcast with requested_resolution.
According to spec, if you ask for three encodings you get three
encodings (duh). But according to legacy code, if you ask for three
encodings AND codec is VP9, then surely you meant a single encoding that
is kSVC where the other encodings influence the scalability mode of the
first encoding.

Standard simulcast support in VP9 was shipped as an opt-in feature where
you have to specify `scalability_mode` and `scale_resolution_down_by` in
order to let WebRTC know that you want to disable the legacy path.

But `scale_resolution_down_by` is not the only way to configure
resolution, there is also the `requested_resolution` code path. This CL
adds standard simulcast support for this code path as well.

Prior to this change, our parameterized test would have passed in VP8
but failed in VP9. With this change the test passes for all codecs.

Bug: webrtc:361124448
Change-Id: Ic5a7136de8abf430813fd01342862775fca145fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360100
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42822}
2024-08-21 09:35:52 +00:00
Harald Alvestrand
15717236c8 Add recording of PT->Codec mappings on setting SDP for transport
Bug: webrtc:360058654
Change-Id: I2aa5e0058346cd3fcda47a8ea5115848fbc4f3e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360041
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42819}
2024-08-21 09:06:51 +00:00
Harald Alvestrand
f4dd393917 Initial implementation of PayloadTypePicker
Bug: webrtc:360058654
Change-Id: I3183939a32744e9389ae2431cc04f8aa517d7efa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359761
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42805}
2024-08-19 11:39:16 +00:00
Philipp Hancke
13b327b05f srtp: demonstrate wraparound with loss decryption failure
by encryption a packet with sequence number 65535 followed
by a packet with sequence number 1. The second packet is encrypted
with a SRTP ROC of 1 as described in
  https://datatracker.ietf.org/doc/html/rfc3711#section-3.3.1

The packets are (received and) decrypted in a different order,
the packet with sequence number 1 (and ROC=1) is decrypted first.
Since the ROC is maintained locally the decrypting session assumes
it to be 0.

Why is that a problem? The RFC recommends estimating the ROC with +-1 which, as demonstrated by the test, libSRTP does not.
But this is a rare problem that requires a random in a high range combined with packet loss/reordering which turns into no-a-problem if you choose carefully as done by packet_sequencer.cc which restricts the initial sequence number in the range 0..32767 which means you do not run into this issue in production.

See also Q6 in libsrtp's historical documentation at
  https://srtp.sourceforge.net/historical/faq.html

BUG=webrtc:353565743

Change-Id: I9bd72b198c946937aeb25c229005a0c682447f53
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358360
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42798}
2024-08-19 05:17:18 +00:00
Danil Chapovalov
e0fe4200eb Provide Environment to consturct AudioDecoder in tests
Bug: webrtc:356878416
Change-Id: Id2803736d06445b536f2ced02509eaaaf8fd804c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359361
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42792}
2024-08-16 14:34:37 +00:00
Dor Hen
1921fa5ea1 Apply include-cleaner to api/test/[^/]*
e.g all files in the api/test folder not including subdirectories

Bug: webrtc:42226242
Change-Id: I18d74a18f8feec41eb252faa9acfffd1d6f45ce4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Cr-Commit-Position: refs/heads/main@{#42773}
2024-08-13 15:28:34 +00:00
Florent Castelli
0012bfa128 Change DataChannelInit::priority to integer and forward to SCTP transport
The new type PriorityValue is a strong 16-bit integer matching RFC 8831
requirements that can be built from a Priority enum.
The value is now propagated and used by the SCTP transport, but enabling
the feature still requires a field trial for now.

Bug: webrtc:42225365
Change-Id: I56c9f48744c70999a8c2d01415a08a0b6761df4b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357941
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42695}
2024-07-30 15:07:25 +00:00
Tony Herre
5079e8a30a Allow supplying a custom NetworkControllerInterfaceFactory per-Call in PeerConnectionDependencies
This requires making CallConfig move-only so it can hold a unique_ptr to
the factory, but as discussed with Danil, that seems fine.

Bug: chromium:355610792
Change-Id: Ie52e33faaa4a2af748daeb25f5327b7a532936e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357862
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42679}
2024-07-29 07:17:14 +00:00
Björn Terelius
8089959877 Remove private SRTP include
Bug: chromium:40272799
Change-Id: I42a63497aa8321475bd3e2604376c1514ecd623e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357543
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42669}
2024-07-23 17:23:45 +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
Danil Chapovalov
1bb68532dd Remove legacy implementation of AudioEncoderFactory::MakeAudioEncoder in a pc test
All calls in code under test were migrated to AudioEncoderFactory::Create and thus there is no longer need to propagate older function.

Bug: webrtc:343086059
Change-Id: I9e0ea4024759deb22c0d284e0e4bac7322a08f62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357181
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42638}
2024-07-15 11:31:18 +00:00
Tommi
187a4363c0 Remove more sstream deps
Bug: webrtc:8982
Change-Id: I7e1e2a8515b84567d6fe8127ff0e2806a2a4714a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356400
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42610}
2024-07-09 10:30:26 +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
Jeremy Leconte
0471a1963f Fix VP9_Simulcast_SwitchToLegacySvc flakiness.
https://luci-analysis.appspot.com/p/webrtc/clusters/testname-v4/5f33a918de6eb10b2b14ec5f2bd22d3a?tab=recent-failures

Change-Id: I7c8e3b81c25a97e13b328065567712c85942e32d
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356320
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42584}
2024-07-03 13:42:49 +00:00
Tommi
55c3600781 Remove <ostream> dependencies
Some dependencies still exist but are a bit more complex to remove.
This CL removes either unused or easily replaced with ToString()
instances of ostream usage. In one case, moving the operator<<
implementation to the one test file that requires it.

Bug: webrtc:8982
Change-Id: Ia5c840b12a42893494af401317a3daf2fe50ba9b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356240
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42582}
2024-07-03 12:27:55 +00:00
Evan Shrubsole
479e066495 Fix spatial layers to 1 when doing VP9 simulcast encoding
Libvpx works without this, so the existing tests pass. However, other
encoder implementations (like rtc_video_encoder in Chrome) look at
different fields and get confused about the configuration.

Test: Integration tests with Chrome and windows hardware encoders.
Bug: webrtc:348342168
Change-Id: Id0d96cff34eb34c7e019a24255623f3aeeca5772
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355500
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@google.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42555}
2024-06-27 16:23:11 +00:00
Danil Chapovalov
1030eaaffe Provide Environment to create an audio encoder in tests
Bug: webrtc:343086059
Change-Id: I73a48770ae67e529eb5065e957ea6420dea44975
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/354881
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42542}
2024-06-26 12:54:36 +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
Jesús de Vicente Peña
fc6df056b6 Computing and propagating the audio stats totalprocessingdelay.
Bug: webrtc:344347965
Change-Id: Id7dd74ef085338d14582dcc0db98508d365301e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42507}
2024-06-18 08:05:28 +00:00
Tony Herre
418bcf2acb Expose a PeerConnection's NetworkControllerInterface instance
Allow API users to access the NetworkControllerInterface instance that a
given PC ended up with, to allow integrators who have provided a
PeerConnectionFactoryDependencies.network_controller_factory to
associate a created instance of their custom network controller with the
PC using it.

Eg for the RTCRtpTransport Chromium implementation as in crrev.com/c/5607744.

Bug: chromium:345101934
Change-Id: Ia712ca4f45b90d5078f4e8e5977622d3e9f9aa6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353980
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42506}
2024-06-18 08:04:03 +00:00
Harald Alvestrand
c74412b304 Deprecate rtc::RefCountInterface
and move usages to webrtc::RefCountInterface

This CL also moves more stuff to webrtc:: and adds backwards
compatible aliases for them.

Bug: webrtc:42225969
Change-Id: Iefb8542cff793bd8aa46bef8f2f3c66a1e979d07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353720
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42446}
2024-06-07 09:47:26 +00:00
Philipp Hancke
4158678b46 Split "helpers" from SSL target to "crypto_random" and rename
since it contains helpers mostly related to cryptographically secure random numbers and strings.

BUG=webrtc:339300437

Change-Id: I10db939534b25dc792ac1600a4721d1b84521880
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352620
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42441}
2024-06-07 06:41:51 +00:00
Harald Alvestrand
6431a64f02 Reland "Run IWYU on some files I intend to work on"
This reverts commit fe34363ca0ff9d79d7d0943a98ae3a5198e61f75.

Reason for revert: Downstream error fixed.

Original change's description:
> Revert "Run IWYU on some files I intend to work on"
>
> This reverts commit 827da15f1408a399ed15ce5c9726b6af772fb71a.
>
> Reason for revert: Breaks downstream project
>
> Original change's description:
> > Run IWYU on some files I intend to work on
> >
> > and files that broke when I fixed the first set.
> >
> > Bug: webrtc:42226242
> > Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> > Auto-Submit: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#42429}
>
> Bug: webrtc:42226242
> Change-Id: I6b18dced08669c6741c6a51768fbb8b9072c6e82
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353580
> Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#42430}

Bug: webrtc:42226242
Change-Id: I8ba51da47ea34d6bbf868e5ebc0037c6cffec8ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353660
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42437}
2024-06-05 08:59:49 +00:00
Mirko Bonadei
fe34363ca0 Revert "Run IWYU on some files I intend to work on"
This reverts commit 827da15f1408a399ed15ce5c9726b6af772fb71a.

Reason for revert: Breaks downstream project

Original change's description:
> Run IWYU on some files I intend to work on
>
> and files that broke when I fixed the first set.
>
> Bug: webrtc:42226242
> Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Auto-Submit: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42429}

Bug: webrtc:42226242
Change-Id: I6b18dced08669c6741c6a51768fbb8b9072c6e82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353580
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#42430}
2024-06-04 11:36:06 +00:00
Harald Alvestrand
827da15f14 Run IWYU on some files I intend to work on
and files that broke when I fixed the first set.

Bug: webrtc:42226242
Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42429}
2024-06-04 10:59:05 +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