Commit graph

24 commits

Author SHA1 Message Date
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
Harald Alvestrand
5308652c73 Reland "Add recording of PT->Codec mappings on setting SDP for transport"
This reverts commit 6793f831ff.

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 15717236c8.
>
> 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
Jonas Oreland
6793f831ff Revert "Add recording of PT->Codec mappings on setting SDP for transport"
This reverts commit 15717236c8.

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
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
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
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
Per K
3fe69c504c Update MockPeerConnectionInterface and fake with missing methods.
Goal is to make PeerConnectionInterface methods pure virtual.
This is a split of cl https://webrtc-review.googlesource.com/c/src/+/340143 in order to be able to fix Chromium test RTCPeerConnectionHandlerTest.OnRenegotiationNeeded


Bug: none
Change-Id: I5eac4d9a96c1b594c9e2b3505ef2466046065dc8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340481
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41798}
2024-02-24 08:31:45 +00:00
Mirko Bonadei
de3b1cd597 Revert "Make PeerConnectionInteface methods pure virtual."
This reverts commit bff68580b5.

Reason for revert: Breaks roll into Chromium.

Example https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1714596/overview and https://chromium-review.googlesource.com/c/chromium/src/+/5316782.

Original change's description:
> Make PeerConnectionInteface methods pure virtual.
>
> Bug: none
> Change-Id: I64fc23f5159bc6a5cd83c0b00b292641f4976513
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340143
> Commit-Queue: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41782}

Bug: none
Change-Id: I477d27d33ac2bcf98ed51c3da356605ed9afb6da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340323
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41790}
2024-02-23 10:21:37 +00:00
Per K
bff68580b5 Make PeerConnectionInteface methods pure virtual.
Bug: none
Change-Id: I64fc23f5159bc6a5cd83c0b00b292641f4976513
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340143
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41782}
2024-02-22 06:25:20 +00:00
Per K
39ac25d6ec Add PeerConnectionInterface::ReconfigureBandwidthEstimation
Using the Api, BWE components are recreated and new settings can be
applied. Initially, the only configuration available is allowing BWE probes without media".


Note that BWE components are created when transport first becomes writable. So calling this method before a PeerConnection is connected is cheap and only changes configuration.

Integration test in https://webrtc-review.googlesource.com/c/src/+/337322

Bug: webrtc:14928
Change-Id: If2c848489bf94a1f7a5ebf90d2886d90c202c7c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336240
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41687}
2024-02-07 14:10:02 +00:00
Tommi
840cf78600 Move Destroy/Create steps for DataChannelTransport to PeerConnection.
This moves steps from the sdp code for pc state over to the PC class
and slightly simplifies the contract between the two classes.
Moving forward it's easier to consolidate those steps in the PC
class with other grouped operations e.g. during teardown.

Also removing GetDataMid() method in favor of the sctp_mid() property.

Bug: none
Change-Id: I938f953099d327377abd94e6b2c9ece803d88e40
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40981}
2023-10-21 16:25:11 +00:00
Tommi
aa3c9f2972 Reland "Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code."
This reverts commit 298313534d.

Changes from the original commit:
* Call OnTransportClosed() from TeardownDataChannelTransport_n()
  (same as before the original commit)
* Not call OnTransportClosed() from OnTransportChanged() when its
  called with nullptr (also preserving the behaviour from before
  the original commit).

Original change's description:
> Revert "Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code."
>
> This reverts commit 2ec6a6c578.
>
> Reason for revert: It breaks WPT tests (e.g. https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1361972/overview) blocking the roll into Chromium.
>
> Original change's description:
> > Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code.
> >
> > * DCC = DataChannelController.
> >
> > * Consolidate steps to set the mid and transport name. They're now
> >   set at the same time and without a separate PostTask.
> > * Transport sink is now consistently set in DCC
> > * Order of notifications for setting up the transport is now the same
> >   regardless of the first time the transport is being set or if it's
> >   being replaced.
> > * Made set_data_channel_transport() private.
> >
> > Bug: webrtc:11547
> > Change-Id: I39e89c6e269e6f06d55981d7944678bf23c8817a
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300562
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#39859}
>
> Bug: webrtc:11547
> Change-Id: I0d8d7453b71be80fbf1b7eba7d161336e29de091
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301360
> Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
> 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@{#39864}

Bug: webrtc:11547
Change-Id: I8ebbc3d3a12786dff2096350a77e03e98466ff00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301702
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39884}
2023-04-18 12:12:52 +00:00
Mirko Bonadei
298313534d Revert "Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code."
This reverts commit 2ec6a6c578.

Reason for revert: It breaks WPT tests (e.g. https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1361972/overview) blocking the roll into Chromium.

Original change's description:
> Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code.
>
> * DCC = DataChannelController.
>
> * Consolidate steps to set the mid and transport name. They're now
>   set at the same time and without a separate PostTask.
> * Transport sink is now consistently set in DCC
> * Order of notifications for setting up the transport is now the same
>   regardless of the first time the transport is being set or if it's
>   being replaced.
> * Made set_data_channel_transport() private.
>
> Bug: webrtc:11547
> Change-Id: I39e89c6e269e6f06d55981d7944678bf23c8817a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300562
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39859}

