Commit graph

49 commits

Author SHA1 Message Date
Philipp Hancke
6a3bbefd58 Reland "Enable DD and VLA header extensions by default for Simulcast/SVC"
This is a reland of commit 33c7edd58a
taking into account GFD which can be enabled by field trials and somewhat conflicts with DD

Original change's description:
> Enable DD and VLA header extensions by default for Simulcast/SVC
>
> When Simulcast (more than one encoding) or SVC (a scalability mode
> other than the default L1T1) is used, enable the AV1 Dependency
> Descriptor and the video-layer-allocations RTP header extensions by
> default.
>
> The RTP header extensions API can be used to disable them if needed.
>
> BUG=webrtc:15378
>
> Change-Id: I587ac32c9d681461496a136f6950b007e72da86d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326100
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41332}

Bug: webrtc:15378
Change-Id: I190edc9435083c0a0a65a6959363f3c41e4a3d1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330563
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41615}
2024-01-26 06:08:28 +00:00
Emil Lundmark
5e3eb52497 Revert "Enable DD and VLA header extensions by default for Simulcast/SVC"
This reverts commit 33c7edd58a.

Reason for revert: Breaks downstream project

Original change's description:
> Enable DD and VLA header extensions by default for Simulcast/SVC
>
> When Simulcast (more than one encoding) or SVC (a scalability mode
> other than the default L1T1) is used, enable the AV1 Dependency
> Descriptor and the video-layer-allocations RTP header extensions by
> default.
>
> The RTP header extensions API can be used to disable them if needed.
>
> BUG=webrtc:15378
>
> Change-Id: I587ac32c9d681461496a136f6950b007e72da86d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326100
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41332}

Bug: webrtc:15378
Change-Id: I6b5f71f321d30a510db3bd180deaa57732f9349b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330540
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41341}
2023-12-08 11:29:46 +00:00
Philipp Hancke
33c7edd58a Enable DD and VLA header extensions by default for Simulcast/SVC
When Simulcast (more than one encoding) or SVC (a scalability mode
other than the default L1T1) is used, enable the AV1 Dependency
Descriptor and the video-layer-allocations RTP header extensions by
default.

The RTP header extensions API can be used to disable them if needed.

BUG=webrtc:15378

Change-Id: I587ac32c9d681461496a136f6950b007e72da86d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326100
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41332}
2023-12-07 08:55:42 +00:00
Danil Chapovalov
7eaa9dc170 Use Environment to keep peer connection factory field trials in ConnectionContext
Bug: webrtc:15656
Change-Id: Ice52fcb9ba54a5d0034b59233ceae4f9cefbceae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41252}
2023-11-27 16:46:27 +00:00
Harald Alvestrand
a6544377bc Remove not-needed webrtc:: prefixes in pc/
This test drives the new tools_webrtc/remove_extra_namespace.py tool.

Bug: None
Change-Id: I9b590aa1213e4cace2d64d555f4dafd893f03606
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327021
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41141}
2023-11-13 13:23:04 +00:00
Danil Chapovalov
c63120a092 Migrate PeerConnection tests to EnableMedia api
Add test helper to inject fake media engine for those tests.

Bug: webrtc:15574
Change-Id: Iae4282d2d3b9804548ccadf58797f39508f07c6a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325880
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41075}
2023-11-03 12:32:14 +00:00
Florent Castelli
d797cb6ca7 Remove all split channels related code
Bug: webrtc:13931
Change-Id: I93b8ca0ba1ec15bf260236bbc914b41fbb30aa58
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310680
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40376}
2023-06-29 09:32:04 +00:00
Philipp Hancke
016bd7514d Make GetNegotiatedHeaderExtensions return all header extensions
so the size and order corresponds to the local capabilities.
The direction may differ.

BUG=chromium:1051821

Change-Id: Icf5312237b8ed137f822c9f7dd35f70a01d2df99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/298043
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39623}
2023-03-21 14:33:41 +00:00
Philipp Hancke
c8c25e5bdf Update SetHeaderExtensionsToNegotiate to match specification
following the updates from
  https://github.com/w3c/webrtc-extensions/pull/142

BUG=chromium:1051821

Change-Id: I2d561bad1ddffb412bdd7e66cf62a3cb5fc73791
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296480
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Markus Handell <handellm@google.com>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39500}
2023-03-08 08:46:35 +00:00
Philipp Hancke
9f6ae375e3 Rename header extension API methods
following spec updates from
  https://github.com/w3c/webrtc-extensions/pull/142

