Commit graph

426 commits

Author SHA1 Message Date
Tommi
f9e13f8813 Reland "[DataChannel] Send and receive packets on the network thread."
This reverts commit 7f16fcda0f.

Reason for reland: Re-landing after addressing issues in downstream
code and hardening the ObserverAdapter from situations where attempted
usage of data channel proxies could occur after shutting down the
peer connection and terminating the network thread.

Original change's description:
> Revert "[DataChannel] Send and receive packets on the network thread."
>
> This reverts commit fe53fec24e.
>
> Reason for revert: Speculative revert, may be breaking downstream project
>
> Original change's description:
> > [DataChannel] Send and receive packets on the network thread.
> >
> > This updates sctp channels, including work that happens between the
> > data channel controller and the transport, to run on the network
> > thread. Previously all network traffic related to data channels was
> > routed through the signaling thread before going to either the network
> > thread or the caller's thread (e.g. js thread in chrome). Now the
> > calls can go straight from the network thread to the JS thread with
> > enabling a special flag on the observer (see below) and similarly
> > calls to send data, involve 2 threads instead of 3.
> >
> > * Custom data channel observer adapter implementation that
> >   maintains compatibility with existing observer implementations in
> >   that notifications are delivered on the signaling thread.
> >   The adapter can be explicitly disabled for implementations that
> >   want to optimize the callback path and promise to not block the
> >   network thread.
> > * Remove the signaling thread copy of data channels in the controller.
> > * Remove several PostTask operations that were needed to keep things
> >   in sync (but the need has gone away).
> > * Update tests for the controller to consistently call
> >   TeardownDataChannelTransport_n to match with production.
> > * Update stats collectors (current and legacy) to fetch the data
> >   channel stats on the network thread where they're maintained.
> > * Remove the AsyncChannelCloseTeardown test since the async teardown
> >   step has gone away.
> > * Remove `sid_s` in the channel code since we only need the network
> >   state now.
> > * For the custom observer support (with and without data adapter) and
> >   maintain compatibility with existing implementations, added a new
> >   proxy macro that allows an implementation to selectively provide
> >   its own implementation without being proxied. This is used for
> >   registering/unregistering a data channel observer.
> > * Update the data channel proxy to map most methods to the network
> >   thread, avoiding the interim jump to the signaling thread.
> > * Update a plethora of thread checkers from signaling to network.
> >
> > Bug: webrtc:11547
> > Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142
> > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#39760}
>
> Bug: webrtc:11547
> Change-Id: Id0d65594bf727ccea5c49093c942b09714d101ad
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300341
> Auto-Submit: Andrey Logvin <landrey@webrtc.org>
> Owners-Override: Andrey Logvin <landrey@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39764}

Bug: webrtc:11547
Change-Id: I47dfa7e7168be0cd2faab4f8f3ebf110c3728af5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300360
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39786}
2023-04-07 09:04:30 +00:00
Andrey Logvin
7f16fcda0f Revert "[DataChannel] Send and receive packets on the network thread."
This reverts commit fe53fec24e.

Reason for revert: Speculative revert, may be breaking downstream project

Original change's description:
> [DataChannel] Send and receive packets on the network thread.
>
> This updates sctp channels, including work that happens between the
> data channel controller and the transport, to run on the network
> thread. Previously all network traffic related to data channels was
> routed through the signaling thread before going to either the network
> thread or the caller's thread (e.g. js thread in chrome). Now the
> calls can go straight from the network thread to the JS thread with
> enabling a special flag on the observer (see below) and similarly
> calls to send data, involve 2 threads instead of 3.
>
> * Custom data channel observer adapter implementation that
>   maintains compatibility with existing observer implementations in
>   that notifications are delivered on the signaling thread.
>   The adapter can be explicitly disabled for implementations that
>   want to optimize the callback path and promise to not block the
>   network thread.
> * Remove the signaling thread copy of data channels in the controller.
> * Remove several PostTask operations that were needed to keep things
>   in sync (but the need has gone away).
> * Update tests for the controller to consistently call
>   TeardownDataChannelTransport_n to match with production.
> * Update stats collectors (current and legacy) to fetch the data
>   channel stats on the network thread where they're maintained.
> * Remove the AsyncChannelCloseTeardown test since the async teardown
>   step has gone away.
> * Remove `sid_s` in the channel code since we only need the network
>   state now.
> * For the custom observer support (with and without data adapter) and
>   maintain compatibility with existing implementations, added a new
>   proxy macro that allows an implementation to selectively provide
>   its own implementation without being proxied. This is used for
>   registering/unregistering a data channel observer.
> * Update the data channel proxy to map most methods to the network
>   thread, avoiding the interim jump to the signaling thread.
> * Update a plethora of thread checkers from signaling to network.
>
> Bug: webrtc:11547
> Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39760}

Bug: webrtc:11547
Change-Id: Id0d65594bf727ccea5c49093c942b09714d101ad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300341
Auto-Submit: Andrey Logvin <landrey@webrtc.org>
Owners-Override: Andrey Logvin <landrey@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39764}
2023-04-05 09:34:23 +00:00
Tommi
fe53fec24e [DataChannel] Send and receive packets on the network thread.
This updates sctp channels, including work that happens between the
data channel controller and the transport, to run on the network
thread. Previously all network traffic related to data channels was
routed through the signaling thread before going to either the network
thread or the caller's thread (e.g. js thread in chrome). Now the
calls can go straight from the network thread to the JS thread with
enabling a special flag on the observer (see below) and similarly
calls to send data, involve 2 threads instead of 3.

* Custom data channel observer adapter implementation that
  maintains compatibility with existing observer implementations in
  that notifications are delivered on the signaling thread.
  The adapter can be explicitly disabled for implementations that
  want to optimize the callback path and promise to not block the
  network thread.
* Remove the signaling thread copy of data channels in the controller.
* Remove several PostTask operations that were needed to keep things
  in sync (but the need has gone away).
* Update tests for the controller to consistently call
  TeardownDataChannelTransport_n to match with production.
* Update stats collectors (current and legacy) to fetch the data
  channel stats on the network thread where they're maintained.
* Remove the AsyncChannelCloseTeardown test since the async teardown
  step has gone away.
* Remove `sid_s` in the channel code since we only need the network
  state now.
