Commit graph

288 commits

Author SHA1 Message Date
Markus Handell
be400e465b Metronome: disable & refactor for single-threaded operation.
The Chromium implementation unfortunately has a rare deadlock.
Rather than patching that up, we're changing the metronome
implementation to be able to use a single-threaded environment
instead.

The metronome functionality is disabled in VideoReceiveStream2
construction inside call.cc.

The new design does not have listener registration or
deresigstration and instead accepts and invokes callbacks, on
the same sequence that requested the callback. This allows
the clients to use features such as WeakPtrFactories or
ScopedThreadSafety for cancellation.

The CL will be followed up with cleanup CLs that removes
registration APIs once downstream consumers have adapted.

Bug: chromium:1381982
Change-Id: I43732d1971e2276c39b431a04365cd2fc3c55c25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282280
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38582}
2022-11-08 12:23:40 +00:00
Danil Chapovalov
9e09a1f327 Replace Thread::Invoke with Thread::BlockingCall
BlockingCall doesn't take rtc::Location parameter and thus most of the dependencies on location can be removed

Bug: webrtc:11318
Change-Id: I91a17e342dd9a9e3e2c8f7fbe267474c98a8d0e5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274620
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38045}
2022-09-09 10:44:17 +00:00
Brett Hebert
e04d0fa1b2 Fix Event Log For Video Receiver
Resolves an issue where, in Chrome, WebRTC event logs do not capture outgoing packets for video receivers because no reference to the event log was passed to the video receiver.

Bug: webrtc:14338
Change-Id: Ia33ce6f2d69a0e341530648b10a08516dc53abf3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271080
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37746}
2022-08-11 12:15:52 +00:00
Danil Chapovalov
6e7c2685e3 Allow recursive check for RTC_DCHECK_RUN_ON macro
instead of using Lock/Unlock attributes, use Assert attribute to annotate code is running on certain task queue or thread.

Such check better matches what is checked, in particular allows to
recheck (and thus better document) currently used task queue

Bug: None
Change-Id: I5bc1c397efbc8342cf7915093b578bb015c85651
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269381
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37619}
2022-07-26 09:27:23 +00:00
Danil Chapovalov
b7128ed172 Migrate call/ to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245
Change-Id: Ifcdcd343fcba1d850e40813bc08862c42647b0c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268002
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37477}
2022-07-07 10:32:26 +00:00
Niels Möller
6939f63ca1 Update old TODO comments
Bug: None
Change-Id: I96850df6cfa19303043108a59ef60d7b686ec747
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267661
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37436}
2022-07-05 09:59:33 +00:00
Danil Chapovalov
0ed3a2b6cb Avoid exposing RemoteBitrateEstimator in ReceiveSideCongestionController
Making RemoteBitrateEstimator to be ReceiveSideCC implementation detail allows code to be cleaner.

Bug: None
Change-Id: I1d3327c44b364c6c2a1005391cf1dc468e0cc8ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266482
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37305}
2022-06-22 13:41:21 +00:00
Danil Chapovalov
80b7c6befd Delete Call dependency on ProcessThread as unused
Last usage or ProcessThread was removed in
https://webrtc-review.googlesource.com/c/src/+/265921

Bug: webrtc:7219
Change-Id: Ia46d9e2530cd0dbf56a5c0ca6e1bf0936fd62672
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266363
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37287}
2022-06-21 08:59:38 +00:00
Danil Chapovalov
675dfb4a1f Move receive side congestion controller periodic task to worker thread
This way call no longer needs dedicated process thread

Bug: webrtc:7219
Change-Id: I8ab677b1e6b909eeb726aefed5e6d10ce4bc43b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265921
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37279}
2022-06-20 16:26:51 +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
Tommi
3176ef79e9 Rename AudioReceiveStream to AudioReceiveStreamInterface
Bug: webrtc:7484
Change-Id: I22eaa7a9e082fc575cf7471d7a2f4f706564d54f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262805
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36965}
2022-05-23 08:44:26 +00:00
Tommi
dddbbebe2b Rename internal::AudioReceiveStream to AudioReceiveStreamImpl
Bug: webrtc:7484
Change-Id: Id0836a7fdd6fabbdc9bdc3b15e9965d9102bffa5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262803
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36959}
2022-05-22 12:22:18 +00:00
Tommi
f6f4543304 Rename VideoReceiveStream to VideoReceiveStreamInterface
Bug: webrtc:7484
Change-Id: I653cfe46486e0396897dd333069a894d67e3c07b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262769
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36958}
2022-05-22 10:54:38 +00:00
Tommi
0601db9a48 Rename ReceiveStream to ReceiveStreamInterface
Bug: webrtc:7484
Change-Id: I41176a66b8399f6c8cf568630f2808eb95cf6247
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262767
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36917}
2022-05-18 07:26:50 +00:00
Ali Tofigh
641a1b11b6 Adopt absl::string_view in call/
Bug: webrtc:13579
Change-Id: Ib616eb3372da341fafb55c23038182751b9da5a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262780
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36910}
2022-05-17 12:00:45 +00:00
Tommi
1331c1821c Reland: Update local_ssrc without needing to recreate video streams.
This is comparable to this change done previously for for audio streams:
https://webrtc-review.googlesource.com/c/src/+/222042

This is a reland of commit 16a8b25d80
with an additional fix in Patchset 2. Another problem turned out to be
in RTCPReceiver, which is fixed in:
https://webrtc-review.googlesource.com/c/src/+/262663

Bug: webrtc:11993
Change-Id: I63c7cf62a6dd50f88b491fea3ba866697552ef5f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262665
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36907}
2022-05-17 10:59:54 +00:00
Tomas Gunnarsson
c92ee5f3c3 Revert "Update local_ssrc without needing to recreate video streams."
This reverts commit 16a8b25d80.

Reason for revert: Checking if this is blocking the Chromium autoroller.

