Commit graph

86 commits

Author SHA1 Message Date
Florent Castelli
c5b9a609ea Propagate environment to RtpSenders
Will be later used to conditionally enable mixed codec simulcast
with a field trial.

Bug: webrtc:42220378
Change-Id: I527a488c04cd2b5a9f4ec703504b67943e966ab0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361403
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42929}
2024-09-03 11:56:22 +00:00
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Harald Alvestrand
6431a64f02 Reland "Run IWYU on some files I intend to work on"
This reverts commit fe34363ca0.

Reason for revert: Downstream error fixed.

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

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

Reason for revert: Breaks downstream project

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

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

Bug: webrtc:42226242
Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42429}
2024-06-04 10:59:05 +00:00
Harald Alvestrand
d78e30e00b Deprecate cricket::VideoCodec and cricket::AudioCodec
These are aliases for cricket::Codec.
Also remove internal usage

Bug: b/42225532
Change-Id: I220b95260dc942368cb6280432a058159eec8700
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349321
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42194}
2024-04-29 16:24:51 +00:00
Danil Chapovalov
8d079bea2a Keep Environment instead of test field trials in FakeCall test object
To pass field trials to EncoderStreamFactory in FakeVideoSendStream and thus reduce dependency on the global field trial.

Bug: webrtc:10335
Change-Id: Iad32881c2d9158fe1d77f1b71f8d606374ea111e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/346340
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42023}
2024-04-09 11:53:18 +00:00
Harald Alvestrand
a6544377bc Remove not-needed webrtc:: prefixes in pc/
This test drives the new tools_webrtc/remove_extra_namespace.py tool.

Bug: None
Change-Id: I9b590aa1213e4cace2d64d555f4dafd893f03606
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327021
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41141}
2023-11-13 13:23:04 +00:00
Philipp Hancke
5866e1a0ed Rename Set(Send|Recv)Parameters Set(Sender|Receiver)Parameters
following the previous change to rename the classes derived from
  cricket::RtpParameters

Also rename ChangedRecvParameters to ChangedReceiveParameters.

BUG=webrtc:13931

Change-Id: Ia51dd39905a5cbb98162c3948930e43ccaf3786d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314500
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40677}
2023-09-01 08:12:55 +00:00
Philipp Hancke
a9d5141367 Rename cricket::RtpParameters and derived classes
Renames
  cricket::RtpParameters
to
  cricket::MediaChannelParameters
in order to distinguish it better from webrtc::RtpParameters.
This involves renaming
  RtpSendParameters -> SenderParameters
  AudioSendParameters -> AudioSenderParameters
  AudioRecvParameters -> AudioReceiverParameters
  VideoSendParameters -> VideoSenderParameters
  VideoRecvParameters -> VideoReceiverParameters

BUG=webrtc:13931

Change-Id: I664595ee3863418c0c6ca092ca77127be0f9498f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314360
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40497}
2023-08-01 08:55:02 +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
Florent Castelli
1f31c201cd Split fake media channel classes
This allows to remove some calls to CreateMediaChannel
in the RtpTransceiver code.

This removes the fake engines owning the channels and moves
the responsibility to the tests themselves as it's quite
hard to both return a unique_ptr to a channel and still own it.

The various channel getters from the fake engine are thus
also removed and tests updated accordingly, the channel is
retrieved from internal structs in the tests by going
through the RtpTransceiver objects as it's not possible to
safely get the channels from only a sender or receiver.

As some tests are running in both PlanB and Unified Plan,
getting a transceiver is not working for PlanB. As PlanB
has been deprecated and will eventually be removed,
the problematic tests have either been removed or updated
to only run with Unified Plan.

Bug: webrtc:13931
Change-Id: I0571beca8b9ef2f2089d500802b7b124268d9de3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/310340
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40366}
2023-06-28 11:40:47 +00:00
Harald Alvestrand
847208e9d6 Remove transitional shim classes
Bug: webrtc:13931
Change-Id: Iaeb0b892aca4b4d64d13a025adc7564e572e0f26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307940
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40232}
2023-06-06 11:58:29 +00:00
Florent Castelli
8c4b9ea535 Remove references to AudioCodec and VideoCodec constructors
The preferred method to create codecs is to use the function
cricket::CreateAudioCodec or cricketCreateVideoCodec.
Empty codec objects are deprecated and should be replaced
with alternatives such as methods returning an
absl::optional object instead.

Bug: webrtc:15214
Change-Id: I7fe40f64673cd407830dbbb0e541b85a3aee93aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/307521
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40226}
2023-06-05 23:23:40 +00:00
Harald Alvestrand
2f55370634 Reland "Use two MediaChannels for 2 directions."
This reverts commit 18c869bc36.