* For the custom observer support (with and without data adapter) and
  maintain compatibility with existing implementations, added a new
  proxy macro that allows an implementation to selectively provide
  its own implementation without being proxied. This is used for
  registering/unregistering a data channel observer.
* Update the data channel proxy to map most methods to the network
  thread, avoiding the interim jump to the signaling thread.
* Update a plethora of thread checkers from signaling to network.

Bug: webrtc:11547
Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39760}
2023-04-04 16:49:17 +00:00
Tommi
527196508c Update DataChannelControllerTests to exercise teardown path.
This updates DataChannelControllerTests to shut down the DCC in the
same way it's shut down by the owning PeerConnection instance:

* Call TeardownDataChannelTransport_n()
* Call PrepareForShutdown()

Also calling PrepareForShutdown() from PC's dtor to be consistent with
how `sdp_handler_->PrepareForShutdown()` is called since it appears
that many tests do not call PC::Close() before destruction.

Bug: b/276434297
Change-Id: I0379baa0df0e764bc255b83ae0667032acfe3db0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300220
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39756}
2023-04-04 11:21:06 +00:00
Tommi
1f708ef2ff Cancel pending operations for the DCC during Pc::Close()
(using no-try due to bot infra issue)

No-try: true
Bug: b/276434297
Change-Id: I33f796b501f96731c4ca76cb62c2331f10c795f1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299708
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39734}
2023-03-31 18:13:59 +00:00
Per K
e1e94ad4c8 Ensure Call is notified of un demuxable packets
With this cl, packets that are discarded in RtpTransport now notifies Call, so that
they can be part of BWE even if they are dropped.
These packets have been recevied on the transport, and has bin decrypted
and parsed and thus can be accounted for.

The un demuxable packets are forwarded to Call similarly how RTCP packets are forwarded.

Bug: webrtc:14928
Change-Id: Ia53349c7b316c4442a3c7aac085a85ec4f4ab9ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299262
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39727}
2023-03-31 10:33:09 +00:00
Tommi
4f7ade5c58 Create SctpDataChannel objects on the network thread.
* Change data channel creation code to return RTCError for more
  detailed/accurate errors.
* Move DataChannelController::sid_allocator_ to the network thread.
* Add a temporary duplicate vector of channels on the network thread.
  This will eventually be the main vector.
* Delete one test that turns out to be racy (as long as we're using
  both the signaling and network threads).

Bug: webrtc:11547, webrtc:12796
Change-Id: I93ab721a09872d075046a907df60e8aee4263371
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298624
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39719}
2023-03-29 20:27:54 +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
Philipp Hancke
3e224c7fe1 Clean up TURN server limit killswitch
after the limitation to 32 TURN servers shipped in M110

BUG=webrtc:13195

Change-Id: I247e5b164188751d94eb9f4fb93aadf1dd645d2a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298308
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@{#39634}
2023-03-22 08:21:22 +00:00
Harald Alvestrand
5da3eb0d89 Always ask for an SCTP m-section if datachannels have been used
This removes the behavior of not requesting datachannel if the first
datachannel is closed before the offer is created.

Bug: chromium:1423562
Change-Id: I90eab0f908507e65d9ee3dff51842ee6d61a8aa9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/297860
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39570}
2023-03-15 21:54:21 +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
Harald Alvestrand
5ad491ec87 Remove call operator from UniqueIdGenerator classes
Call operators do not improve code clarity, and usage was moderate.

Bug: None
Change-Id: I8d86bd7d435ce88e99f4abee8ab95a336d47dc22
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292960
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39294}
2023-02-10 13:10:35 +00:00
Philipp Hancke
66efab2dd2 Measure RTCPMuxPolicy at time of connect
to see if we can finally deprecate it.
Chromium metrics CL:
  https://chromium-review.googlesource.com/c/chromium/src/+/4193156

BUG=chromium:713445

Change-Id: I4847620a50f8ece6a2c9aeb5b754b46455e732ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291332
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39203}
2023-01-26 14:06:01 +00:00
Henrik Boström
46053e4aae Handle the case of missing certificates.
Creating a data channel or negotiating it can make the SCTP transport
name go from nothing (empty string) to something. Inside the
RTCStatsCollector this is relevant because which transports we have
affect which certificates we should cache, so this is an instance of
having to call ClearStatsCache().

The bug is that we don't. This CL fixes the bug.

I tried to create unittests to cover this, but I was unable to
reproduce the race in a testing environment (if I did it would have
hit an RTC_DCHECK). Not ideal... but I hope we can land it anyway since
the fix is trivial and clearing the cache in response to API calls is
worst case harmless.

Bug: webrtc:14844
Change-Id: Ia7174cde040839e5555237db6de285297120b123
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291112
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39160}
2023-01-20 13:31:07 +00:00
Florent Castelli
bd1e5d5aa5 Reland "Ensure RTCRtpSenders are always created with one encoding"
This is a reland of commit b8023690d9

Original change's description:
> Ensure RTCRtpSenders are always created with one encoding
>
> It is possible to have AddTransceiver calls with an empty array
> of encodings or AddTrack calls. In both cases, before negotiation,
> the sender's encodings array would be empty and it was not possible
> to update any value.
>
> Now, a default entry should be created in those cases, allowing to
> update the configuration before negotiation.
>
> Bug: webrtc:10567
> Change-Id: I1271e2965e1a97c1e472451e0ab8867fc24f6c2b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290994
> Auto-Submit: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39126}

Bug: webrtc:10567
Change-Id: I558a95f7b587302b5e95f6ec26d1eb1fedf3dbed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291240
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39150}
2023-01-19 15:49:04 +00:00
Evan Shrubsole
9f9671fe7f Revert "Reland "Ensure RTCRtpSenders are always created with one encoding""
This reverts commit fc5d627cef.

Reason for revert: Breaks upstream WPT tests

Original change's description:
> Reland "Ensure RTCRtpSenders are always created with one encoding"
>
> This is a reland of commit b8023690d9
>
> Original change's description:
> > Ensure RTCRtpSenders are always created with one encoding
> >
> > It is possible to have AddTransceiver calls with an empty array
> > of encodings or AddTrack calls. In both cases, before negotiation,
> > the sender's encodings array would be empty and it was not possible
> > to update any value.
> >
> > Now, a default entry should be created in those cases, allowing to
> > update the configuration before negotiation.
> >
> > Bug: webrtc:10567
> > Change-Id: I1271e2965e1a97c1e472451e0ab8867fc24f6c2b
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290994
> > Auto-Submit: Florent Castelli <orphis@webrtc.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Commit-Queue: Florent Castelli <orphis@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#39126}
>
> Bug: webrtc:10567
> Change-Id: I2d52fa5b1d7cfdc9dce279fcf9faf1e0129c9008
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291140
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39145}