Original change's description:
> Update local_ssrc without needing to recreate video streams.
>
> This is comparable to this change done previously for for audio streams:
> https://webrtc-review.googlesource.com/c/src/+/222042
>
> Bug: webrtc:11993
> Change-Id: Ic953f816a8f7c56d1c3dc9a16d85bef3696a663d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261960
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#36876}

Bug: webrtc:11993
Change-Id: I3a8d2f6a7e89b6784754d8e891a4e01479807c2d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262422
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#36892}
2022-05-13 22:30:44 +00:00
Erik Språng
f3f3a61167 Remove legacy PacedSender.
The new TaskQueuePacedSender has been default-on in code since M97, and
there are no further usages of it that I can find. Let's clean this up!

The PacingController and associated tests will be cleaned up in a
follow-up cl.

Bug: webrtc:10809
Change-Id: I0cb888602939add953415977ee79ff0b3878fea5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258025
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36890}
2022-05-13 20:31:06 +00:00
Tommi
16a8b25d80 Update local_ssrc without needing to recreate video streams.
This is comparable to this change done previously for for audio streams:
https://webrtc-review.googlesource.com/c/src/+/222042

Bug: webrtc:11993
Change-Id: Ic953f816a8f7c56d1c3dc9a16d85bef3696a663d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261960
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36876}
2022-05-13 10:08:54 +00:00
Tommi
cf4ed1516e Add GetRtpExtensionMap to ReceiveStream and remove GetRtpExtensions.
GetRtpExtensions() is still used in one corner case for audio receive
streams, so GetRtpExtensions has migrated to AudioReceiveStream.

Updated FlexfecReceiveStream config management (incl. pass by value) and
now store an RtpHeaderExtensionMap in FlexfecReceiveStreamImpl.

Call GetRtpExtensionMap() from call.cc instead of constructing one on
the fly for each rtp packet (for video packets at least).

Bug: webrtc:11993
Change-Id: Id90ec5d43ea368f58edd6f17cb39d8c54aec641f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261800
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36839}
2022-05-10 13:50:31 +00:00
Tommi
363e812f2d Remove the VideoReceiveStream2::rtp() accessor.
Instead offer accessors for the specific config values from the struct
that are needed at different times. The remote_ssrc and rtx_ssrc
properties maybe accessed from any thread, other properties have
stricter requiremets.

Bug: webrtc:11993
Change-Id: I3ff8527b13452c773fae1b2574f1e3fd2583b481
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261319
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36823}
2022-05-09 20:25:29 +00:00
Tommi
7a15ff3f14 Add a transport_cc() getter and remove rtp_config().
Bug: webrtc:11993
Change-Id: Ie435a702c91b4d3827e528083f474e378fc75cc5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261318
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36822}
2022-05-09 20:21:14 +00:00
Tommi
6be3e788f5 Add getter for rtp header extensions for receiver classes.
This is to avoid accessing the array via the config struct.
Moving forward we might want to consider using the RtpHeaderExtensionMap
instead of a std::vector of RtpExtension.

Bug: webrtc:11993
Change-Id: I8469dbbd9bb95a69f87b5912bfc4bf8b8f603beb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261317
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36820}
2022-05-09 16:59:19 +00:00
Tommi
cb7c7366d0 Separate reading remote_ssrc from using the rtp_config() getter.
`remote_ssrc` can be considered const while some other state represented
by rtp_config() can not and also is tied to a specific thread.
Separating access to these variables, makes moving things around easier.

Bug: webrtc:11993
Change-Id: I70aa000daab6174a401e01dca163213174e8f284
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261316
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36818}
2022-05-09 14:55:00 +00:00
Tommi
cc50b04c02 Remove config() getter from AudioReceiveStream().
This reduces the surface of externally accessible state that belongs
to the class, which makes it easier to control what state belongs to
what thread. In this CL enforcing remote_ssrc() to be conceptually const
and sync_group to conceptually belong to the packet delivery thread.

Bug: webrtc:11993
Change-Id: I7de9366dc0c2bf451b5c58595c2d073b4016f2e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261450
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36813}
2022-05-09 11:21:44 +00:00
Jonas Oreland
e62c2f2c77 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 12/inf
rename WebRtcKeyValueConfig to FieldTrialsView

Bug: webrtc:10335
Change-Id: If725bd498c4c3daf144bee638230fa089fdde833
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36365}
2022-03-29 10:14:00 +00:00
Jonas Oreland
e02f9eedb3 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 10/inf
This patch takes a stab at modules/video_coding,
but reaches only about half.

Bug: webrtc:10335
Change-Id: I0d47d0468b818145470c51ae4e8e75ff58d499ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256112
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36335}
2022-03-25 12:35:36 +00:00
Evan Shrubsole
6dbc1723f1 [cleanup] Prefer VCMTiming unique_ptr in VideoReceiveStream2 c'tor
Change-Id: Ifc2667ef9da38563266fb5ca7800ec757464035e
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256363
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36289}
2022-03-22 13:15:33 +00:00
Jonas Oreland
a943e730b2 WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 7/inf
Convert audio/ and collateral (audio encoder copy red).

Bug: webrtc:10335
Change-Id: Iac54c0cfd2f62f4402f3deec35ae2725ec35b81a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255820
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36229}
2022-03-17 07:11:44 +00:00
Jonas Oreland
c7f691a71a WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 2
convert call/ (and the collaterals)

Bug: webrtc:10335
Change-Id: I8f6bc13c032713aa2a947724b464f6f35454d39a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/254320
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@{#36165}
2022-03-09 22:17:52 +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
Evan Shrubsole
5723d854c9 Integrate sync decoding in video_receive_stream
Wires up DecodeSynchronizer in Call if there is a Metronome injected
into the PeerConnectionFactoryDependencies.

Change-Id: I362cd12648bfa0c32e73111fcd0f3296fca2b275
Bug: webrtc:13658
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251341
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35996}
2022-02-14 16:59:20 +00:00
Tommi
d3b3a3b6bb Remove Call::sync_stream_mapping_
This std::map was used to look up audio streams from ssrcs when
creating/destroying and/or modifying streams. Those operations aren't
frequent enough to justify having a separate lookup map. Removing
the variable, simplifies the thread ownership work a bit.