Reason for revert: Added a field trial that allows landing the code without affecting performance in prod.

This CL also incorporates subsequent CLs that also had to be reverted.

Original change's description:
> Revert "Use two MediaChannels for 2 directions."
>
> This reverts commit 8981a6fac3.
>
> Reason for revert: Quality regression detected.
>
> Original change's description:
> > Use two MediaChannels for 2 directions.
> >
> > This CL separates the two directions of MediaChannel into two separate objects that do not couple with each other.
> >
> > The notable API change is that receiver local SSRC now has to be set explicitly - before, it was done implicitly when the send-side MediaChannel had a stream added to it.
> >
> > Bug: webrtc:13931
> > Change-Id: I83c2e3c8e79f89872d5adda1bc2899f7049748b3
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288400
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Reviewed-by: Henrik Boström <hbos@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#39340}
>
> No-Try: true
> Bug: webrtc:13931
> Change-Id: I791997ad9eff75c3ac9cd2e4bbacf5bc6c3a3a79
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295663
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39445}

Bug: webrtc:13931
Change-Id: I1318910a685188e2b846c9040e1efc04c2c894ac
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296080
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39494}
2023-03-07 12:57:35 +00:00
Harald Alvestrand
8fa48f459d Revert "Change FakeMediaEngine to use send/receive channels"
This reverts commit 70429d45a6.

Reason for revert: Needed to unblock another rollback.

Original change's description:
> Change FakeMediaEngine to use send/receive channels
>
> Also update the tests that depend on FakeMediaEngine.
>
> Bug: webrtc:13931
> Change-Id: Ia608c4ce68a29e45174b68ba0103af31e9a7d3d1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294280
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#39345}

Bug: webrtc:13931
Change-Id: I975ed0edc0a9a4a44efec1d37202f33b40134be1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295680
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39430}
2023-03-01 10:13:41 +00:00
Harald Alvestrand
70429d45a6 Change FakeMediaEngine to use send/receive channels
Also update the tests that depend on FakeMediaEngine.

Bug: webrtc:13931
Change-Id: Ia608c4ce68a29e45174b68ba0103af31e9a7d3d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294280
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39345}
2023-02-20 11:27:33 +00:00
Harald Alvestrand
8981a6fac3 Use two MediaChannels for 2 directions.
This CL separates the two directions of MediaChannel into two separate objects that do not couple with each other.

The notable API change is that receiver local SSRC now has to be set explicitly - before, it was done implicitly when the send-side MediaChannel had a stream added to it.

Bug: webrtc:13931
Change-Id: I83c2e3c8e79f89872d5adda1bc2899f7049748b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288400
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39340}
2023-02-19 10:34:42 +00:00
Harald Alvestrand
16579cc81d Change MediaChannel to have a Role parameter
This allows MediaChannel to know whether it's being used
for sending, receiving, or both. This is a preparatory CL
for landing the split of MediaChannel usage into sending and
receiving objects.

Bug: webrtc:13931
Change-Id: If518c8b53d5256771200a42e1b5f2b3321d26d8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/292860
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39283}
2023-02-09 14:29:08 +00:00
Philipp Hancke
e04c397099 Enforce stream id uniqueness in RtpSender::set_stream_ids
https://w3c.github.io/webrtc-pc/#dfn-create-an-rtcrtpsender
has a step saying
  For each stream in streams, add stream.id to
  [[AssociatedMediaStreamIds]] if it's not already there

This applies to addTrack and setStreams and the set of streams in
addTransceiver.

Tests that default to the stream id as sync group add
"-sync" as a postfix

BUG=webrtc:14769

Change-Id: I806d2fd87a98d50e54709755541f3f1efff1d8ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288701
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38942}
2022-12-22 10:05:02 +00:00
Ilya Nikolaevskiy
68a7c415c5 Revert "Enforce stream id uniqueness in RtpSender::set_stream_ids"
This reverts commit 315b95ca11.

Reason for revert: Breaks internal bots.

Original change's description:
> Enforce stream id uniqueness in RtpSender::set_stream_ids
>
> https://w3c.github.io/webrtc-pc/#dfn-create-an-rtcrtpsender
> has a step saying
>   For each stream in streams, add stream.id to
>   [[AssociatedMediaStreamIds]] if it's not already there
>
> This applies to addTrack and setStreams and the set of streams in
> addTransceiver.
>
> BUG=webrtc:14769
>
> Change-Id: If6be813396a1987dfe49fd73f976f96c71459eaf
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287864
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38937}