Bug: webrtc:10567
Change-Id: If9b5adb5debb7c87a15662a8d0f232405a0e8136
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291221
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39147}
2023-01-19 14:02:26 +00:00
Florent Castelli
fc5d627cef Reland "Ensure RTCRtpSenders are always created with one encoding"
This is a reland of commit b8023690d9

Original change's description:
> Ensure RTCRtpSenders are always created with one encoding
>
> It is possible to have AddTransceiver calls with an empty array
> of encodings or AddTrack calls. In both cases, before negotiation,
> the sender's encodings array would be empty and it was not possible
> to update any value.
>
> Now, a default entry should be created in those cases, allowing to
> update the configuration before negotiation.
>
> Bug: webrtc:10567
> Change-Id: I1271e2965e1a97c1e472451e0ab8867fc24f6c2b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290994
> Auto-Submit: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39126}

Bug: webrtc:10567
Change-Id: I2d52fa5b1d7cfdc9dce279fcf9faf1e0129c9008
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291140
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39145}
2023-01-19 11:27:34 +00:00
Evan Shrubsole
44e5d5a9d1 Revert "Ensure RTCRtpSenders are always created with one encoding"
This reverts commit b8023690d9.

Reason for revert: Breaking WPT tests in Chrome. Example build https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1263191/overview

Original change's description:
> Ensure RTCRtpSenders are always created with one encoding
>
> It is possible to have AddTransceiver calls with an empty array
> of encodings or AddTrack calls. In both cases, before negotiation,
> the sender's encodings array would be empty and it was not possible
> to update any value.
>
> Now, a default entry should be created in those cases, allowing to
> update the configuration before negotiation.
>
> Bug: webrtc:10567
> Change-Id: I1271e2965e1a97c1e472451e0ab8867fc24f6c2b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290994
> Auto-Submit: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39126}

Bug: webrtc:10567
Change-Id: Ib8931b38182251baac616540788a02a5fafaf670
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/291120
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39132}
2023-01-18 10:34:03 +00:00
Florent Castelli
b8023690d9 Ensure RTCRtpSenders are always created with one encoding
It is possible to have AddTransceiver calls with an empty array
of encodings or AddTrack calls. In both cases, before negotiation,
the sender's encodings array would be empty and it was not possible
to update any value.

Now, a default entry should be created in those cases, allowing to
update the configuration before negotiation.

Bug: webrtc:10567
Change-Id: I1271e2965e1a97c1e472451e0ab8867fc24f6c2b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290994
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39126}
2023-01-17 18:05:49 +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
Per K
cf439a04e5 Introduce PacketReceiver::DeliverRtpPacket and PacketReceier::DeliverRtcpPacket
DeliverRtpPacket use a parsed RTP packet as argument where the RTP extensions are supposed to be known.
This method is implemented in webrt::Call and temporary used by the exising method  Call::DeliverRtp, but the idea is to instead avoid extra packet parsing by forwarding a RtpPacketReceived from RtpTransport::DemuxRtpPacket via  WebrtcVideoChannel::OnPacketReceived and WebrtcVoiceChannel.

DeliverRtcpPacket is also implemented in Call and is directly used in PeerConnection::InitializeRtcpCallback.

Bug: webrtc:14795, webrtc:7135
Change-Id: Ib6ffe8e1229ac07fa459ee2fc9a0af8455a23bac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/290401
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39015}
2023-01-05 13:54:02 +00:00
Harald Alvestrand
c0d44d9d63 Split audio and video channels into Send and Receive APIs.
The implementation here has a number of changes that force the callers
that called the "channel" functions into specific interfaces rather than
just letting C++ take care of it; this should go away once there stops
being a common implementation class for those interfaces.

Bug: webrtc:13931
Change-Id: Ic4e279528a341bc0a0e88d2e1e76c90bc43a1035
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287640
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38888}
2022-12-14 11:00:17 +00:00
Harald Alvestrand
36fafc8827 Split MediaChannel class to sender and receiver
This allows callers to differentiate on whether they need the
channel for sending or receiving purposes.

Note: This CL is incomplete, in that many places cast the pointers
to the concrete subclasses "VideoMediaChannel" and "AudioMediaChannel", which are not split into sending and receiving APIs.

The long term goal is to make two MediaChannel-like class APIs, with distinct implementations, and let the RtpSender and RtpReceiver manage those objects, rather than keeping them in the RtpTransceiver.

Bug: webrtc:13931
Change-Id: I8d56defe2287bd6552b71571cc6a5ec842927fa4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287040
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38844}
2022-12-08 10:51:52 +00:00
Henrik Boström
a445e6a489 Delete deprecated disable_ipv6 flag.
M108 Stable has been released, which does not contain googIPv6 anymore,
and today the last downstream dependency on this flag was removed.

Let's delete!

Bug: webrtc:14608
Change-Id: Ia2d201f0da04b14961f891687b6135fc69b7767e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285720
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38786}
2022-12-01 11:01:02 +00:00
Philipp Hancke
41a8357170 Limit number of TURN servers to 32
Limit the number of TURN servers to 32 in order to allow the
prioritization to assume a fixed offset for (de)prioritizing
candidates. See
  https://github.com/w3c/webrtc-pc/pull/2679
for discussion including some data on current usage.

Guarded by WebRTC-LimitTurnServers which is used as a killswitch.

BUG=webrtc:13195

Change-Id: Ib12726af426ae4238aa7eb6aa062c71af52d495f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285340
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@{#38767}
2022-11-29 17:04:11 +00:00
Henrik Boström
cf2856b01c Add parameter to control the pacer's burst outside of field trials.
BurstyPacer is currently controlled via field trials. In order for
Chrome to be able to have burst without relying on a field trial, this
parameter is added.

When all burst experiments have concluded we may be able to have a
hardcoded constant instead, but for now the parameter is added to
RTCConfiguration.

NOTRY=True

Bug: chromium:1354491
Change-Id: I386c1651dbbcbf309c15ea3d3380cf8f632b5429
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283420
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38621}
2022-11-15 08:46:30 +00:00
Henrik Boström
24e0337846 Make disable_ipv6 ABSL_DEPRECATED.
// All tests pass, infra failure unrelated
NOTRY=True