Bug: webrtc:11993
Change-Id: I94f9f2f56c138051a8b9c5f6a6d7cae3a4e78b48
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249091
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35806}
2022-01-26 14:50:53 +00:00
Tommi
236d7e7e46 Factor out access to Call::receive_rtp_config_
This CL adds a SequenceChecker, receive_11993_checker_, specifically for
variables that need to move to the network thread. Once migrated,
the checker will be replaced with a check for the network thread.

In the meantime, the checker will match with one of worker [x]or
network threads.

As a first step, this checker is used to isolate access to
`receive_rtp_config_` which is used from object factory paths (Create/
Destroy routines) as well as paths that handle network packets.

Bug: webrtc:11993
Change-Id: Ia58423583cf99492018f218eb1640535e3919193
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249080
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35800}
2022-01-26 10:54:40 +00:00
Tommi
3088941a5e Minor order change to Call::DestroyVideoSendStream.
Move StopPermanentlyAndGetRtpStates closer to being the last step of
the destruction process.

Bug: webrtc:11993
Change-Id: I83d86c505b05f5c10d0ce802494baba9aa645027
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239182
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35774}
2022-01-24 14:33:40 +00:00
Byoungchan Lee
c065e739e2 Remove RTC_DISALLOW_COPY_AND_ASSIGN more.
Bug: webrtc:13555, webrtc:13082
Change-Id: I9c07708108da0a26f5e228384fd56cef4d1540b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35749}
2022-01-20 11:00:18 +00:00
Niels Möller
6b7b255e2d Update call/ to not use implicit T* --> scoped_refptr<T> conversion
Also change the class SharedModuleThread to final and
without any virtual methods.

Bug: webrtc:13464
Change-Id: If440e4c794955781f7d6bfce67f4554bcc3dc77e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/246205
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35695}
2022-01-14 10:26:11 +00:00
Jianhui Dai
f349e53ca5 Reland "Call: Deduplicate SentPacket notifications"
This is a reland of Ib121d5af07abe208bd7d36715a234f48cdabb032

In order to be backward compatible with bandwidth estimation behavior,
pass all packets without a |packet_id| to downstream.

Original change's description:
> Call: Deduplicate SentPacket notifications
>
> When bundling is in effect, multiple senders may be sharing the same
> transport. It means every |sent_packet| will be multiply notified from
> different channels, WebRtcVoiceMediaChannel or WebRtcVideoChannel.
> Record |last_sent_packet_| to deduplicate redundant notifications to
> downstream objects.
>
> This CL reduces 50% PostTask/Wakeup of Dynamic Mode Pacer.
>
> [1] https://datatracker.ietf.org/doc/html/rfc8829#section-4.1.1
> [2] https://datatracker.ietf.org/doc/html/rfc8843
>
> Bug: webrtc:13417
> Change-Id: Ib121d5af07abe208bd7d36715a234f48cdabb032
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238720
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35417}

Bug: webrtc:13417, webrtc:13437
Change-Id: Ia5e9fbe5e4f47fe851935ca2484125411114cb68
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239437
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35492}
2021-12-07 16:15:47 +00:00
Jakob Ivarsson
90cc4fe0e9 Revert "Call: Deduplicate SentPacket notifications"
This reverts commit 61a8d9caaa.

Reason for revert: We have identified some downstream regressions caused by this change (https://crbug.com/webrtc/13437).

Original change's description:
> Call: Deduplicate SentPacket notifications
>
> When bundling is in effect, multiple senders may be sharing the same
> transport. It means every |sent_packet| will be multiply notified from
> different channels, WebRtcVoiceMediaChannel or WebRtcVideoChannel.
> Record |last_sent_packet_| to deduplicate redundant notifications to
> downstream objects.
>
> This CL reduces 50% PostTask/Wakeup of Dynamic Mode Pacer.
>
> [1] https://datatracker.ietf.org/doc/html/rfc8829#section-4.1.1
> [2] https://datatracker.ietf.org/doc/html/rfc8843
>
> Bug: webrtc:13417
> Change-Id: Ib121d5af07abe208bd7d36715a234f48cdabb032
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238720
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#35417}

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

Bug: webrtc:13417
Change-Id: Ib1230fa07db56c33941a5b529a28f83d6d08d74d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239441
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Owners-Override: Jakob Ivarsson <jakobi@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35442}
2021-11-30 11:49:51 +00:00
Jianhui Dai
61a8d9caaa Call: Deduplicate SentPacket notifications
When bundling is in effect, multiple senders may be sharing the same
transport. It means every |sent_packet| will be multiply notified from
different channels, WebRtcVoiceMediaChannel or WebRtcVideoChannel.
Record |last_sent_packet_| to deduplicate redundant notifications to
downstream objects.

This CL reduces 50% PostTask/Wakeup of Dynamic Mode Pacer.

[1] https://datatracker.ietf.org/doc/html/rfc8829#section-4.1.1
[2] https://datatracker.ietf.org/doc/html/rfc8843

Bug: webrtc:13417
Change-Id: Ib121d5af07abe208bd7d36715a234f48cdabb032
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238720
Reviewed-by: Markus Handell <handellm@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35417}
2021-11-25 10:55:04 +00:00
Markus Handell
2b10c479ce VideoStreamEncoder: clean up threading constraints.
The sequences of threads entering the VideoStreamEncoder has been
unclear. Fix this by renaming the uninformational |main_queue_| to
|worker_queue_|, and introduce a new |network_queue_| which is set
on construction.

Bug: chromium:1255737
Change-Id: Ic4d3a5b8188b8cc98e60b72aee2c09c9afbc7356
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/236523
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35283}
2021-10-29 12:05:11 +00:00
Tommi
e9716de2cd Remove config() getter from VideoReceiveStream2.
Instead offer getters for the sync_group and rtp struct. Both are
a part of the config but expose much less of the config, which has
mutable parts.