Bug: webrtc:14769
Change-Id: I6fd22ff0550c0894057fb1dc15f1b95819fa6df2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288744
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38940}
2022-12-21 13:56:05 +00:00
Philipp Hancke
315b95ca11 Enforce stream id uniqueness in RtpSender::set_stream_ids
https://w3c.github.io/webrtc-pc/#dfn-create-an-rtcrtpsender
has a step saying
  For each stream in streams, add stream.id to
  [[AssociatedMediaStreamIds]] if it's not already there

This applies to addTrack and setStreams and the set of streams in
addTransceiver.

BUG=webrtc:14769

Change-Id: If6be813396a1987dfe49fd73f976f96c71459eaf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287864
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38937}
2022-12-21 11:28:49 +00:00
Harald Alvestrand
50454ef84a Apply PIMPL pattern to MediaSender and Receiver objects
This detaches the implementation (which is still merged)
from the objects used to interface to it.

Bug: webrtc:13931
Change-Id: I872ee10e4ed9fa432bfa231f723af1d3989d79d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288080
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38906}
2022-12-16 09:23:14 +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
Florent Castelli
acabb3641b pc: Add asynchronous RtpSender::SetParameters() call
As the synchronous version only posts a task to recreate the encoder
later, it is not possible to catch errors and state changes that
could appear then.
The asynchronous version of SetParameters() aims to solve this by
providing a callback to wait for the completion of the encoder
reconfiguration, allowing any error to be propagate and subsequent
getParameters() call to have up to date information.

Bug: webrtc:11607
Change-Id: I5548e75aa14a97f8d9c0c94df1e72e9cd40887b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38627}
2022-11-15 15:31:40 +00:00
Philipp Hancke
b83cd92a1a generateKeyFrame: validate rids argument
BUG=chromium:1354101

Change-Id: Ie850d807e47c72470a50daffec5679c7a23111dc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282380
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38591}
2022-11-09 13:09:41 +00:00
Danil Chapovalov
2aaef45876 Replace Invoke in tests with SendTask test helper
Bug: webrtc:11318
Change-Id: I14e3fbc694d41c785a61c88d8207005c681576c4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271540
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37774}
2022-08-12 23:42:16 +00:00
Fredrik Solenberg
da2afbd70c Remove sigslot usage from DtmfProviderInterface
Bug: webrtc:11943
Change-Id: I452efbb099affc10e9197573fa0e40094a0d90ca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270420
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37681}
2022-08-03 14:16:35 +00:00
Harald Alvestrand
3fe8b0d9a9 Do not allow simulcast to be turned off using SDP munging
This is an error that puts the PC into an inconsistent state, so
causing a crash is the right thing to do.

Bug: chromium:1341043
Change-Id: Ie1eb89400ad87f0c83634b7073236b07e92ec7ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267281
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37391}
2022-07-01 09:06:44 +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
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
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
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
2f7ad28a6d Change stream.AddTrack/RemoveTrack to take a scoped_refptr argument
This better reflects the ownership passing of AddTrack, and is more
consistent for RemoveTrack.

Bug: webrtc:13980
Change-Id: Ide5baccf15fc687a4e092f8831ce8c0fea46604e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259740
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36603}
2022-04-21 12:32:17 +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
Tomas Gunnarsson
b3517fea83 Remove RefCountedObject dependency from FakeFrameDecryptor
Bug: webrtc:12701
Change-Id: I705007948eed7b8300f02a61307e8f4b3410e666
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256108
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36276}
2022-03-21 09:43: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
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
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
Tomas Gunnarsson
2e85b5fa51 Add a check for empty channels to ChannelManager dtor.
This is a necessary precondition for upcoming changes that will remove
calls to Invoke() that currently occur during construction/destruction
of media channel objects.

Subsequently fix RtpSenderReceiverTest to destroy channels that were
created in the constructor, in the destructor.

Bug: webrtc:11992
Change-Id: I526908d997d27495659805d84113c84c48568712
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246680
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35702}
2022-01-16 16:13:53 +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
Åsa Persson
fb1959625d Allow setting different number of temporal layers per simulcast layer.
Setting different number of temporal layers is supported by SimulcastEncodeAdapter and LibvpxVp8Encoder will fallback to SimulcastEncoderAdapter if InitEncode fails.

Bug: none
Change-Id: I8a09ee1e6c70a0006317957c0802d019a0d28ca2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228642
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34785}
2021-08-17 13:33:55 +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
Tomas Gunnarsson
e984aa2e58 Add thread accessors to Call.
Classes associated with the Call instance, need access to these threads
and/or awareness, for checking for thread correctness.

Bug: webrtc:11993
Change-Id: I93bcee0657875f211be2ec959b96f818fa9fd8a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215584
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33772}
2021-04-19 15:59:20 +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