Commit graph

121 commits

Author SHA1 Message Date
Jim Gustafson
99c102adad m126 merge fixes 2024-06-25 14:25:19 -07: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
Per K
f4aadf3774 Change RtpTransport and DsctTransport to receives packets through ReceivedPacketCallback
Instead of using PacketTransportInternal::SignalReadPacket.

Bug: webrtc:15368
Change-Id: Icdc2d7f85df6db944f0ba0232891e6c5a8986a66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340440
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41823}
2024-02-27 15:55:02 +00:00
Emil Lundmark
f268afd791 Remove unused propagation of field trials in Codec::Matches
Bug: None
Change-Id: I7e56bae37a7fd9f8ca9c3bb8c8f55631a19a1a00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/326521
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41152}
2023-11-14 08:14:14 +00:00
Philipp Hancke
b527699a53 Reduce usage of audio/video codec specifics
BUG=webrtc:15214

Change-Id: I8e68ac149af53529321ab44776c62afe4cc2f61e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324020
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@{#40960}
2023-10-18 11:34:45 +00:00
Emil Lundmark
ec8262788b Look through all candidates before falling back to default packetization
It's possible that a peer can signal the same payload with multiple
packetization options. As such, we shouldn't try to fall back to default
packetization until we have considered all the alternatives.

Bug: webrtc:15473
Change-Id: I21772b4d8c53819d1c3105988551ebdbea0df045
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320241
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Auto-Submit: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Sergey Sukhanov <sergeysu@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40775}
2023-09-20 12:18:02 +00:00
Emil Lundmark
17304c3bf8 Perform packetization verification until a match is found
If there happens to be an asymmetry between local and remote codecs we
shouldn't validate that there's a 1:1 packetization mapping for every
codec. It's sufficient to check that there's at least one matching
packetization per codec.

Bug: webrtc:15473
Change-Id: Ib4fc8fdd54bb4dccf96f0c802746c848e2deed83
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320440
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Auto-Submit: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Sergey Sukhanov <sergeysu@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40760}
2023-09-18 07:43:03 +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
Philipp Hancke
79249155c3 Stop decoding video for m-lines which are sendonly or inactive
by not starting the receive stream whenever it is creating.
Instead, this is controlled by the direction of the media content.

BUG=webrtc:11013

Change-Id: Iaaa0ac0aa9f90a4be776a1348f53a0f9c2b84d99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304661
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#40064}
2023-05-15 10:54:16 +00:00
Jared Siskin
bceec84aee Format ^(api|call|common_audio|examples|media|net|p2p|pc)/
half of the remaining folders

git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -E "^(api|call|common_audio|examples|media|net|p2p|pc)/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I8b2cac13f4587d3ce9b2fccc7362967283f57ea2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302062
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39977}
2023-05-03 11:09:26 +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
18c869bc36 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}
2023-03-01 15:57:55 +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
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
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
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
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
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
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
Jonas Oreland
4476b82b35 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 3/inf
convert much of media/ (and the collateral)

Bug: webrtc:10335
Change-Id: I04489dfe9622efe7f89e04aba3be6b3f60e77c91
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254520
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@{#36177}
2022-03-11 07:46:34 +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
Henrik Boström
2deee4bbb2 Mark rtc::Thread's versions of PostTask/PostDelayedTask deprecated.
Because rtc::Thread inherits from TaskQueueBase, it already implements
a pair of PostTask/PostDelayedTask methods that we want to keep. But in
addition to those, rtc::Thread defines its own PostTask/PostDelayedTask
using templates. These are the versions that we want to deprecate.

They were originally implemented prior to rtc::Thread inheriting from
TaskQueueBase. We want to deprecate them because...
- We don't want to have multiple code paths that do the same thing.
- We want to move away from rtc::Thread to TaskQueueBase long-term.
- These versions are not overridable in Chromium.
- These versions don't have high/low precision versions of PDT.

Helper methods are added to rtc::Thread so that callers don't have to
wrap every lambda in webrtc::ToQueuedTask() and update dependencies.

Bug: webrtc:13582
Change-Id: I58702c53f4cb3705681bd9f1ea16b7aaa5052c18
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247660
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35750}
2022-01-20 12:59:27 +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
1933d3b677 Move network thread invokes for initialization for media channels, out.
Remove Init_w and Deinit(), both of which were wrappers around Invoke()
calls from the worker thread to the network thread.