Bug: webrtc:14608
Change-Id: Ie16dcf9dc66e687f0befef42c7d8e914696af191
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280760
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38502}
2022-10-30 21:47:27 +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
Byoungchan Lee
5a92577a94 Remove fields from remote candidates that could cause crashes in GetStats
Typically, remote candidates come from signalling and are deserialized
into C++ objects. The network_type field of these candidates is
always ADAPTER_TYPE_UNKNOWN.

However, in tests it is common to pass SDP and remote candidates as C++
objects. In this case, the network_type property of remote candidates
is preserved, so DCHECK might be triggered when GetStats is called.

Clearing fields that are not suitable as remote candidates fixes
this issue.

Bug: None
Change-Id: Ida01b0224bce5cf3e87bcad1ddaca35c9f4fffe7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279680
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Auto-Submit: Daniel.L (Byoungchan) Lee <daniel.l@hpcnt.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38436}
2022-10-19 08:06:23 +00:00
Florent Castelli
725ee24060 SVC: Check scalability in AddTransceiver and SetParameters
ScalabilityMode should be validated against the currently
allowed codecs or the currently used codec.

Bug: webrtc:11607
Change-Id: Id2e6cbfad4f089de450150e1203657ed316e2f29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277403
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38433}
2022-10-18 16:27:48 +00:00
Philipp Hancke
62d63a0ab3 metrics: cleanup CandidatePoolUsage metrics
which have shown that it is not easily possible to restrict
the pool size to 1 and combine this with max-bundle

BUG=webrtc:12383,chromium:1328218

Change-Id: I3a7ae4a263238c1b5faa079c3cbdaf84d1b40cbc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279141
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38396}
2022-10-14 12:08:52 +00:00
Philipp Hancke
633dc2fd10 Reland "ice server parsing: return RTCError with more details"
This is a reland of commit c4b0bde7f2
which changes the name of the new method and adds a deprecated
backward compatible variant with the old name.

Original change's description:
> ice server parsing: return RTCError with more details
>
> surfacing those errors to the API (without specific details) instead of just the logging.
>
> BUG=webrtc:14539
>
> Change-Id: Id907ebeb08b96b0e4225a016a37a12d58889091b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278340
> 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@{#38356}

Bug: webrtc:14539
Change-Id: I0a5482e123f25867582d62101b31ed207b95ea1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278962
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38364}
2022-10-12 11:23:22 +00:00
Mirko Bonadei
4d47e0b2be Revert "ice server parsing: return RTCError with more details"
This reverts commit c4b0bde7f2.

Reason for revert: Breaks downstream tests.

Basically, ParseIceServers() and other functions have changed
the return type, and this breaks tests at compile time.

Is it possible to reland with backwards compatible versions that return
the previous type? Then they can be removed afterwards.

Original change's description:
> ice server parsing: return RTCError with more details
>
> surfacing those errors to the API (without specific details) instead of just the logging.
>
> BUG=webrtc:14539
>
> Change-Id: Id907ebeb08b96b0e4225a016a37a12d58889091b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278340
> 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@{#38356}

Bug: webrtc:14539
Change-Id: I4df936ff865f87759936c5d0425478fe51051dc8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278960
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: 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@{#38359}
2022-10-12 06:52:52 +00:00
Philipp Hancke
c4b0bde7f2 ice server parsing: return RTCError with more details
surfacing those errors to the API (without specific details) instead of just the logging.

BUG=webrtc:14539

Change-Id: Id907ebeb08b96b0e4225a016a37a12d58889091b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278340
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@{#38356}
2022-10-11 15:25:29 +00:00
Philipp Hancke
28fb04de62 metrics: remove WebRTC.PeerConnection.IceServers.*
which have shown that 32 is a reasonably safe limit and informed
  https://github.com/w3c/webrtc-pc/pull/2679/

BUG=webrtc:13265,chromium:1360224

Change-Id: I63155653862e4c12720b8655c51ed5f3bdc742f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277804
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#38339}
2022-10-10 14:40:35 +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
Danil Chapovalov
9e09a1f327 Replace Thread::Invoke with Thread::BlockingCall
BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed

Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
2022-09-09 10:44:17 +00:00
Philipp Hancke
7baa63ff9c peerconnection: invalidate stats cache during SLD/SRD
which may allow caching some relatively persistent statistics
such as codec statistics that only change during renegotiation.

BUG=webrtc:8693

Change-Id: Ifd68c9d666d9f328d0efecb64e4201d003788ca8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273324
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37981}
2022-09-01 15:18:27 +00:00
Philipp Hancke
6f22eb55b3 peerconnection: measure invalid ice-chars in remote description
in order to deprecate the non-spec usage

BUG=chromium:1053756

Change-Id: I2588aba64a6e7ff05b39c5505504579a5f58a75f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268380
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37522}
2022-07-14 15:29:47 +00:00
Philipp Hancke
9799fe036a peerconnection: move first connect metrics gathering to helper function
since it has grown too large

BUG=None

Change-Id: I9dfffd6264db3206c0674a3446c857c139ba6fb8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267826
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37492}
2022-07-08 11:44:02 +00:00
Danil Chapovalov
a30439bbe6 Migrate pc/ to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: I9043aa507421a93f0d7ba7406e237f727999b696
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268121
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37478}
2022-07-07 10:33:28 +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
Henrik Boström
5023ffbb38 DCHECK that RTCStatsCollector does not block-invoke more than twice.
In the modern getStats implementation, we currently do two
block-invokes when we trigger stats collection, once for
signaling -> worker and once for signaling -> network inside, both take
place inside the "prepare" method:
RTCStatsCollector::PrepareTransceiverStatsInfosAndCallStats_s_w_n.

For comparison, the legacy stats collector currently require 4 block
invokes to operate.

Bug: webrtc:14247
Change-Id: Ie739cbcf29d87041484183b520aeba520aafcaba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267660
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37424}
2022-07-05 06:49:22 +00:00
Philipp Hancke
a09b921dd4 pc: flush getStats cache in addIceCandidate
BUG=webrtc:14190