Bug: none
Change-Id: Icc8007246e9776a5d20f30cda1a2df3fb7252ffc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229980
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34838}
2021-08-24 13:14:16 +00:00
Artem Titov
ea24027e83 Use backticks not vertical bars to denote variables in comments for /call
Bug: webrtc:12338
Change-Id: I8f92127b61352bd4b98a0690e9a0435bb6c6f870
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226943
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34569}
2021-07-27 18:29:33 +00:00
Markus Handell
0e62f7aa98 NackModule2: coalesce repeating tasks.
NackModule2 creates repeating tasks, but as there are
many modules (one per receiver) these tasks execute out
of phase with each other, multipliying the amount of wakeups
caused.

Fix this by creating a single wakeup source that serves all
NackModule2 instances in a call.

Bug: webrtc:12989
Change-Id: Ia9c84307eb57349679e42b673474feb2cb43f08e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226464
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34527}
2021-07-22 12:11:13 +00:00
Danil Chapovalov
00ca0044d4 Unify helpers IsRtpPacket and IsRtcpPacket
Bug: None
Change-Id: Ibe942de433435d256cd6827440136936d4b274d6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225022
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34419}
2021-07-06 10:39:00 +00:00
Markus Handell
eb61b7f620 ModuleRtcRtcpImpl2: remove Module inheritance.
This change achieves an Idle Wakeup savings of 200 Hz.

ModuleRtcRtcpImpl2 had Process() logic only active if TMMBR() is
enabled in RtcpSender, which it never is. Hence the Module
inheritance could be removed. The change removes all known
dependencies of the module inheritance, and any related mentions
of ProcessThread.

Fixed: webrtc:11581
Change-Id: I440942f07187fdb9ac18186dab088633969b340e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222604
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34358}
2021-06-22 14:51:04 +00:00
Tommi
55107c8507 Update the sync_group id without recreating audio receive streams.
Bug: webrtc:11993
Change-Id: I7aaff6d6f89332e60967fba741252b630fd941cf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222043
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34308}
2021-06-16 19:34:18 +00:00
Tommi
08be9baaa3 Don't recreate the audio receive stream when updating the local_ssrc.
Bug: webrtc:11993
Change-Id: Ic5d8a8a8b7c12fb1d906e0b3cbdf657fd9e8eafc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222042
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34299}
2021-06-16 10:03:31 +00:00
Tommi
d350006b70 Add rtp_config() accessor to ReceiveStream.
This is a consistent way to get to common config parameters for
all receive streams and avoids storing a copy of the extension
headers inside of Call. This is needed to get rid of the need of
keeping config and copies in sync, which currently is part of why
we repeatedly delete and recreate audio receive streams on config
changes.

Bug: webrtc:11993
Change-Id: Ia356b6cac1425c8c6766abd2e52fdeb73c4a4b4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222040
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34285}
2021-06-14 17:57:57 +00:00
Tommi
1c1f540487 Factor out common receive stream methods to a common interface.
Also including common Rtp config members.
Follow up changes will remove the ReceiveRtpConfig class in Call
and copy of extension headers, instead use the config directly
from the receive streams and not require stream recreation for changing
the headers.

Bug: webrtc:11993
Change-Id: I29ff3400d45d5bffddb3ad0a078403eb102afb65
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221983
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34283}
2021-06-14 16:54:07 +00:00
Tommi
6eda26c550 Reland "Remove AudioReceiveStream::Reconfigure() method."
This reverts commit 8a18e5b3c9.

Reason for revert: Removing the problematic DCHECK.

Original change's description:
> Revert "Remove AudioReceiveStream::Reconfigure() method."
>
> This reverts commit e2561e17e2.
>
> Reason for revert: Speculative revert: breaks an downstream project
>
> Original change's description:
> > Remove AudioReceiveStream::Reconfigure() method.
> >
> > Instead, adding specific setters that are needed at runtime:
> > * SetDepacketizerToDecoderFrameTransformer
> > * SetDecoderMap
> > * SetUseTransportCcAndNackHistory
> >
> > The whole config struct is big and much of the state it holds, needs to
> > be considered const. For that reason the Reconfigure() method is too
> > broad of an interface since it overwrites the whole config struct
> > and doesn't actually handle all the potential config changes that might
> > occur when the config changes.
> >
> > Bug: webrtc:11993
> > Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
> > Reviewed-by: Niels Moller <nisse@webrtc.org>
> > Commit-Queue: Tommi <tommi@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#34252}
>
> TBR=saza@webrtc.org,nisse@webrtc.org,tommi@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: webrtc:11993
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746
> Commit-Queue: Artem Titov <titovartem@webrtc.org>
> Reviewed-by: Andrey Logvin <landrey@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34253}

# Not skipping CQ checks because this is a reland.

Bug: webrtc:11993
Change-Id: I0d3bf9abdcdc8d3f9259d014e6074a5e6b6cc73c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221747
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34255}
2021-06-09 13:26:15 +00:00
Andrey Logvin
8a18e5b3c9 Revert "Remove AudioReceiveStream::Reconfigure() method."
This reverts commit e2561e17e2.

Reason for revert: Speculative revert: breaks an downstream project

Original change's description:
> Remove AudioReceiveStream::Reconfigure() method.
>
> Instead, adding specific setters that are needed at runtime:
> * SetDepacketizerToDecoderFrameTransformer
> * SetDecoderMap
> * SetUseTransportCcAndNackHistory
>
> The whole config struct is big and much of the state it holds, needs to
> be considered const. For that reason the Reconfigure() method is too
> broad of an interface since it overwrites the whole config struct
> and doesn't actually handle all the potential config changes that might
> occur when the config changes.
>
> Bug: webrtc:11993
> Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
> Reviewed-by: Niels Moller <nisse@webrtc.org>
> Commit-Queue: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#34252}

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