Instead, replace them with Init_n() and Deinit_n() that are currently*
required to be called by external code in order to associate/disassociate
the channels with the transport.

This CL mostly moves things around in order to prepare for upcoming
changes, but it does change channel destruction in the following way:
- When destroying channels, we don't block the worker thread anymore
  while uninitialization happens on the network thread. Previously
  both signal and worker threads were blocked during the
  uninitialization in the ChannelManager.

* In an upcoming CL, Init_n() and Deinit_n() will be called internally
  from a different method that's always called on the network thread
  when a channel is associated/disassociated with a transceiver. When
  we're there, we will have removed several invokes that currently are
  a part of constructing/destructing channel objects.

Bug: webrtc:11992
Change-Id: Ibc30447a40749ceb36d37834b0cfc5c5ea60e895
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246502
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35707}
2022-01-17 14:06:42 +00:00
Tomas Gunnarsson
d908d74fac Make error param non-optional when setting local/remote content.
This is a slight refactoring while doing some other changes, so not
strictly necessary, but the error param is always supplied in practice
so it made sense to update the tests to reflect that, test that error
values are reported in (at least) some cases and remove the additional
code that checks for whether or not error information is requested.

Bug: none
Change-Id: Ia5739a18ea2beb6970eabf9d809c24dfa43466b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/244097
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35632}
2022-01-05 11:59:14 +00:00
Mirko Bonadei
e5e78c4521 Fix -Wunused-but-set-variable.
Bug: None
Change-Id: I8943227108e46c4c942895e4bd8fb276947502e0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236525
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35272}
2021-10-28 12:53:49 +00:00
Harald Alvestrand
519c15de2b Remove the groupid field
This field is unused within WebRTC, and doesn't seem to
be essential for any existing customers.
If this works well, it will be deprecated and removed.

Bug: none
Change-Id: I96d7485e4d094abfa6a8c3d1e6855834c13dedd7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189680
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35263}
2021-10-26 10:36:44 +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
cf2aeffdc2 Remove lock from MediaChannel
Pending messages on network thread for MediaChannel, will be dropped
when the MediaChannel object is deleted (without blocking).

Remove MessageHandler inheritance from Channel since Post-ing to the
network thread has been removed from there.

Copy/pasted code for SendRtp/SendRtcp in WebRtcVideoChannel and
WebRtcVoiceMediaChannel consolidated in MediaChannel.

Bug: webrtc:11993
Change-Id: I05320eb7f86b98adba50ca5eb8b76b78f4111263
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217720
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33955}
2021-05-07 18:01:54 +00:00
Tommi
c9625f09de Make MediaChannel classes aware of the network thread.
This CL mostly adds plumbing to get awareness of the network thread
to the media channel classes. Currently this pointer is only used
to DCHECK that `SetInterface` for the `NetworkInterface` pointer, is
called on the network thread. Follow up changes will establish that
most of the methods are called on the network thread and the mutex
in the MediaChannel base class, can be removed.

Most of the changes in the CL are in channel_unittest.cc. They're mostly
around updating the tests to incorporate the network thread in ways
that reflect how the classes are used in production. Another change is
to use accessor methods for the media channel instances instead of
caching potentially dangling pointers.

Bug: webrtc:11993
Change-Id: I8e2ed1bc23724e238554dbce386789d69660f7e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217682
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33951}
2021-05-07 14:16:21 +00:00
Tommi
1959f8fedc Make ChannelInterface::Enabled() be async.
* Changing return value from bool to void since the operation as async
  effects anyway.
* Removing the `enabled()` accessor due to potential threading issues
  and potential TOCTOU issues. It was only used in one place anyway.
* Applying thread restrictions to member variables.