Change-Id: I6faf35af7b124f4d5258204f7813cedcf3275f42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265878
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37297}
2022-06-22 07:40:51 +00:00
Philipp Hancke
1fe14f2752 pc: invalidate stats cache when firing onicecandidate
https://w3c.github.io/webrtc-stats/#guidelines-for-getstats-results-caching-throttling
"When the state of the RTCPeerConnection visibly changes as a result of an API call, a promise resolving or an event firing, subsequent new getStats() calls must return up-to-date dictionaries for the affected objects."

BUG=webrtc:14190

Change-Id: I4560be22795f30e0369d573bda0100e490efb57b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265870
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37255}
2022-06-17 11:26:18 +00:00
Artem Titov
c374d11fac Move to_queued_task.h and pending_task_safety_flag.h into public API
Bug: b/235812579
Change-Id: I9fa3dc4a65044df8b44fff4e9bfeac7233fa381c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266080
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37248}
2022-06-17 09:20:39 +00:00
Niels Möller
105711e9ad Move rtc::make_ref_counted to api/
Bug: webrtc:12701
Change-Id: If49095b101c1a1763c2a44a0284c0d670cce953f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265390
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37219}
2022-06-15 09:47:38 +00:00
Philipp Hancke
6e57ca2cb5 stats: expose local candidate stats even before pairing
BUG=webrtc:14163

Change-Id: If176a5f1d0ea9a2d998e18b5d4dc5c70ab4dc816
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265410
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#37188}
2022-06-13 08:20:06 +00:00
Harald Alvestrand
8101e7b79b Reland "Don't create channel_manager++ when media_engine is not set"
This reverts commit c6c02efb56.

Reason for revert: Test now passes (and channel manager is gone)

Original change's description:
> Revert "Don't create channel_manager when media_engine is not set"
>
> This reverts commit c48ad732d6.
>
> Reason for revert: breaks downstream project
>
> Original change's description:
> > Don't create channel_manager when media_engine is not set
> >
> > Also remove a bunch of functions in ChannelManager that were just
> > forwarding to MediaEngineInterface.
> >
> > Bug: webrtc:13931
> > Change-Id: Ia38591fd22c665cace16d032f5c1e384e413cded
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261304
> > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#36801}
>
> Bug: webrtc:13931
> Change-Id: I1e260a2489547bd9483b50e043c28d2805b0fa5a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261660
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Owners-Override: Artem Titov <titovartem@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#36811}

Bug: webrtc:13931
Change-Id: I7b5b45b46095c18d489b6a9fe4c625971d6b3da6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261661
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36976}
2022-05-23 15:51:21 +00:00
Harald Alvestrand
485457f050 Delete ChannelManager class
Bug: webrtc:13931
Change-Id: I331aed0e304f89a0c53d8db20ab2c9733ebbb34c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263120
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36970}
2022-05-23 10:06:26 +00:00
Harald Alvestrand
c3fa7c38b2 Remove remaining trampoline functions from channel_manager
This is part of the project to delete the class entirely.
The CL also adds an "use_rtx" parameter to the function for listing
video codecs, rather than filtering those away afterwards.

Bug: webrtc:13931
Change-Id: I96b9b18c694a1c0986ccf22face76ef4c704d372
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262666
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36963}
2022-05-23 08:09:06 +00:00
Tommi
1def899931 Remove legacy (unused) config param: jitter_buffer_enable_rtx_handling
Bug: none
Change-Id: I14164546950cc63c37e54544cdc80bfd4eddf211
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262962
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36955}
2022-05-21 23:06:21 +00:00
Artem Titov
c6c02efb56 Revert "Don't create channel_manager when media_engine is not set"
This reverts commit c48ad732d6.

Reason for revert: breaks downstream project

Original change's description:
> Don't create channel_manager when media_engine is not set
>
> Also remove a bunch of functions in ChannelManager that were just
> forwarding to MediaEngineInterface.
>
> Bug: webrtc:13931
> Change-Id: Ia38591fd22c665cace16d032f5c1e384e413cded
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261304
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36801}

Bug: webrtc:13931
Change-Id: I1e260a2489547bd9483b50e043c28d2805b0fa5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261660
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Owners-Override: Artem Titov <titovartem@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#36811}
2022-05-09 09:52:34 +00:00
Harald Alvestrand
c48ad732d6 Don't create channel_manager when media_engine is not set
Also remove a bunch of functions in ChannelManager that were just
forwarding to MediaEngineInterface.

Bug: webrtc:13931
Change-Id: Ia38591fd22c665cace16d032f5c1e384e413cded
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261304
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36801}
2022-05-06 22:48:22 +00:00
Harald Alvestrand
35ba0c5cd5 Check that PC is configured for media before doing media operations.
If media_engine is not passed in init parameters, the PC can't handle
media, but can be used for datachannels. This CL adds testing that
datachannels work without media engine, and adds failure returns
to PeerConnection APIs that manipulate media when media engine is
not present.

Bug: webrtc:13931
Change-Id: Iecdf17a0a0bb89e0ad39eb74d6ed077303b875c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261246
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36778}
2022-05-05 11:54:48 +00:00
Harald Alvestrand
9e334b7d99 Remove channel_manager.h from most .h files
This ensures that only the compilation units that actually need
ChannelManager details can see it.

Bug: webrtc:13931
Change-Id: Iddd37580c0ceceba5b7095e84b981e6a525b2800
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261200
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36762}
2022-05-04 16:35:17 +00:00
Harald Alvestrand
2c761b2212 Eliminate channel.h from peer_connection.cc
This limits the exposure of the implementation of ChannelInterface.

Bug: webrtc:13931
Change-Id: Ifc0fa496c210413d81ad71f44fa4040b881d092c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260561
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36725}
2022-05-02 09:04:32 +00:00
Harald Alvestrand
19ebabc904 Separate setting a cricket::Channel from clearing the channel.
This makes it clearer which modules set the channel.
Also remove GetChannel() from PeerConnection public API

This was only used once, internally, and can better be inlined.
Part of reducing the exposure of Channel.