Change-Id: I15ca2d8ee5fd612e13dc1f4b3bfb9c885c21dc66
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11993
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221746
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34253}
2021-06-09 10:24:20 +00:00
Tommi
e2561e17e2 Remove AudioReceiveStream::Reconfigure() method.
Instead, adding specific setters that are needed at runtime:
* SetDepacketizerToDecoderFrameTransformer
* SetDecoderMap
* SetUseTransportCcAndNackHistory

The whole config struct is big and much of the state it holds, needs to
be considered const. For that reason the Reconfigure() method is too
broad of an interface since it overwrites the whole config struct
and doesn't actually handle all the potential config changes that might
occur when the config changes.

Bug: webrtc:11993
Change-Id: Ia5311978f56b2e136781467e44f0d18039f0bb2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221363
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34252}
2021-06-09 09:39:30 +00:00
Tommi
1050fbca91 Remove synchronization from VideoSendStream construction.
* Make VideoSendStream and VideoSendStreamImpl construction non-blocking.
* Move ownership of the rtp video sender to VideoSendStream.
* Most state is constructed in initializer lists.
* More state is now const (including VideoSendStreamImpl ptr)
* Adding thread checks to classes that appear to have had a race before
  E.g. RtpTransportControllerSend. The change in threading now actually
  fixes an issue we weren't aware of.
* Moved from using weak_ptr to safety flag and made some PostTask calls
  cancellable that could potentially have been problematic. Initalizing
  the flag without thread synchronization is also simpler.

This should speed up renegotiation significantly when there are
multiple channels. A follow-up change will improve SetSend as well
which is another costly step during renegotiation.

Bug: webrtc:12840
Change-Id: If4b28da5a085643ce132c7cfcf80a62cd1a625c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221105
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34224}
2021-06-03 19:13:45 +00:00
Markus Handell
d99430410b Call: introduce SendStats.
Call send statistic updates are initiated on the send
transport sequence which forced calls to PostTask to the
worker thread which keeps several related attributes
protected by it.

Change this by:
* Using std::atomics for three attributes where synchronization
doesn't really matter and which can be accessed on either
context.
* Introducing a thread-compatible internal class which keeps
the statistics protected by the send transport sequence, and
emits UMA statistics on destruction.

The change also achieves the following trivial changes:
* The call origin time is now tracked by a proper
webrtc::Timestamp.
* The explicit use of the |send_transport_queue_| was replaced by
a more relaxed sequence checker.

Bug: webrtc:11993
Change-Id: I428a4d98b5fd2fd31222f62e597a9d61a3d4899f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220931
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34187}
2021-06-01 15:23:36 +00:00
Vojin Ilic
504fc192d0 Add ability to pass factory for RtpTransportControllerSend to PeerConnectionFactoryDependencies.
This way we can have custom implementation of RtpTransportControllerSendInterface and pass it properly to Call.
Call relies on RtpTransportControllerSendInterface already so this is natural way to customize RTP related classes.

If there is custom factory present in dependencies it will be used, otherwise default factory will be used.

Intention behind this change is to have ability to have custom QoS with custom parameters.

Bug: webrtc:12778
Change-Id: I5b88957025621ef4bcd63eaa98c218ad213da9c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217769
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@nvidia.com>
Cr-Commit-Position: refs/heads/master@{#34181}
2021-06-01 06:57:31 +00:00
Tommi
90738ddb4e Split VideoReceiveStream2 init into worker / network steps.
This is in preparation for actually doing this initialization
differently in the Call class. This CL takes the registration
steps that are inherently network thread associated and makes
them separate from the ctor/dtor.

Inject Call* instead of worker_thread(), which will simplify upcoming
work that needs to access the network_thread() as well.

This is related to:
https://webrtc-review.googlesource.com/c/src/+/220608
https://webrtc-review.googlesource.com/c/src/+/220609

Bug: webrtc:11993
Change-Id: I72769fd61de84967d9a645750c40d01660a2716b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220764
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34172}
2021-05-31 17:10:23 +00:00
Tommi
0377bab21b Split FlexfecReceiveStreamImpl init into worker / network steps.
This is comparable to this change for AudioReceiveStream:
https://webrtc-review.googlesource.com/c/src/+/220608/

Bug: webrtc:11993
Change-Id: I6bad7fa693441f80e86d8b021b8cf42727dc9142
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220609
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34170}
2021-05-31 15:29:41 +00:00
Tommi
02df2eb1de Split AudioStream initialization into worker / network steps.
This is in preparation for actually doing this initialization
differently in the Call class. This CL takes the registration
steps that are inherently network thread associated and makes
them separate from the ctor/dtor.

Bug: webrtc:11993
Change-Id: Ice2e16c108e0c302157534a3aa2b46738aaa7a93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220608
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34163}
2021-05-31 12:16:37 +00:00
Tommi
948e40cfdf Add thread guards and constness to Call members.
Bug: webrtc:11993
Change-Id: I8f6f6fb800f19b9fa2071a1d159dfe9334ab20cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220606
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34161}
2021-05-31 10:55:12 +00:00
Tommi
cae1f1d47b Move PostTask for DeliverRtcp from PeerConnection to Call.
This is part of moving the thread hops from the network thread to
worker (required by Call) into Call itself so that we can eventually
remove them.

Bug: webrtc:11993
Change-Id: Ib3ccdd6c75a3848daae2e3ce6c9a55d9617c2f50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220604
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34160}
2021-05-31 10:34:09 +00:00
Markus Handell
c81afe365d Call: prepare receive stats for thread switch.
This change collects the receive stats that Call
maintains into a new thread-compatible
internal class which can easily be switched to
the network thread.

Bug: webrtc:11993
Change-Id: I9fa9a7f057149789aa327e5ba8a8cb3379762272
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220760
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34158}
2021-05-31 08:37:26 +00:00
Tommi
cbb4421eac Remove DeliverPacketAsync.
This is currently unused and since we ultimately don't want the delivery
of packets to be async at this stage (but rather stay on the network
thread), we don't need it.