Bug: none
Change-Id: I51949f5594339952d7b717cfd82f99b532e86b23
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216182
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33830}
2021-04-26 09:52:52 +00:00
Harald Alvestrand
48171ec264 Remove more mentions of RTP datachannels
Bug: webtc:6625
Change-Id: I38c51c4c10df8a5f517733f211e030359d33e787
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215783
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33799}
2021-04-21 10:16:43 +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
6cd508196a Remove ForTesting methods from BaseChannel
The testing code prevents the production code from protecting the
member variables properly. The convenience methods for testing
purposes, can be located with the testing code.

Bug: none
Change-Id: Ieda248a199db84336dfafbd66c93c35508ab2582
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213661
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33635}
2021-04-07 11:52:05 +00:00
Tomas Gunnarsson
d9a51b05da Remove unnecessary calls to BaseChannel::SetRtpTransport
Also updating SocketOptionsMergedOnSetTransport test code to make the
call to SetRtpTransport from the right context.

Bug: webrtc:12636
Change-Id: I343851bcf8ac663d7559128d12447a9a742786f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213660
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33633}
2021-04-07 10:39:04 +00:00
Niels Möller
92430888fd Add thread annotations to FakeIceTransport
Bug: webrtc:12339
Change-Id: I29f5c910c60155cbb48c686e77b02ad3aa761fb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211665
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33500}
2021-03-18 09:57:00 +00:00
Tomas Gunnarsson
ad3258647e Reland "Prepare to avoid hops to worker for network events."
This is a reland of d48a2b14e7

The diff of the reland (what caused the tsan error) can be seen
by diffing patch sets 2 and 3. Essentially I missed keeping the calls
to the transport controller on the worker thread. Note to self to add
thread/sequence checks to that code so that we won't have to rely on
tsan :)

Original change's description:
> Prepare to avoid hops to worker for network events.
>
> This moves the thread hop for network events, from BaseChannel and
> into Call. The reason for this is to move the control over those hops
> (including DeliverPacket[Async]) into the same class where the state
> is held that is affected by those hops. Once that's done, we can start
> moving the relevant network state over to the network thread and
> eventually remove the hops.
>
> I'm also adding several TODOs for tracking future steps and give
> developers a heads up.
>
> Bug: webrtc:11993
> Change-Id: Ice7ee3b5b6893532df52039324293979196d341d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204800
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33138}

Bug: webrtc:11993, webrtc:12430
Change-Id: I4fccaa418d22c2087a55bbb3ddbb25fac3b4dfcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205580
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33153}
2021-02-03 17:44:47 +00:00
Mirko Bonadei
47ec157fbf Revert "Prepare to avoid hops to worker for network events."
This reverts commit d48a2b14e7.

Reason for revert: TSan tests started to fail constantly after this CL (it looks like it is flaky and the CQ was lucky to get green). See https://ci.chromium.org/ui/p/webrtc/builders/ci/Linux%20Tsan%20v2/25042/overview.

Original change's description:
> Prepare to avoid hops to worker for network events.
>
> This moves the thread hop for network events, from BaseChannel and
> into Call. The reason for this is to move the control over those hops
> (including DeliverPacket[Async]) into the same class where the state
> is held that is affected by those hops. Once that's done, we can start
> moving the relevant network state over to the network thread and
> eventually remove the hops.
>
> I'm also adding several TODOs for tracking future steps and give
> developers a heads up.
>
> Bug: webrtc:11993
> Change-Id: Ice7ee3b5b6893532df52039324293979196d341d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204800
> Commit-Queue: Tommi <tommi@webrtc.org>
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#33138}

TBR=nisse@webrtc.org,tommi@webrtc.org

Change-Id: Id87cf9cbcc8ed58e74d755a110f0ef9dd980e298
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11993
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205525
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33145}
2021-02-03 12:08:37 +00:00
Tomas Gunnarsson
d48a2b14e7 Prepare to avoid hops to worker for network events.
This moves the thread hop for network events, from BaseChannel and
into Call. The reason for this is to move the control over those hops
(including DeliverPacket[Async]) into the same class where the state
is held that is affected by those hops. Once that's done, we can start
moving the relevant network state over to the network thread and
eventually remove the hops.