Bug: webrtc:13931
Change-Id: I5f44865230a0d8314d269c85afb91d4b503e8de0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260187
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36695}
2022-04-28 14:19:16 +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
Jonas Oreland
6c7f98472e WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 16/inf
This cl/ adds the feature actually injecting a FieldTrialsView into
PeerConnectionFactory, or into a PeerConnection or both.

The field trials used for a PeerConnection is those specified in
PeerConnectionDependencies. Otherwise will those from
PeerConnectionFactoryDependencies be used (and until we're finished with
this conversion, the global string fallback is used as last resort).

Note that it is currently not possible to create 2 FieldTrials
objects concurrently...due to global string,
so this cl/ is mostly (but entirely) for show, i.e one _can_
realistically inject them into a PeerConnectionFactory.


Bug: webrtc:10335
Change-Id: Id2e60525f48a1f8293c1dd0be771e3ed03790963
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258134
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36578}
2022-04-20 06:35:27 +00:00
Niels Möller
22b5c3ee4f Delete unused method FindDataChannelBySid
Bug: None
Change-Id: I6e7102872607a3fb52b852832ab01c44514ac1d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259304
Auto-Submit: Niels Moller <nisse@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36574}
2022-04-19 19:41:37 +00:00
Harald Alvestrand
ca32793187 Make requesting SDES available only on Fuchsia builds
Bug: webrtc:11066
Change-Id: I0707cf63064830a55db31e883dc7b15aa675950b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257900
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36438}
2022-04-05 06:12:50 +00:00
Tomas Gunnarsson
0d5ce62d01 Make RtpTransceiver not inherit from RefCountedObject.
Also update API proxy Create() factory functions to accept the inner
reference counted object via scoped_refptr instead of a raw pointer.
This is to avoid accidentally creating and deleting an object when
passing an inner object to a proxy class.

Consider something like:
  auto proxy = MyProxy::Create(
      signaling_thread(), make_ref_counted<Foo>());

Bug: webrtc:13464, webrtc:12701
Change-Id: I55ccfff43bbc164a5e909b2c9020e306ebb09075
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256010
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36261}
2022-03-18 16:17:24 +00:00
Harald Alvestrand
c2a2bef4f7 Add a header-reduction argument to IWYU
This allows to delete non-needed headers from .h files.
Ran this on peer_connection.cc to demonstrate.

Bug: none
Change-Id: I69ce48be25a9778297e521282898c6ac31e7ea6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254600
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36170}
2022-03-10 12:25:12 +00:00
Jonas Oreland
ed99dae422 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 1
This cl/
1) move WebRtcKeyValueConfig from api/transport to api/ directory.
2) add a test/ScopedKeyValueConfig (compare ScopedFieldTrials).
3) removes usage of webrtc::field_trial:: from the pc/ directory.
4) removes a few unused includes of system_wrappers/field_trial.h.

Bug: webrtc:10335
Change-Id: If29c07900dbe791050b0a5ad05332bedfad035f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/253903
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36160}
2022-03-09 13:23:21 +00:00
Harald Alvestrand
06c87a1664 Add tests for DC odd/even numbering in a few more cases.
Also expands integration_test_helpers to deal with multiple
datachannels.

The bug has not yet been triggered.

Bug: webrtc:13668
Change-Id: I82a0fdae0cc32815c250a691b56c614bfd6d606b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251602
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35980}
2022-02-11 17:37:34 +00:00
Harald Alvestrand
321ec3ba99 Add tests for SSL role and datachannel ID assignment.
Document with a comment the suspected place that could cause a bug.
Also fix an error in previous role observation code.

Bug: webrtc:13668
Change-Id: Id7f6af6905d90f7974b5570145c201c8339aaf72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251388
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35973}
2022-02-10 15:52:16 +00:00
Harald Alvestrand
bc32c56f83 Move pc.transport_controller_ to be network thread only
A pointer to the transport controller is now maintained on
both the network thread and the signaling thread. We use
thread specific accessors to make it explicit which copy we
are accessing at any given time.

We also move the initial offerer value to the SDP offer/answer
class; this is determined on the basis of SDP offer/answer, so
there is no need to hop to the network thread for that.

Work in progress.

Bug: webrtc:9987
Change-Id: Idbe5a7fbf44f667adcd119e486133cf6e43ab1f5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251382
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35965}
2022-02-09 13:06:15 +00:00
Mirko Bonadei
e0bc8d2f49 Revert "Replace use of sigslot with CallbackList in data_channel_controller"
This reverts commit 8efc914cf3.

Reason for revert: Breaks downstream project.

Original change's description:
> Replace use of sigslot with CallbackList in data_channel_controller
>
> This is a straightforward replacement; simplifications due to the ability
> to inline functions in the lambdas are for a later CL.
>
> Bug: webrtc:11943
> Change-Id: I7274cedde507b954f1d8aa8bc560861102eeb264
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250540
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35936}

TBR=nisse@webrtc.org,hta@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I8fd0f32ceec866bfd9a08cac1108b559bf03caac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11943
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251280
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35941}
2022-02-08 07:42:34 +00:00
Harald Alvestrand
8efc914cf3 Replace use of sigslot with CallbackList in data_channel_controller
This is a straightforward replacement; simplifications due to the ability
to inline functions in the lambdas are for a later CL.

Bug: webrtc:11943
Change-Id: I7274cedde507b954f1d8aa8bc560861102eeb264
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250540
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35936}
2022-02-07 18:08:34 +00:00
Tommi
1901551b00 Reduce log amount when running stats tests.
Bug: none
Change-Id: Icd914ae909f2ea1853cc58f6217933f8d320ceb6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250162
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35884}
2022-02-02 12:17:09 +00:00
Harald Alvestrand
0d4af12cab Add back --no_fwd_decls to iwyu run
Applies IWYU to pc/peer_connection.cc as test.

Bug: webrtc:13532
Change-Id: Iec453fdf6525c6376cb73dd1199326a8e1a21ff6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249986
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35845}
2022-01-31 10:26:17 +00:00
Harald Alvestrand
66c4036d1b Access threads from SdpOfferAnswerHandler via ConnectionContext
This removes a couple of methods from the PeerConnectionSdpMethods
interface.