BUG=chromium:1051821

Change-Id: I1fd991a5024d38ac59ebe510ea1a48fd6f42d23b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296321
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@{#39491}
2023-03-07 10:55:58 +00:00
Philipp Hancke
51dbe82fed setOfferedHeaderExtensions: stop any filtered extension
addressing feedback from
  https://github.com/w3c/webrtc-extensions/issues/130
and aligning the behavior with setCodecPreferences.

BUG=chromium:1051821

Change-Id: If0c29e1e16781b6898814e2f888ad08a079fc609
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286780
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#39264}
2023-02-07 09:45:00 +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
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
Niels Möller
83830f316e Delete TestListener and top-level thread wrapping.
Instead use rtc::AutoThread in tests that need that.

Bug: webrtc:9714
Change-Id: I1f33b1b2d321770d062504dd9ef86d66a345dd42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254681
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36950}
2022-05-20 15:21:21 +00:00
Harald Alvestrand
0ac50b9dfd Move ownership of objects from channel_manager to connection_context
This is a preparatory step in deleting the ChannelManager class.

Also delete some declarations whose implementation was previously removed.

Bug: webrtc:13931
Change-Id: I8764c00fa696932e79fcfe17550ef2490d6a1ed1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262804
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36923}
2022-05-18 09:17:24 +00:00
Harald Alvestrand
35f4b4c755 Remove more trampoline functions from ChannelManager
Bug: webrtc:13931
Change-Id: I3a1b48aeffd91ee6abaf78eb1ec69c1653b210e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262640
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36898}
2022-05-16 15:12:27 +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
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
3af79d1768 Move ownership of the Channel class to RTCRtpTransceiver
This makes the channel manager object into a factory, not a manager.

Bug: webrtc:13931
Change-Id: I59f7d818a739797a7c0a7a32e6583450834df122
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260467
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36718}
2022-04-30 19:21:11 +00:00
Harald Alvestrand
daee870a35 Remove ability to do SetChannel() without ClearChannel()
This calls out the fact that SetChannel() is only used on M-section activation; ClearChannel is called on deactivation, and we never change the channel while a transceiver is active.

Bug: webrtc:13931
Change-Id: I3a3bfeec7c1d27d98c3f94a9401bee2130754ed7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260461
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36709}
2022-04-29 14:28:02 +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
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
c24a2189d7 Update IWYU tool with a mapping file
Also apply IWYU to all .cc files in pc/, and correct BUILD file to match.
Note: Some files came out wrong when iwyu was applied. These are not included.

Bug: none
Change-Id: Ib5ea46b8fcc505414d0447cca7218ad3afc2e321
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/252280
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36064}
2022-02-24 11:05:06 +00:00
Tommi
6589def397 Align sender/receiver teardown in RtpTransceiver.
This makes SetChannel() consistently make 2 invokes instead of a
multiple of senders+receivers (previous minimum was 4 but could be
larger).

* Stop() doesn't hop to the worker thread.
* SetMediaChannel(), an already-required step on the worker thread for
  senders and *sometimes* for receivers[1], is now consistently required
  for both. This simplifies transceiver teardown and enables the next
  bullet.
* Transceiver stops all senders and receivers in one go rather than
  ping ponging between threads.

[1] When not required, it was done implicitly inside of Stop().
  See changes in `RtpTransceiver::SetChannel`

Bug: webrtc:13540
Change-Id: Ied61636c8ef09d782bf519524fff2a31e15219a8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249797
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36057}
2022-02-23 11:10:32 +00:00
Tomas Gunnarsson
16de21696a Delete channel objects asynchronously from the transceiver.
Move deletion of channel objects over to the RtpTransceiver instead
of having it done by SdpOfferAnswer.

The deletion is now also done via PostTask rather than Invoke.

Bug: webrtc:11992, webrtc:13540
Change-Id: I5aff14956d5e572ca8816bbfef8739bb609b4484
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/248170
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35798}
2022-01-26 10:39:00 +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
Tomas Gunnarsson
4f8a58c3d2 Remove 2 Invokes to the network thread when creating a channel.
...and one when destroying a channel object.

This CL removes Init_n() and Deinit_n() from the BaseChannel class.
Channel classes now use SetRtpTransport to do initialization and
uninitialization on the network thread.

Notably if an implementation has called SetRtpTransport() with a valid
transport pointer, it is required that SetRtpTransport be called again
with a nullptr before the channel object can be deleted.