Bug: webrtc:11993
Change-Id: I6809026b6901c8ecfacd961e98ddf79aaa16d0bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220601
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34152}
2021-05-29 07:37:33 +00:00
Per Kjellander
fe2063ebc7 Remove REMB throttling funcionality from PacketRouter
This removes PacketRouter inheritance from  RemoteBitrateObserver and TransportFeedbackSenderInterface.
Call binds methods for sending REMB and transport feedback messages from RemoteCongestionController to PacketRouter.
This is needed until the RTCPTranseiver is used instead of the RTP modules.

Bug: webrtc:12693
Change-Id: I7088de497cd6d1e15c98788ff3e6b0a2c8897ea8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215965
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33993}
2021-05-12 11:24:58 +00:00
Tommi
2497a27b22 Store RtpPacketReceived::arrival_time as Timestamp.
Previously this value was rounded up to a millisecond value.
This change is complementary to another change:
https://webrtc-review.googlesource.com/c/src/+/216398

Bug: webrtc:12722
Change-Id: I0fd2baceb4608132615fb6ad241ec863e343edb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217521
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Johannes Kron <kron@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33928}
2021-05-05 16:22:33 +00:00
Tommi
3f418ccf99 Add documentation+DCHECK for the packet path from transport to call.
An upcoming change will remove PeerConnection's involvement in
the RTCP packet path and keep the flow consistent with the RTP packet
path.

Bug: webrtc:11993
Change-Id: I7ce1bbe8bbc352a49310e2e55b55ca5d8d927935
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217389
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33927}
2021-05-05 14:13:03 +00:00
Tomas Gunnarsson
eb9c3f237b Handle OnPacketSent on the network thread via MediaChannel.
* Adds a OnPacketSent callback to MediaChannel, which matches with
  MediaChannel::NetworkInterface::SendPacket.
* Moves the OnPacketSent handling to the media channel implementations
  (video/voice) and removes the PeerConnection/SdpOfferAnswerHandler
  layer from the call path.
* Call::OnSentPacket is called directly from the channels on the network
  thread. This eliminates a PostTask to the worker thread for every
  audio/video network packet.
* Remove sigslot dependency from MediaChannel (and derived).

Bug: webrtc:11993
Change-Id: I1f79a7aa60f05d47e1882f9be1c9323ea8fac5f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215403
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33777}
2021-04-19 16:59:48 +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
Tomas Gunnarsson
9915db3453 Move Call's histogram reporting code into destructor.
This is for better compatibility with thread annotations and how the
histogram data is collected. In the dtor we can make assumptions about
the state of the object, but that context is lost in member methods
even though they're only called from the destructor (and therefore
thread annotations can't "know" that the object is being destructed
inside those calls).

Bug: webrtc:11993
Change-Id: I8b698cc3340fb0db49430da6f7a9b9a02cabf0c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208200
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33295}
2021-02-18 09:58:54 +00:00
Etienne Pierre-Doray
cc4743795b [Battery]: Delay start of CallStats.
To avoid unnecessary repeating tasks, CallStats' timer is started only
upon Call::EnsureStarted().

Bug: chromium:1152887
Change-Id: I1015315f42127bf510affc3d22c930b20eac8bba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206880
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33232}
2021-02-11 12:00:05 +00:00
Artem Titov
d15a575ec3 Use SequenceChecker from public API
Bug: webrtc:12419
Change-Id: I00cca16a0ec70246156ba00b97aa7ae5ccbf5364
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205323
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33220}
2021-02-10 15:04:55 +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
Tomas Gunnarsson
41bfcf4a63 Inject network thread to Call.
This will allow for transitioning PacketReceiver callbacks and
network related callbacks from being posted over to the worker thread
and instead can stay on the network thread along with related state.

Bug: webrtc:11993
Change-Id: I38df462d4dee064015c490f2b8f809cb47f23cf1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202039
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33116}
2021-01-31 10:56:14 +00:00
Tomas Gunnarsson
a722d2ac1e Add DeliverPacketAsync method to PacketReceiver.
This change includes a basic first implementation of the method in Call.
The implementation assumes being called on the network thread
and simply posts to the worker thread which is what currently happens
inside the BaseChannel class (but I'm that moving out of there).

Bug: webrtc:11993
Change-Id: Id94934808f655071ea9dc87ab20d2a4d8ca7e61e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202255
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33033}
2021-01-19 11:53:50 +00:00
Mirko Bonadei
b985748f66 Add WebRTC code freshness version string.
This CL adds a string to the resulting WebRTC library (trying to make
sure the version string will be there no matter how WebRTC is packaged).

This CL should be followed by some process to regularly and
automatically update the version string.

No-Try: True
No-Presubmit: True
Bug: webrtc:12159
Change-Id: I9143aeae2cd54d0d4048c138772888100d7873cb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191223
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32825}
2020-12-14 16:22:35 +00:00
Mirko Bonadei
20e4c80fbe Reland "Introduce RTC_NO_UNIQUE_ADDRESS."
This is a reland of f5e261aaf6

This CL disables RTC_NO_UNIQUE_ADDRESS on MSan builds since
there have been some issues.

Original change's description:
> Introduce RTC_NO_UNIQUE_ADDRESS.
>
> This macro introduces the possibility to suggest the compiler that a
> data member doesn't need an address different from other non static
> data members.
>
> The usage of a macro is to maintain portability since at the moment
> the attribute [[no_unique_address]] is only supported by clang
> with at least -std=c++11 but it should be supported by all the
> compilers starting from C++20.
>
> Bug: webrtc:11495
> Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32246}

Bug: webrtc:11495, webrtc:12218
Change-Id: I4e6c7cc37d3daffad2407c9a2acfa897fa5b426a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189968
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32668}
2020-11-23 11:29:36 +00:00
Mirko Bonadei
0abd518abd Revert "Introduce RTC_NO_UNIQUE_ADDRESS."
This reverts commit f5e261aaf6.