Bug: webrtc:11995
Change-Id: I0a68178b1f0a99e779e6d7f94d03b493d811f500
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249794
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35841}
2022-01-31 09:22:08 +00:00
Harald Alvestrand
5b66130209 Refactor PeerConnectionInternal to break SdpOfferAnswer dependency
This CL changes the SdpOfferAnswerHandler class to depend on a new class
PerConnectionInternalMethods, which is implemented by PeerConnection.
This means that SdpOfferAnswerHandler no longer depends on
PeerConnectionInterface.

This opens the way for refactoring PeerConnection so that
PeerConnectionInternalMethods is a member object (encapsulation not
inheritance), which will make it possible to break some of the
dependency cycles that make the "peerconnection" target in the BUILD
file so huge.

Bug: webrtc:11995
Change-Id: Ib8413a31c0148b8d8602764b7367dfd3068da58a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249785
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35828}
2022-01-28 15:18:36 +00:00
Tomas Gunnarsson
5411b174c8 Add a channel factory interface.
The interface is implemented by the ChannelManager and contains methods
to create and destroy media channel objects as used by a transceiver.

This will subsequently allow us to delete the channel objects from
the transceiver class where ownership really lies rather than from
the outside - which is currently required by some tests that keep
channel objects on the stack. We'll furthermore be able to do the
destruction asynchronously without additional Invoke()s as we do now
which will remove an Invoke when making sdp changes.

With introducing the interface, the following simplifications were made:
* ChannelManager constructed on the signaling thread.
  Before, there was an Invoke in the context class, which existed
  for the purposes of calling MediaEngine::Init() (which in turn is
  only needed for the VoiceEngine). This Invoke has now been moved
  into the CM (more tbd).
* The CM now has a pointer to the signaling thread (since that's the
  construction thread). That allows us to remove the signaling thread
  parameter from the CreateFooChannel methods.
* The ssrc_generator (UniqueRandomIdGenerator) instance for SSRCs moved
  from SdpOfferAnswerHandler to the CM, as it's always used in
  combination with the CM. This simplifies the CreateFooChannel methods
  as well as a couple of other classes that have a CM dependency.
* Removed DestroyFooChannel related code from SdpOfferAnswerHandler since
  the channel type detail can be taken care of by the CM.

Bug: webrtc:11992, webrtc:13540
Change-Id: I04938a803734de8489ba31e6212d9eaecc244126
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247904
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35766}
2022-01-24 08:50:30 +00:00
Henrik Boström
6d2fe89b7e [C++] Change default sdp_semantics to kUnifiedPlan.
This CL also removed the temporary enum value kNotSpecified.
See PSA https://groups.google.com/u/1/g/discuss-webrtc/c/SdoVP02eUIk
for more information.

With this CL we can close https://crbug.com/webrtc/11121 as fixed.

Bug: webrtc:11121
Change-Id: I1340b9be8e1d7a45e6327a5f550402bc542325ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246209
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35760}
2022-01-21 10:44:56 +00:00
Henrik Boström
62995db2fc Change default sdp_semantics to kNotSpecified.
In preparation for switching the default from kPlanB to kUnifiedPlan,
which could cause subtle bugs for those not prepared for it, we change
the default to kNotSpecified. The only purpose of kNotSpecified is to
crash, forcing any dependencies to explicitly set their sdp_semantics
value.

Tests are updated to explicitly set sdp_semantics when necessary, and
where the test does not care we update to kUnifiedPlan.

If this change lands without getting reverted we can let it sit for a
few weeks, after which we should change the default to kUnifiedPlan and
delete kNotSpecified.

Bug: webrtc:11121
Change-Id: I19b669b0735d78e269e19eaae86c2d7d95a91141
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242968
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35651}
2022-01-10 14:56:03 +00:00
Philipp Hancke
0e56787d63 remove legacy datachannel code
BUG=webrtc:6625

Change-Id: Ic869c28fe9a24147338b5cd2c830a86b008212f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/244506
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#35634}
2022-01-05 20:36:54 +00:00
Harald Alvestrand
09a0d0171c Deprecate RemoveTrack (old signature)
This also removes all internal usage of RemoveTrack, and changes
the replacement function to RemoveTrackOrError rather than RemoveTrackNew.

Bug: webrtc:9534
Change-Id: Idf7bb17495686de77c70428dcbfb12278328ce59
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/244094
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35624}
2022-01-04 20:44:07 +00:00
Niels Möller
e7cc8830ef Update pc/ to not use implicit T* --> scoped_refptr<T> conversion
Bug: webrtc:13464
Change-Id: I729ec2306ec0d6df2e546b5dbb530f57065d60da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/244090
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35623}
2022-01-04 16:19:33 +00:00
Tomas Gunnarsson
94f0194d5a Remove transport_name_ from Channel.
Because of this (seemingly simple) change, I had to change the return
type of transport_name from `const std::string&` to `absl::string_view`
to handle the case when there's no transport assigned.
That in turn caused an avalanche of required updates.

Bug: webrtc:12230, webrtc:11993
Change-Id: I16ec6c6a5fc2f5f7c7de572355a3c6ca924bb9d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/244084
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35617}
2022-01-03 20:51:42 +00:00
Byoungchan Lee
1fe08e1abe Remove unused 4-argument version of OnIceCandidateError.
It has not been used since
https://chromium-review.googlesource.com/c/chromium/src/+/1944346.

Bug: webrtc:13446
Change-Id: Ice9c418435bc7958562eb73524d7651a79508ab6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/241440
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35541}
2021-12-15 09:55:30 +00:00
Harald Alvestrand
fa67aef93f Declare Plan B DEPRECATED
Bug: webrtc:11121
Change-Id: Id9b933a71a9bfd1d20ddd137f43459cdc8ed1896
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238780
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35504}
2021-12-08 21:10:16 +00:00
Niels Möller
73d0774b6b Add PortAllocator configuration to RTCConfiguration
So applications don't need to create and inject their own instance of
BasicPortAllocator, just to change these settings.

Bug: webrtc:13145
Change-Id: I08ac8658b4c0ef87019fa579be9195a8a6b50feb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239643
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35476}
2021-12-06 12:14:28 +00:00
Harald Alvestrand
50b95525c7 Reintroduce enable_dtls_srtp option
This is a partial revert of commit f9e502d935.

Reason for revert: Functionality turns out to be needed by some partners for some months more.