In situations where multiple channels are created, this can mean
a substantial reduction in thread hops. We still hop to the worker
in order to construct the objects - this can probably be avoided
and SetChannel() is still a synchronous operation for the transceivers.
Furthermore, teardown of channel objects also still happens
synchronously and across network/worker/signaling threads.

Bug: webrtc:11992
Change-Id: I68ca7596e181fc82996e3e290733d97381aa5e78
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246740
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35738}
2022-01-19 12:17:47 +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
Tommi
4ccdf932e1 VideoRtpReceiver & AudioRtpReceiver threading fixes.
For implementations where the signaling and worker threads are not
the same thread, this significantly cuts down on Thread::Invoke()s that
would block the signaling thread while waiting for the worker thread.

For Audio and Video Rtp receivers, the following methods now do not
block the signaling thread:
* GetParameters
* SetJitterBufferMinimumDelay
* GetSources
* SetFrameDecryptor / GetFrameDecryptor
* SetDepacketizerToDecoderFrameTransformer

Importantly this change also makes the track() accessor accessible
directly from the application thread (bypassing the proxy) since
for receiver objects, the track object is const.

Other changes:

* Remove RefCountedObject inheritance, use make_ref_counted instead.
* Every member variable in the rtp receiver classes is now RTC_GUARDED
* Stop() now fully clears up worker thread state, and Stop() is
  consistently called before destruction. This means that there's one
  thread hop instead of at least 4 before (sometimes more), per receiver.
* OnChanged triggered volume for audio tracks is done asynchronously.
* Deleted most of the JitterBufferDelay implementation. Turns out that
  it was largely unnecessary overhead and complexity.

It seems that these two classes are copy/pasted to a large extent
so further refactoring would be good in the future, as to not have to
fix each issue twice.

Bug: chromium:1184611
Change-Id: I1ba5c3abbd1b0571f7d12850d64004fd2d83e5e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/218605
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34022}
2021-05-17 14:37:55 +00:00
Tommi
cc7a36818f Move header negotiation state to transceivers.
The channel classes have stored the negotiated headers but a more
natural place to store them is in the RtpTransceiver class where
RtpHeaderExtension state is managed as well as the implementation of
the only method that depends on the stored state,
HeaderExtensionsNegotiated().

Also adding a TODO for further improvements where we're unnecessarily
storing state in the channel classes for the purposes of the transports.

Bug: webrtc:12726
Change-Id: If36668e3e49782ddeada23ebed126ee2c4935b8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216691
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33917}
2021-05-04 13:52:35 +00:00
Tommi
99c8a80b8e Change the first-packet-received notification in Channel.
This changes the notification to a single std::function pointer
instead of being a sigslot::signal1<> collection.

Summary:

* Remove SignalFirstPacketReceived_, the last sigslot member variable.
  (still inherits from sigslot::has_slots<>)
* BaseChannel doesn't post to the signaling thread anymore. The only
  reason that remains for the signaling_thread_ variable, is for
  thread checking.
* Remove BaseChannel's reliance on MessageHandlerAutoCleanup
  (still inherits from MessageHandler)

RtpTransceiver is the consumer of this event. That class is also the
class that sits between the PC classes and the channel object, holding
a pointer to the channel and managing calls that come in on the
signaling thread, such as SetChannel. The responsibility of delivering
the first packet received on the signaling thread is now with
RtpTransceiver:

* RtpTransceiver always requires a ChannelManager instance. Previously
  this variable was sometimes set, but it's now required.
* Updated tests in rtp_transceiver_unittest.cc to include a
  ChannelManager as well as fix them to include call expectations for
  mock sender and receivers.

Bug: webrtc:11993, webrtc:11988
Change-Id: If49d6be157cd7599fa6fe3a42cd0a363464e3a74
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215979
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33853}
2021-04-27 17:09:59 +00:00
Harald Alvestrand
7af57c6e48 Remove RTP data implementation
Bug: webrtc:6625
Change-Id: Ie68d7a938d8b7be95a01cca74a176104e4e44e1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215321
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33759}
2021-04-16 13:10:54 +00:00
Tomas Gunnarsson
0b5ec183b5 Simplify ChannelManager initialization.
* A ChannelManager instance is now created via ChannelManager::Create()
* Initialization is performed inside Create(), RAII.
* All member variables in CM are now either const or RTC_GUARDED_BY
  the worker thread.
* Removed dead code (initialization and capturing states are gone).
* ChannelManager now requires construction/destruction on worker thread.
  - one fewer threads that its aware of.