I'm also adding several TODOs for tracking future steps and give
developers a heads up.

Bug: webrtc:11993
Change-Id: Ice7ee3b5b6893532df52039324293979196d341d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/204800
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33138}
2021-02-02 20:13:00 +00:00
Taylor Brandstetter
2ab9b28c52 Get rid of unnecessary network thread Invoke in BaseChannel.
By changing was_ever_writable_ to be guarded by the worker thread
instead of the network thread.

Gets rid of one network thread invoke per audio/video m= section per
round of negotiation.

NOTRY=True

Bug: webrtc:12266
Change-Id: Ie913a9f96db3fd8351559e916922c82d2d0337f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203881
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33130}
2021-02-02 02:48:08 +00:00
Taylor Brandstetter
d0acbd8645 Revert "Do all BaseChannel operations within a single Thread::Invoke."
This reverts commit c1ad1ff178.

Reason for revert: This blocks the worker thread for a longer 
contiguous period of time which can lead to delays in processing
packets. And due to other recent changes, the need to speed up
SetLocalDescription/SetRemoteDescription is reduced.

Still plan to reland some of the changes from the CL, just not the 
part that groups the Invokes.

Original change's description:
> Do all BaseChannel operations within a single Thread::Invoke.
>
> Instead of doing a separate Invoke for each channel, this CL first
> gathers a list of operations to be performed on the signaling thread,
> then does a single Invoke on the worker thread (and nested Invoke
> on the network thread) to update all channels at once.
>
> This includes the methods:
> * Enable
> * SetLocalContent/SetRemoteContent
> * RegisterRtpDemuxerSink
> * UpdateRtpHeaderExtensionMap
>
> Also, removed the need for a network thread Invoke in
> IsReadyToSendMedia_w by moving ownership of was_ever_writable_ to the
> worker thread.
>
> Bug: webrtc:12266
> Change-Id: I31e61fe0758aeb053b09db84f234deb58dfb3d05
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194181
> Commit-Queue: Taylor <deadbeef@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32817}

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

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

Bug: webrtc:12266
Change-Id: I40ec519a614dc740133219f775b5638a488529b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203860
Reviewed-by: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33111}
2021-01-29 21:56:38 +00:00
Taylor Brandstetter
c1ad1ff178 Do all BaseChannel operations within a single Thread::Invoke.
Instead of doing a separate Invoke for each channel, this CL first
gathers a list of operations to be performed on the signaling thread,
then does a single Invoke on the worker thread (and nested Invoke
on the network thread) to update all channels at once.

This includes the methods:
* Enable
* SetLocalContent/SetRemoteContent
* RegisterRtpDemuxerSink
* UpdateRtpHeaderExtensionMap

Also, removed the need for a network thread Invoke in
IsReadyToSendMedia_w by moving ownership of was_ever_writable_ to the
worker thread.

Bug: webrtc:12266
Change-Id: I31e61fe0758aeb053b09db84f234deb58dfb3d05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194181
Commit-Queue: Taylor <deadbeef@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32817}
2020-12-11 03:25:43 +00:00
Harald Alvestrand
476859d38b Stop threadjumping to get RTP transport in channel.cc
This moves the code for threadjumping to get the RTP transport
despite its thread guard from the main function to two functions
marked especially "ForTesting".

Bug: webrtc:12230
Change-Id: I4473ed38e6fdedb05e2fbc97c2521bc1993fdd1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196521
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32792}
2020-12-07 22:24:06 +00:00
Tomas Gunnarsson
b2995a1e57 Delete dead signal code in pc/channel.*
SignalDtlsSrtpSetupFailure is never fired, so the setup code for it,
is dead code. Also removing declarations for methods that have no
implementation.

For other public signals in BaseChannel I've added an accessor which
has revealed a threading problem due to the member variable being public.

Bug: webrtc:11994
Change-Id: Iec6046c6a598066b92c956002ba4160708ae7dcc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32211}
2020-09-28 14:24:41 +00:00