Reason for revert: Breaks downstream projects.

Original change's description:
> Introduce RTC_NO_UNIQUE_ADDRESS.
>
> This macro introduces the possibility to suggest the compiler that a
> data member doesn't need an address different from other non static
> data members.
>
> The usage of a macro is to maintain portability since at the moment
> the attribute [[no_unique_address]] is only supported by clang
> with at least -std=c++11 but it should be supported by all the
> compilers starting from C++20.
>
> Bug: webrtc:11495
> Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32246}

TBR=mbonadei@webrtc.org,kwiberg@webrtc.org

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

Bug: webrtc:11495
Change-Id: Ice318d1b11ca3dff09c190187a0b0a32ca945fe3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186944
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32335}
2020-10-07 07:37:01 +00:00
Mirko Bonadei
f5e261aaf6 Introduce RTC_NO_UNIQUE_ADDRESS.
This macro introduces the possibility to suggest the compiler that a
data member doesn't need an address different from other non static
data members.

The usage of a macro is to maintain portability since at the moment
the attribute [[no_unique_address]] is only supported by clang
with at least -std=c++11 but it should be supported by all the
compilers starting from C++20.

Bug: webrtc:11495
Change-Id: I9f12b67b4422a2749649eaa6b004a67d5fd572d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173331
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32246}
2020-09-30 09:52:49 +00:00
Erik Språng
ceb44959ca Reland: Wires up WebrtcKeyValueBasedConfig in media engines.
This is a reland of
https://webrtc-review.googlesource.com/c/src/+/174261

Patchset 1 contains the old cl (plus a merge conflict fix).
Later patchets are bufixes: A PeerConnection can be created without a
Call instance (in the case of DataChannel only), so we can't always
use that to fetch the current trials.

Old CL descritpion:

This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

// Since re-land is otherwise unchanged, setting previous reviewers as TBR
TBR=kthelgason@webrtc.org,mbonadei@webrtc.org,stefan@webrtc.org,srte@webrtc.org

Bug: webrtc:11926
Change-Id: I57a9e8c3454f226f77fb93215bcac83da65034b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185003
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32163}
2020-09-22 16:08:22 +00:00
Artem Titov
5956a17ed6 Revert "Wires up WebrtcKeyValueBasedConfig in media engines."
This reverts commit 591b2ab82e.

Reason for revert: Breaks downstream project

Original change's description:
> Wires up WebrtcKeyValueBasedConfig in media engines.
> 
> This replaces field_trial:: -based functions from system_wrappers.
> Field trials are still used as fallback, but injectable trials are now
> possible.
> 
> Bug: webrtc:11926
> Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
> Reviewed-by: Per Kjellander <perkj@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Reviewed-by: Sebastian Jansson <srte@webrtc.org>
> Commit-Queue: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32129}

TBR=mbonadei@webrtc.org,kthelgason@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,perkj@webrtc.org

Change-Id: I3e169149a8b787aa6366bb357abb71794534c63a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11926
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184507
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32132}
2020-09-17 20:17:38 +00:00
Erik Språng
591b2ab82e Wires up WebrtcKeyValueBasedConfig in media engines.
This replaces field_trial:: -based functions from system_wrappers.
Field trials are still used as fallback, but injectable trials are now
possible.

Bug: webrtc:11926
Change-Id: I70f28c4fbabf6d9e55052342000e38612b46682c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174261
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32129}
2020-09-17 16:24:10 +00:00
Erik Språng
7703f23b60 Adds ability to delay pacer start until media is added.
This avoids the pacer thread waking up at 5ms interval if a
PeerConnection is created without actually using media.

The TaskQueuePacedSender solves the problem too, this CL is mostly a
safeguard in case we still find issues when turning it on...

Can be turned off by setting field trial "WebRTC-LazyPacerStart" to
"Disabled".

Bug: webrtc:10809
Change-Id: I8501106e608eccb14487576f24bdceaf3f324d80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183982
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32101}
2020-09-14 21:42:55 +00:00
Henrik Boström
29444c6524 [Adaptation] Multi-processor support for injected Resources.
Because a single Resource only has a single ResourceListener, injected
Resources only gets wired up to the stream's ResourceAdaptationProcessor
that was last to call SetResourceListener. This could potentially lead
to the relevant stream not adapting based on the injected resource
because it got wired up to the wrong stream's processor.

This CL fixes this issue by introducing BroadcastResourceListener. By
listening to 1 resource (the injected one), it can spawn N "adapter"
resources that mirror's the injected resource's usage signal, allowing
all ResourceAdaptationProcessor's to react to the signal.

This is wired up in Call, and tests are updated to verify the signal
gets through.

Bug: chromium:1101263, webrtc:11720
Change-Id: I8a37284cb9a68f08ca1bdb1ee050b7144c451297
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178386
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31612}
2020-07-02 10:28:11 +00:00
Per Kjellander
4c50e70569 Ensure CreateTimeControllerBasedCallFactory use simulated time in Call::SharedModuleThread
Also removes unnecessary Call::SharedModulesThread ctor.

Bug: webrtc:11598
Change-Id: I6d6a7ca4359598fbbfd4ae1aa550be6227ea27e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178394
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31594}
2020-06-30 15:38:35 +00:00
Henrik Boström
f4a9991cce [Adaptation] Adding adaptation resources from Call.
This CL adds AddAdaptationResource to Call and
AddAdaptationResource/GetAdaptationResources method to relevant
VideoSendStream and VideoStreamEncoder interfaces and implementations.

Unittests are added to ensure that resources can be added to the Call
both before and after the creation of a VideoSendStream and that the
resources always gets added to the streams.

In a follow-up CL, we will continue to plumb the resources all the way
to PeerConnectionInterface, and an integration test will then be added
to ensure that injected resources are capable of triggering adaptation.