* media_engine_ pointer removed from ConnectionContext.
* Thread policy changes moved from ChannelManager to ConnectionContext.

These changes will make a few other issues easier to fix, so tagging
those bugs with this CL.

Bug: webrtc:12601, webrtc:11988, webrtc:11992, webrtc:11994
Change-Id: I3284cf0a08c773e628af4124e8f52e9faddbe57a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/212617
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33614}
2021-04-01 17:13:09 +00:00
Markus Handell
c17bca7410 SetOfferedRtpHeaderExtensions: fix error code.
For the case where an unknown header extension URI is attempted
to be modified by SetOfferedRtpHeaderExtensions, WebRTC emitted
INVALID_PARAMETER. Fix this by emitting UNSUPPORTED_PARAMETER.

Bug: chromium:1051821
Change-Id: I98b68e1e3a3f90f9cfa0d45833f46a307c246ad0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201733
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32983}
2021-01-14 17:46:25 +00:00
Markus Handell
5932fe1392 RtpTransceiverInterface: introduce HeaderExtensionsNegotiated.
This changes adds exposure of a new transceiver method for
accessing header extensions that have been negotiated, following
spec details in https://w3c.github.io/webrtc-extensions/#rtcrtptransceiver-interface.

The change contains unit tests testing the functionality.

Note: support for signalling directionality of header extensions
in the SDP isn't implemented yet.

https://chromestatus.com/feature/5680189201711104.
Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/65YdUi02yZk

Bug: chromium:1051821
Change-Id: If963beed37e96eed2dff3a2822db4e30caaea4a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/198126
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32860}
2020-12-17 23:43:42 +00:00
Harald Alvestrand
280054f2e6 Eliminate sigslot from RtpTransmissionManager
at the cost of adding a WeakPointerFactory.
Moves the RtpTransceiver "NegotiationNeeded" signal to a callback
function that is passed as a constructor argument.

Bug: webrtc:11943
Change-Id: I37b2027379acce38dbaf0f396daebdb3e579ee54
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/192540
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32575}
2020-11-10 14:41:45 +00:00
Harald Alvestrand
c75c428076 Fix current_direction() when stopping_ but not stopped_
Also add an unit test for RtpTransceiver under Unified Plan, and
refactor so that we no longer use StopInternal() internally.
This will make removing it easier.

Bug: chromium:980879
Change-Id: I46219112e3aba8e7513c08336b10e95b1ea5d68b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182681
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31999}
2020-08-26 14:02:03 +00:00
Harald Alvestrand
6060df5948 Reland "Implement transceiver.stop()"
This is a reland of 11dc6571cb

One fix that makes Web Platform Tests pass in debug mode is applied.

Original change's description:
> Implement transceiver.stop()
>
> This adds RtpTransceiver.StopStandard(), which behaves according to
> the specification at
> https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
>
> It modifies RTCPeerConnection.getTransceivers() to return only
> transceivers that have not been stopped.
>
> Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762
>
> Bug: chromium:980879
> Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31893}

Bug: chromium:980879
Change-Id: Ide31d929ac5ea118d83fdf6a35a592af23f7dfa7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181263
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31907}
2020-08-11 10:46:23 +00:00
Harald Alvestrand
a88c9776de Revert "Implement transceiver.stop()"
This reverts commit 11dc6571cb.

Reason for revert: Breaks Chromium WPT tests

Original change's description:
> Implement transceiver.stop()
> 
> This adds RtpTransceiver.StopStandard(), which behaves according to
> the specification at
> https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
> 
> It modifies RTCPeerConnection.getTransceivers() to return only
> transceivers that have not been stopped.
> 
> Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762
> 
> Bug: chromium:980879
> Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31893}

TBR=sakal@webrtc.org,kthelgason@webrtc.org,hta@webrtc.org,guidou@webrtc.org,marinaciocea@webrtc.org

Change-Id: Ibdc24f7d41e481293ca74ba6d1572de64f7e4654
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:980879
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181262
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31897}
2020-08-10 18:06:30 +00:00
Harald Alvestrand
11dc6571cb Implement transceiver.stop()
This adds RtpTransceiver.StopStandard(), which behaves according to
the specification at
https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop

It modifies RTCPeerConnection.getTransceivers() to return only
transceivers that have not been stopped.

Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762

Bug: chromium:980879
Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31893}
2020-08-10 13:29:15 +00:00
Markus Handell
755c65d8b5 Reland RtpTransceiverInterface: introduce SetOfferedRtpHeaderExtensions.
This change adds exposure of a new transceiver method for
modifying the extensions offered in the next SDP negotiation,
following spec details in https://w3c.github.io/webrtc-extensions/#rtcrtptransceiver-interface.