Bug: webrtc:11547
Change-Id: I0d8d7453b71be80fbf1b7eba7d161336e29de091
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301360
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
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@{#39864}
2023-04-14 17:04:44 +00:00
Tommi
2ec6a6c578 Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code.
* DCC = DataChannelController.

* Consolidate steps to set the mid and transport name. They're now
  set at the same time and without a separate PostTask.
* Transport sink is now consistently set in DCC
* Order of notifications for setting up the transport is now the same
  regardless of the first time the transport is being set or if it's
  being replaced.
* Made set_data_channel_transport() private.

Bug: webrtc:11547
Change-Id: I39e89c6e269e6f06d55981d7944678bf23c8817a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300562
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39859}
2023-04-14 06:57:51 +00:00
Tommi
b00d63c88b Merge TeardownDataChannelTransport_n and OnTransportChannelClosed.
This consolidates termination logic in the DataChannelController
to make shut down consistent between when the transport notifies
of termination and when termination is initiated from the PC side.

This removes the need for `OnTransportChannelClosed` from the PC
side since we can just use TeardownDataChannelTransport_n (the two
were always being called together).

Bug: webrtc:11547
Change-Id: I1763f82cbfe1a3d5b8bfabb8d4cba0ee0fa95738
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300561
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39838}
2023-04-13 07:32:23 +00:00
Tommi
56548988e9 Switch from pointer to ID for OnSctpDataChannelStateChanged
* The pointer isn't needed for this notification. Arguably using
  the internal id is more consistent with the stats code.
* Using the int makes it safer down the line to post the operation
  from the network thread to the signaling thread rather than post
  an object reference.

Bug: none
Change-Id: I1e9eb31d8386dca3feaa90ee3267ea98eb3e81ec
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299144
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39696}
2023-03-28 08:14:33 +00:00
Tommi
335d084b3b Remove GetSctpSslRole, only use GetSctpSslRole_n
This updates DataChannelController and test classes to use
GetSctpSslRole_n instead and query the role on the network thread.

Along the way this CL makes the init config struct for when constructing
data channels, mandatory. It's now passed via const& instead of by pointer. In practice a valid pointer was always being passed.

Bug: webrtc:11547
Change-Id: I0f4bbf364969cc2dec07871c297ddbef0c175f86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298307
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39676}
2023-03-25 11:40:35 +00:00
Tommi
c61eee28f3 Split up GetSctpSslRole to include an _n variant.
This allows the SslRole to be queried from the network thread which
will simplify some code paths and avoid thread hopping.

The next steps will be to remove GetSctpSslRole and only query the
DTLS role on the network thread and start combining other operations.

Bug: webrtc:11547
Change-Id: I222dc838fc5ee274a294c8d81d38b5a4ea8fea1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298302
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39642}
2023-03-22 16:47:28 +00:00
Tommi
d2afbaf33f Remove sigslot from PeerConnectionInternal and RTCStatsCollector.
It turns out that there were several sigslot instances across data
channel, pc and stats classes that in practice only served as means
to update two counters in RTCStatsCollector. There's already a
notification path that's suitable.

This also fixes a case where the PC instance sat in the middle
of notifications from datachannels to the datachannel controller.

Bug: webrtc:11943
Change-Id: Ic60b76021584019f82085f6651230fe2fe82d465
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295781
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39456}
2023-03-02 14:21:55 +00:00
Fredrik Hernqvist
efbe753617 Add RTCAudioPlayoutStats to GetStats().
This is done by allowing implementations of AudioDeviceModule to
implement the GetStats() method. The default implementation returns
nullopt, in which case RTCAudioPlayoutStats will not be visible in the
stats.

Bug: webrtc:14653
Change-Id: I8e4aa6f1b8fcfa47a30f633d28a4013191752e20
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290563
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Fredrik Hernqvist <fhernqvist@google.com>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Olga Sharonova <olka@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39115}
2023-01-16 13:19:45 +00:00
Jonas Oreland
4b2a106af2 Add optional init_send_encodings to AddTrack
This patch adds variant of PeerConnectionInterface::AddTrack
that takes an initial_send_encodings.

This allows for setting/modifying encoding parameters before sdp
negotiation is performed/complete (e.g requested_resolution).

This is already available if using RtpTransciverInit and AddTransceiver,
but was not added to AddTrack because of concerns that it complicated matching with existing transceivers. This CL sidesteps that by never matching to a preexisting transceiver if initial_send_encodings are specified.

Note:
1) The patch adds a new method rather than an extra (e.g optional)
argument to existing AddTrack. This is to avoid problems with downstream mocks.

2) chromium "problems" was fixed in https://chromium-review.googlesource.com/c/chromium/src/+/3952684 and https://chromium-review.googlesource.com/c/chromium/src/+/3956060

Bug: webrtc:14451
Change-Id: I19b5a03872730280fbf868ca5d3a2f46443359f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278783
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38437}
2022-10-19 09:13:08 +00:00
Henrik Boström
41263fab8f Delete UMA histograms relating to Plan B vs Unified Plan.
Plan B having been deleted from Chrome, there is no need to collect UMAs
relating to Plan B vs Unified Plan setups.

Bug: chromium:1357994
Change-Id: Icb5d16823ea9d849798583cd1c82683014b8a15c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275309
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38069}
2022-09-13 14:19:29 +00:00
Henrik Boström
f785989170 Rename StatsCollector to LegacyStatsCollector.
We should have done this a long time ago.

Let's do the same for stats_types.h in a separate CL because that file
is part of the api/ folder and needs some special care (typedefs and
temporarily include helper to avoid breaking downstream projects).

Bug: webrtc:14180
Change-Id: Id9c71ebd53dd97dd238bdf7527c36d7cf0e91f85
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267642
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37426}
2022-07-05 07:49:43 +00:00
Harald Alvestrand
a45c8f4469 Add unit test framework for DataChannelController
This is in pursuit of an issue with another CL, but large enough
to be worth submitting separately.

Bug: webrtc:13931
Change-Id: If470488f092f8640d3a773922f6f0d22765b9e97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261728
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36833}
2022-05-10 10:45:00 +00:00