Bug: webrtc:11525
Change-Id: I499e9c23c3e359df943414d420b2e0ce2e9b2d56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177002
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@google.com>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31499}
2020-06-11 12:43:21 +00:00
Tommi
8edfe6e667 Remove unnecessary sequence checker.
Just use the task queue it represents instead.
Also rename the accessor to not confuse it with the 'network thread'.

Bug: none
Change-Id: Ic6c61652768ca3ff60dc0a2acc4850350feeb98e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176226
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31375}
2020-05-28 10:23:07 +00:00
Tommi
0d4647dffe Remove send_crit_, bitrate_crit_ and last_bandwidth_bps_crit_ locks.
...from the Call class.

With minimal shifting of ownership of a few variables, we can
maintain their state fully on the worker thread, where they're used.

This change also removes the dependency on RWLockWrapper.


Bug: webrtc:11612
Change-Id: Ia14be5bd6b50bd0b32d04f078b1e283080c00a19
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176122
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31360}
2020-05-26 19:43:10 +00:00
Tommi
31001a610d Remove receive_crit_ from Call.
This lock isn't needed anymore which has been clarified with recent
refactoring. Updated thread guards and related comments.

Change-Id: Ia7a1e59c45b67597264e73158654e4dffe6c4fc5
Bug: webrtc:11610
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176120
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31351}
2020-05-26 11:00:21 +00:00
Tommi
25c77c1aea Add SharedModuleThread class to share a module thread across Call instances.
This reduces the number of threads allocated per PeerConnection when
more than one PC is needed.

Bug: webrtc:11598
Change-Id: I3c1fd71705f90c4b4bbb1bc3f0f659c94016e69a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175904
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31347}
2020-05-25 17:21:56 +00:00
Tommi
04c94ad491 Fix misleading SequenceChecker variable name.
I named the network sequence checker 'worker' some time ago.
It represents the network TQ in RtpTransportControllerSendInterface
though, so should rather be called 'network'.

Bug: none
Change-Id: If82d7528b8cfcc180e1515b2fad63ed01610ec32
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175340
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31291}
2020-05-17 17:17:50 +00:00
Tommi
822a874463 Switch CallStats to TQ interface + callbacks on the worker thread.
Bug: webrtc:11489
Change-Id: I08c4cd42dfa28d88ed9f0aa8c8b2cfb606bf00df
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174240
Commit-Queue: Tommi <tommi@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31203}
2020-05-10 23:24:35 +00:00
Tommi
553c869c58 Start consolidating management/querying of stats on the Call thread.
Call is instantiated on what we traditionally call the 'worker thread'
in PeerConnection terms. Call statistics are however gathered, processed
and reported in a number of different ways, which results in a lot of
locking, which is also unpredictable due to the those actions themselves
contending with other parts of the system.

Designating the worker thread as the general owner of the stats, helps
us keeps things regular and avoids loading unrelated task queues/threads
with reporting things like histograms or locking up due to a call to
GetStats().

This is a reland of remaining changes from https://webrtc-review.googlesource.com/c/src/+/172847:
This applies the changes from the above CL to the forked files and
switches call.cc over to using the forked implementation.

Bug: webrtc:11489
Change-Id: I93ad560500806ddd0e6df1448b1bcf5a1aae7583
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174000
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31186}
2020-05-08 07:24:39 +00:00
Danil Chapovalov
cad3e0e2fa Replace DataSize and DataRate factories with newer versions
This is search and replace change:
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::Bytes<\(.*\)>()/DataSize::Bytes(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataSize::bytes/DataSize::Bytes/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BitsPerSec<\(.*\)>()/DataRate::BitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::BytesPerSec<\(.*\)>()/DataRate::BytesPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::KilobitsPerSec<\(.*\)>()/DataRate::KilobitsPerSec(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::bps/DataRate::BitsPerSec/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/DataRate::kbps/DataRate::KilobitsPerSec/g"
git cl format

Bug: webrtc:9709
Change-Id: I65aaca69474ba038c1fe2dd8dc30d3f8e7b94c29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168647
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30545}
2020-02-18 16:09:50 +00:00
Danil Chapovalov
0c626afcf3 Use newer version of TimeDelta and TimeStamp factories in webrtc
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g"
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g"
git cl format

Bug: None
Change-Id: I87469d2e4a38369654da839ab7c838215a7911e7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168402
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30491}
2020-02-10 12:21:17 +00:00
Harald Alvestrand
977b265702 Reduce some logging at INFO level by moving log statements
from LS_INFO to LS_VERBOSE.

By default, unit tests run with logging at info level.
A random run today produced more than 70.000 lines of
output. This CL would reduce that by approximately 15.000.

Bug: none
Change-Id: Ie62708cebf109510a2443aa5ab5c4e645ffc6707
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161950
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30077}
2019-12-12 21:54:06 +00:00
Erik Språng
17f82cfc68 Verifies trials are populated when creating a Call.
This check just makes it more clear what the expectations are.

Pululating trials was made mandatory in an earlier CL, but if you don't
populate this field it will trigger a DCHECK at lower layer where we're
actually trying to parse an experiment. That is confusing and
misleading.

Bug: None
Change-Id: I1f520841a5a3b911048c8ee6d309eb7bb179e037
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161301
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30005}
2019-12-04 13:36:02 +00:00
Erik Språng
662678dbf7 Adds injectable trials from peerconnection down to transport controller.
This will be immediately useful to guarantee consistent state across
components referencing the pacer, but will be a net benefit overall
imo.

Bug: webrtc:10809
Change-Id: I49630696f757a832ccf2e4c8597193bf087ce53b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159885
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29859}
2019-11-21 12:41:45 +00:00
Ivo Creusen
c3d1f9b0cd Enable injection of a custom NetEqFactory into PeerConnectionFactory.
Injecting both a custom NetEqFactory and an AudioDecoderFactory is not
supported, in that case the AudioDecoderFactory should be wrapped inside
the NetEqFactory.

Bug: webrtc:11005
Change-Id: I4e311eb1bfa03c91bca587d70540e81829f881c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158720
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29673}
2019-11-01 11:30:36 +00:00