Features:
- The interface allows to control the negotiated direction as
  per https://tools.ietf.org/html/rfc5285#page-7.
- The interface allows to remove an extension from SDP
  negotiation by modifying the direction to
  RtpTransceiverDirection::kStopped.

Note: support for signalling directionality of header extensions
in the SDP isn't implemented yet.

https://chromestatus.com/feature/5680189201711104.
Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/65YdUi02yZk

Tested: new unit tests in CL and manual tests with downstream project.
Bug: chromium:1051821
Change-Id: I7a4c2f979a5e50e88d49598eacb76d24e81c7c7a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177348
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31554}
2020-06-24 10:38:30 +00:00
Markus Handell
6f727da62b Revert "RtpTransceiverInterface: introduce SetOfferedRtpHeaderExtensions."
This reverts commit 71db9acc40.

Reason for revert: breaks downstream project.
Reason for force push: win bot broken.

Original change's description:
> RtpTransceiverInterface: introduce SetOfferedRtpHeaderExtensions.
>
> This change adds exposure of a new transceiver method for
> modifying the extensions offered in the next SDP negotiation,
> following spec details in https://w3c.github.io/webrtc-extensions/#rtcrtptransceiver-interface.
>
> Features:
> - The interface allows to control the negotiated direction as
>   per https://tools.ietf.org/html/rfc5285#page-7.
> - The interface allows to remove an extension from SDP
>   negotiation by modifying the direction to
>   RtpTransceiverDirection::kStopped.
>
> Note: support for signalling directionality of header extensions
> in the SDP isn't implemented yet.
>
> https://chromestatus.com/feature/5680189201711104.
> Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/65YdUi02yZk
>
> Bug: chromium:1051821
> Change-Id: Iaabc34446f038c46d93c442e90c2a77f77d542d4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176408
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31487}

TBR=hta@webrtc.org,handellm@webrtc.org

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

No-Try: true
Bug: chromium:1051821
Change-Id: I70e1a07225d7eeec7480fa5577d8ff647eba6902
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177103
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31516}
2020-06-12 16:26:49 +00:00
Markus Handell
71db9acc40 RtpTransceiverInterface: introduce SetOfferedRtpHeaderExtensions.
This change adds exposure of a new transceiver method for
modifying the extensions offered in the next SDP negotiation,
following spec details in https://w3c.github.io/webrtc-extensions/#rtcrtptransceiver-interface.

Features:
- The interface allows to control the negotiated direction as
  per https://tools.ietf.org/html/rfc5285#page-7.
- The interface allows to remove an extension from SDP
  negotiation by modifying the direction to
  RtpTransceiverDirection::kStopped.

Note: support for signalling directionality of header extensions
in the SDP isn't implemented yet.

https://chromestatus.com/feature/5680189201711104.
Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/65YdUi02yZk

Bug: chromium:1051821
Change-Id: Iaabc34446f038c46d93c442e90c2a77f77d542d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176408
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31487}
2020-06-10 13:02:44 +00:00
Markus Handell
0357b3e7b6 RtpTransceiverInterface: add header_extensions_to_offer()
This change adds exposure of a new transceiver method for getting
the total set of supported extensions stored as an attribute,
and their direction. If the direction is kStopped, the extension
is not signalled in Unified Plan SDP negotiation.

Note: SDP negotiation is not modified by this change.

Changes:
- RtpHeaderExtensionCapability gets a new RtpTransceiverDirection,
  indicating either kStopped (extension available but not signalled),
  or other (extension signalled).
- RtpTransceiver gets the new method as described above. The
  default value of the attribute comes from the voice and video
  engines as before.

https://chromestatus.com/feature/5680189201711104.
go/rtp-header-extension-ip
Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/65YdUi02yZk

Bug: chromium:1051821
Change-Id: I440443b474db5b1cfe8c6b25b6c10a3ff9c21a8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170235
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30800}
2020-03-16 13:16:42 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Steve Anton
1c05765831 (3) Rename files to snake_case: move the files
Mechanically generated with this command:

tools_webrtc/do-rename.sh move all-renames.txt

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I8b05b6eab9b9d18b29c2199bbea239e9add1e690
Reviewed-on: https://webrtc-review.googlesource.com/c/115481
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26225}
2019-01-11 17:05:20 +00:00
Renamed from pc/rtptransceiver_unittest.cc (Browse further)