Original change's description:
> Remove enable_dtls_srtp option
>
> This is part of the removal of support for SDES.
>
> Bug: webrtc:11066
> Change-Id: I448d0e0032672c04c87b00550ab4b9d792071a0b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234864
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35262}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11066, chromium:1271469
Change-Id: I79a90f025e53816789b391bc52a0e896b9be87e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238170
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35378}
2021-11-18 14:42:35 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Harald Alvestrand
0d018415d5 Revert "Remove code supporting the SDES crypto mode in SDP"
This reverts commit ee212a72f2.

Reason for revert: Don't remove until downstream issues resolved

Original change's description:
> Remove code supporting the SDES crypto mode in SDP
>
> Removes the ability to accept nonencrypted answers to encrypted offers.
> Fixes some logic around bundled sessions and requirement for
> transport parameters.
>
> Bug: webrtc:11066
> Change-Id: I56d8628d223614918a1e5260fdb8a117c8c02dbd
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236344
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35298}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:11066
Change-Id: I0c400ceffe1b08e0be7b44abbb54c8a032128f05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237223
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35312}
2021-11-04 14:46:27 +00:00
Philipp Hancke
05fadaccee make ice server parsing error and logging more consistent
BUG=None

Change-Id: I1b88d01f8e592b11df31030ee70e6a39a4155773
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237220
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#35307}
2021-11-04 11:51:40 +00:00
Harald Alvestrand
ee212a72f2 Remove code supporting the SDES crypto mode in SDP
Removes the ability to accept nonencrypted answers to encrypted offers.
Fixes some logic around bundled sessions and requirement for
transport parameters.

Bug: webrtc:11066
Change-Id: I56d8628d223614918a1e5260fdb8a117c8c02dbd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236344
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35298}
2021-11-02 12:58:50 +00:00
Harald Alvestrand
f9e502d935 Remove enable_dtls_srtp option
This is part of the removal of support for SDES.

Bug: webrtc:11066
Change-Id: I448d0e0032672c04c87b00550ab4b9d792071a0b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234864
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35262}
2021-10-26 10:35:41 +00:00
Harald Alvestrand
00c62eddf4 Add RTC_PT_GUARDED_BY to sdp_handler_
As suggested in another review.
Also add one more guard, and some commentary.

Bug: None
Change-Id: I9b84453ff2533fe01d157fe84f07405d352e1dc7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/235820
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35245}
2021-10-20 10:03:50 +00:00
Philipp Hancke
f59d9fbb24 peerconnection: measure number of ice servers
for created and connected connections. This will allow making
an informed choice for
  https://webrtc-review.googlesource.com/c/src/+/234867

BUG=webrtc:13265

Change-Id: Ica3bb7695f53403e481ab1ea2a78fa2719fe44a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234867
Reviewed-by: Johannes Kron <kron@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35203}
2021-10-14 11:31:55 +00:00
Jonas Oreland
2ee0e64696 Add support for manually configuring subnets as VPN
This patch adds support for manually setting subnets that
should be handled as VPN, i.e be subject to VpnPreference,
in case webrtc fails to auto-detect VPNs.

Bug: webrtc:13097
Change-Id: I42514f0677a35cfe30ad053570fa9c2a5b4a856b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230122
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34852}
2021-08-25 14:49:11 +00:00
Jonas Oreland
c8fa1eeb75 Add and implement VPN preference
This patch adds a vp preference field to RTCConfig.
  DEFAULT,       // No VPN preference.
  ONLY_USE_VPN,  // only use VPN connections.
  NEVER_USE_VPN, // never use VPN connections
  PREFER_VPN,    // use a VPN connection if possible, i.e VPN connections sorts higher than all other connections.
  AVOID_VPN,     // only use VPN if there is no other connections, i.e VPN connections sorts last.

Bug: webrtc:13097
Change-Id: I3f95bdfa9134e082c7d389f803bd08facfb70262
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229591
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34842}
2021-08-25 08:01:21 +00:00
Artem Titov
880fa8169b Reland "Use backticks not vertical bars to denote variables in comments for /pc"
Original change's description:
> Revert "Use backticks not vertical bars to denote variables in comments for /pc"
>
> This reverts commit 37ee0f5e59.
>
> Reason for revert: Revert in order to be able to revert https://webrtc-review.googlesource.com/c/src/+/225642
>
> Original change's description:
> > Use backticks not vertical bars to denote variables in comments for /pc
> >
> > Bug: webrtc:12338
> > Change-Id: I88cf10afa5fc810b95d2a585ab2e895dcc163b63
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226953
> > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> > Commit-Queue: Artem Titov <titovartem@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34575}
>
> TBR=hta@webrtc.org,titovartem@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I5eddd3a14e1f664bf831e5c294fbc4de5f6a88af
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:12338
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227082
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Commit-Queue: Björn Terelius <terelius@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34577}

Bug: webrtc:12338
Change-Id: I96bd229b73613c162d11d75fa4f5934e1b4295c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227087
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34611}
2021-07-30 22:13:59 +00:00
Björn Terelius
fd05d6f504 Revert "Use backticks not vertical bars to denote variables in comments for /pc"
This reverts commit 37ee0f5e59.

Reason for revert: Revert in order to be able to revert https://webrtc-review.googlesource.com/c/src/+/225642

Original change's description:
> Use backticks not vertical bars to denote variables in comments for /pc
>
> Bug: webrtc:12338
> Change-Id: I88cf10afa5fc810b95d2a585ab2e895dcc163b63
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226953
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34575}

TBR=hta@webrtc.org,titovartem@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5eddd3a14e1f664bf831e5c294fbc4de5f6a88af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:12338
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227082
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34577}
2021-07-27 22:10:24 +00:00
Artem Titov
37ee0f5e59 Use backticks not vertical bars to denote variables in comments for /pc
Bug: webrtc:12338
Change-Id: I88cf10afa5fc810b95d2a585ab2e895dcc163b63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226953
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34575}
2021-07-27 20:52:02 +00:00
Mirko Bonadei
7750d802a5 Rename rtc_base/ssl_stream_adapter.h constants.
Uppercase constants are more likely to conflict with macros (for
example rtc::SRTP_AES128_CM_SHA1_80 and OpenSSL SRTP_AES128_CM_SHA1_80).

This CL renames some constants and follows the C++ style guide.

Bug: webrtc:12997
Change-Id: I2398232568b352f88afed571a9b698040bb81c30
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226564
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34553}
2021-07-26 16:33:54 +00:00