Commit Graph

110 Commits

Author SHA1 Message Date
Tommi
e429887d22 Add encoder switch request callback to VideoMediaSendChannel
Introduce a callback mechanism to intercept and handle encoder switch
requests within the video media engine. This makes it so that codec
switch/fallback requests first go through the the RtpTransceiver on the
signaling thread. That is consistent with other parameter related
changes and allows the transceiver to update the sender object(s) before
the codec change is applied.

Specifically, the changes include:
* Define EncoderSwitchRequestCallback and EncoderSwitchRequestAction
  in VideoMediaSendChannelInterface.
* Updating WebRtcVideoSendChannel to optionally use the callback
  instead of posting directly to the worker thread when an encoder
  switch is requested.
* Implementing GetEncoderSwitchRequestCallback in RtpTransceiver
  to ensure that when a switch occurs, cached RTP parameters on the
  signaling thread are cleared before the switch action is executed
  on the worker thread.
* Updating RtpSender to support clearing cached parameters via
  std::optional.
* Adding RTC_DCHECK to SafeTask and SafeInvocable to catch if
  the provided safety flag is invalid, early.

Bug: b/478050997
Change-Id: Id81a219a0f3dab6a167248c21513723504fa6e79
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/454700
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Sameer Vijaykar <samvi@google.com>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47148}
2026-03-13 03:44:12 -07:00
Tommi
a834081367 Implement cooperative yielding and high-priority tasks in Thread
Introduce mechanisms within the Thread class to support cooperative
multitasking. This allows long-running tasks to voluntarily yield
execution to pending high-priority work, improving responsiveness and
mitigating latency issues like audio glitches that can occur during
heavy operations such as session negotiation.

Key modifications:
- Add IsYieldRequested() to allow tasks to check for pending yield
  requests.
- Implement PostHighPriorityTask() to insert urgent tasks into a
  dedicated queue and signal a yield request on the target thread.
- Track nested synchronous blocking calls to catch when yielding in
  unsafe contexts, enforced via RTC_DCHECK.
- Ensure high-priority tasks are processed before regular tasks when the
  thread resumes execution.

# no-try: persistent webrtc_linux_chromium infra failure

No-try: true
Bug: webrtc:42223005
Change-Id: I093b7e04d665baef19085e72bc0548447fd6768c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/450561
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47056}
2026-03-04 23:05:37 -08:00
Jeremy Leconte
114ea00794 Fix malformed DEPS files in WebRTC.
Bug: webrtc:447469714
Change-Id: I4a18d0d609d175f83942583d36eb7453e2507983
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/449981
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46931}
2026-02-17 09:47:27 -08:00
Markus Handell
4a51622705 TaskQueueFactory: Add kAudio and kVideo priorities
This change introduces specific priority levels for audio and
video tasks within the TaskQueueFactory to allow for better
platform-specific thread scheduling.

Changes:

* New field trial WebRTC-MediaTaskQueuePriorities that activates the
  priority change.

* New Priority Enums: Added kVideo and kAudio to
TaskQueueFactory::Priority and corresponding kVideo and
kAudio to ThreadPriority.

* WebRTC platform thread implementation:
- Video priority initially maps to high priority.
- On Mac/iOS (GCD), both audio and video map to
  DISPATCH_QUEUE_PRIORITY_HIGH because of API limitation.

* Task queue updates:
- Updated the audio encoder queue to use kAudio priority.
- Updated the video encoder & decoder, incoming video
  stream, and video frame transformer queues to use kVideo priority.

* Queue renaming: Standardized several task queue names by
   appending "Queue" (e.g., "AudioEncoder" became "AudioEncoderQueue").

Bug: chromium:470337728
Change-Id: I4790990340a72a54945750c2c4e1f97314edf375
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/436580
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46744}
2026-01-26 06:18:27 -08:00
Markus Handell
6461ca7c3e TaskQueueFactory: implement go/cstyle#Enumerator_Names
We're about to add two new priorities. Ensure we're
respecting go/cstyle#Enumerator_Names before adding them.

WANT_LGTM=ANY

Bug: chromium:470337728
Change-Id: I01c6f237a7c67df6a3083f1165ee07bffc9d3523
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/443420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46740}
2026-01-26 02:38:24 -08:00
Tommi
ae3936599b Reland "Add test for QueueUserAPC compatibility"
This is a reland of commit 091aaa3655

The reland also checks for `!defined(WEBRTC_CHROMIUM_BUILD)`

Original change's description:
> Add test for QueueUserAPC compatibility
>
> This has always been supported in the default implementation but the
> Thread and stdlib thread implementations don't have this yet.
>
> Bug: none
> Change-Id: Ic82733d0d49267231404d5525bc49342eae83c09
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/428902
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#46357}

Bug: none
Change-Id: Ia2e4eb3e3bb926fe725057bc093338a3ce56b953
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/429662
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46480}
2025-12-12 11:14:09 -08:00
Tomas Gunnarsson
f71da68b64 Revert "Add test for QueueUserAPC compatibility"
This reverts commit 091aaa3655.

Reason for revert: Broke chromium import.
https://ci.chromium.org/ui/p/chromium/builders/try/win-arm64-compile-dbg/662831/overview

Original change's description:
> Add test for QueueUserAPC compatibility
>
> This has always been supported in the default implementation but the
> Thread and stdlib thread implementations don't have this yet.
>
> Bug: none
> Change-Id: Ic82733d0d49267231404d5525bc49342eae83c09
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/428902
> Reviewed-by: Markus Handell <handellm@webrtc.org>
> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#46357}

Bug: none
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I711065d4244f5f4b4c4bf30954ef5d64d036cf64
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/429661
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46363}
2025-12-01 08:53:40 -08:00
Tommi
091aaa3655 Add test for QueueUserAPC compatibility
This has always been supported in the default implementation but the
Thread and stdlib thread implementations don't have this yet.

Bug: none
Change-Id: Ic82733d0d49267231404d5525bc49342eae83c09
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/428902
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46357}
2025-12-01 02:56:48 -08:00
Tommi
6e4b5cf129 Disable TQ coroutine experimental tests in chromium builds
No-Iwyu: false positive.
Bug: none
Change-Id: I698988e683551d0b1148db76240af0907660f634
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/425560
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46189}
2025-11-13 16:31:50 -08:00
Tommi
fb5a4a9ff3 Add a test for a synchronous (not asynchronous) TQ coroutine
This patch introduces a new test case, `CoroutineSynchronous`, to verify
the behavior of a coroutine that is intended to execute synchronously.

The coroutine, `ActuallySynchronous`, uses `co_await` to switch to the
already-current task queue. This specific usage should result in
immediate execution without introducing any asynchronous operations or
task posting, as the destination is already the current queue.

A related change is also included in the existing `Coroutine` test to
add an expectation that the coroutine's final callback is not invoked
immediately after the coroutine is launched, confirming its asynchronous
nature.

Bug: none
Change-Id: Ic9e122759029c8db077a6cafa925818e98e7da56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/424982
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46178}
2025-11-13 04:52:25 -08:00
Tommi
c59ae902f8 A minimalistic coroutine implementation on top of TQ
Bug: none
No-Iwyu: Something is up with the iwyu bot.
Change-Id: Ie0106044e0705f812e7914eb96f3142a04345a6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/424620
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46162}
2025-11-11 06:44:27 -08:00
Harald Alvestrand
306943dd4e Demonstrate a trampoline for step 1 of Sigslot removal
This demonstrates use of a trampoline so that callers to sigslot
functions can use lambda functions without any other changes.

Bug: webrtc:42222066
Change-Id: I815d390b383f7a55a854ac5dc0b09f0a6b28414d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/406060
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45433}
2025-08-26 02:56:45 -07:00
Philipp Hancke
d26ff67890 Reformat gn files
using
  git ls-files | grep BUILD.gn | xargs gn format
which seems to induce a shorter notation for cases like
-  "../../api/rtc_event_log:rtc_event_log",
+  "../../api/rtc_event_log",
now.

Bug: None
Change-Id: I362627095f3d0391603d9f642d14fdadba58ca66
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/402860
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45257}
2025-07-31 15:58:59 -07:00
Danil Chapovalov
10fab302f2 Reduce usage of public sources in build files
Using public has additional unintential consequence of allowing transitive dependencies and should generally be avoided.

Bug: None
Change-Id: I7655c09e9e8ec49c33751db990428f5a95e15332
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399260
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45096}
2025-07-04 09:46:49 -07:00
Danil Chapovalov
5682d46450 Tighten environment_construction poison
Poison concrete class for FieldTrials to prevent webrtc internal code create own field trials.
Poison task queue factory for ios and android as exception are now explicitly marked.

Bug: webrtc:42220378
Change-Id: I768fef6411c250075d4f4ac0292196f33cd018b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/393563
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45084}
2025-07-03 05:52:38 -07:00
Harald Alvestrand
3d12066526 Remove redundant webrtc:: prefixes in api
Created by
tools_webrtc/remove_extra_namespace.py --namespace webrtc

and manual adjustments.

This CL was uploaded by git cl split.

R=eshr@webrtc.org

No-IWYU: Refactoring
Bug: webrtc:42232595
Change-Id: Iaa0f996efce0bc521d3558e4e531ef603a9d8890
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/396160
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44914}
2025-06-11 10:27:01 -07:00
Evan Shrubsole
2f5c266239 [cleanup] Fix redundant webrtc name specifier
This CL was uploaded by git cl split.

R=hta@webrtc.org

No-Iwyu: LSC
Bug: webrtc:42232595
Change-Id: Ia71cdef9e95eec403edf857dd3d01bd8348e4a64
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/390560
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44588}
2025-05-12 03:42:48 -07:00
Evan Shrubsole
ee5ab349f3 Use webrtc name specifier instead of rtc/cricket in api
WebRTC has unified all namespaces to webrtc, and the rtc:: and cricket::
name specifiers need to be replaced with webrtc::. This was generated using
a combination of clang AST rewriting tools and sed.

This CL was uploaded by git cl split.

Bug: webrtc:42232595
Change-Id: Ie05cf23955a3417937fc1dd56d00dda679d1a59e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/386641
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44384}
2025-04-15 22:17:02 -07:00
Philipp Hancke
af4395afcb IWYU api/
using
  find api/ -name "*.h" -o -name "*.cc" | grep -v priority.h | xargs tools_webrtc/iwyu/apply-include-cleaner
followed by
  tools_webrtc/gn_check_autofix.py -C out/Default/
and git cl format

Manual changes:
- api/test/compile_all_headers.cc: add IWYU keep pragma
- api/video/nv12_buffer.cc: fix include part of libyuv/convert_from.h
- DEPS changes

priority.h is excluded as it is currently a header-only target. Will be fixed as a follow-up.

A generated histogram.pb.h is included from
api/test/metrics/chrome_perf_dashboard_metrics_exporter_test.cc
since it is not directly exported by catapult.

BUG=webrtc:42226242

Change-Id: Idce13d892c61ae71bf4f39bd5ffa4638a3d7f8fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/382120
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#44374}
2025-04-14 17:11:00 -07:00
Mirko Bonadei
3672d60543 Migrate template alias nullability annotations to macros.
absl::Nonnull -> absl_nonnull, absl::Nullable -> absl_nullable,
and absl::NullabilityUnknown -> absl_nullability_unknown.

The new macros are positioned as a qualifier on the affected type,
similar to const, rather than as a templated type wrapping the affected
type.

Bug: webrtc:407433459
No-Iwyu: No regressions introduced by this CL
Change-Id: Id6b1a58296d52c86db3ae44e90849affc904d335
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/384220
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44301}
2025-04-04 15:23:56 -07:00
Philipp Hancke
27a99b1554 Remove libevent tasks queue factory
which is now unused. Also remove libevent from DEPS and
generate_licenses.py

BUG=webrtc:42224654

Change-Id: I30aceaa304b4c6fb23e8485172f38bdaf18daf2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/382581
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#44216}
2025-03-25 12:12:22 -07:00
Evan Shrubsole
652c771f05 Move time_utils.h and crypto_random.h to webrtc namespace
Bug: webrtc:42232595
Change-Id: I06d836b6ee37d94b1b79279d886bf841f228b778
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/382201
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44182}
2025-03-21 04:02:28 -07:00
Evan Shrubsole
39c1c7ef8a Move event.h to webrtc namespace
Bug: webrtc:42232595
Change-Id: I062f383fdcde2a5458c99e649e80f531b4676da0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/381941
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44173}
2025-03-20 05:05:29 -07:00
Markus Handell
74ace1a6e3 Remove libevent task queue.
Previous CLs that disabled the rtc_enable_libevent build flag
did not reveal issues. Now continue to remove the source code for
the task queue.

Bug: webrtc:42224654
Change-Id: I0866b4b56f0a8d8b56a5b604c31a426d77ab8d04
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370801
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43550}
2024-12-12 08:43:25 -08:00
Dor Hen
90c67e7729 Comment unused variables in implemented functions 7\n
Bug: webrtc:370878648
Change-Id: Id0a2c73b7055267de93d5301bd73e6212cf64794
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366261
Commit-Queue: Dor Hen <dorhen@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43315}
2024-10-28 12:04:15 +00:00
Markus Handell
2548d224dc WebRTC-TaskQueue-ReplaceLibeventWithStdlib: Launch stdlib task queue.
Bug: b/42224654
Change-Id: Ib55420fca40a993790eff3e554ed02d6b3731a6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362780
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43050}
2024-09-19 10:33:24 +00:00
Mirko Bonadei
a8dd3a36fa Add missing dependency.
Bug: None
Change-Id: I864ee21709f1e7e4622c4f4717eab2de64cf64b2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358640
Commit-Queue: Christoffer Dewerin <jansson@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Christoffer Dewerin <jansson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42735}
2024-08-07 07:00:06 +00:00
Dor Hen
5ac2c74022 Apply include-cleaner to api/task_queue
Bug: webrtc:42226242
Change-Id: Ieee3dddf72eb8ecea699be87f05a59036670f3d9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358500
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Cr-Commit-Position: refs/heads/main@{#42729}
2024-08-06 13:32:04 +00:00
Florent Castelli
99c519b3fd Mass removal of absl_deps in all BUILD.gn files
Bug: webrtc:341803749
Change-Id: Id73844ba8d63b9f2f2c9391d8d8116ad0864c36d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351540
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42372}
2024-05-23 15:09:46 +00:00
Danil Chapovalov
dcc1534764 Delete rtc::TaskQueue
All usage was updated to use TaskQueueBase interface directly bypassing rtc::TaskQueue wrapper

Bug: webrtc:14169
Change-Id: I1808afd363b50448d4014d8d8402fce41b16a3ff
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/341082
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41834}
2024-02-28 10:22:49 +00:00
Philipp Hancke
8e2ab67045 Do not use Windows default task queue when building with Chromium
as this includes the deprecated timeKillEvent symbol which leads
to runtime errors on platforms where this is already removed.

See discussion in
  https://webrtc-review.googlesource.com/c/src/+/328860
for why this causes problems.

BUG=webrtc:15656

Change-Id: I95d07ceed105d35ac76fe97dbd1c454de398f52e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333260
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41468}
2024-01-03 13:30:39 +00:00
Danil Chapovalov
9fdceb80b5 Add environment_construction poison
This poison guards against accidental use of EnvironmentFactory and thus ensures low level WebRTC class would use utilities from propagated environment instead of accidentally using a default implementation.

This poison extends and thus replaces default task queue poison.

Bug: webrtc:15656
Change-Id: I577bef8af08b9c7dd649ad5a2284eb236e6f4a8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328380
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41247}
2023-11-27 11:44:50 +00:00
Markus Handell
9c69c4625b Revert "Measure wall clock time of capture and encode processing."
This reverts commit 8039cdbe48.

Reason for revert: remove functionality after measurement complete

Original change's description:
> Measure wall clock time of capture and encode processing.
>
> (NOTE: This and dependent CLs will be reverted in a few days after
> data collection from the field is complete.)
>
> This change introduces a new task queue concept, Voucher. They
> are associated with a currently running task tree. Whenever
> tasks are posted, the current voucher is inherited and set as
> current in the new task.
>
> The voucher exists for as long as there are direct and indirect
> tasks running that descend from the task where the voucher was
> created.
>
> Vouchers aggregate application-specific attachments, which perform
> logic unrelated to Voucher progression. This particular change adds
> an attachment that measures time from capture to all encode operations
> complete, and places it into the WebRTC.Video.CaptureToSendTimeMs UMA.
>
> An accompanying Chrome change crrev.com/c/4992282 ensures survival of
> vouchers across certain Mojo IPC.
>
> Bug: chromium:1498378
> Change-Id: I2a27800a4e5504f219d8b9d33c56a48904cf6dde
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325400
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41061}

Bug: chromium:1498378
Change-Id: I9503575fbc52f1946ca26fc3c17b623ea75cd3c5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327023
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41135}
2023-11-11 18:03:40 +00:00
Harald Alvestrand
78f905e5cc Move some users to use webrtc::RefCountInterface
Bug: webrtc:15622
Change-Id: I2d4c20c726af1a052e161b7689a73d1e5e3eb191
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325526
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41067}
2023-11-02 14:45:57 +00:00
Markus Handell
8039cdbe48 Measure wall clock time of capture and encode processing.
(NOTE: This and dependent CLs will be reverted in a few days after
data collection from the field is complete.)

This change introduces a new task queue concept, Voucher. They
are associated with a currently running task tree. Whenever
tasks are posted, the current voucher is inherited and set as
current in the new task.

The voucher exists for as long as there are direct and indirect
tasks running that descend from the task where the voucher was
created.

Vouchers aggregate application-specific attachments, which perform
logic unrelated to Voucher progression. This particular change adds
an attachment that measures time from capture to all encode operations
complete, and places it into the WebRTC.Video.CaptureToSendTimeMs UMA.

An accompanying Chrome change crrev.com/c/4992282 ensures survival of
vouchers across certain Mojo IPC.

Bug: chromium:1498378
Change-Id: I2a27800a4e5504f219d8b9d33c56a48904cf6dde
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325400
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41061}
2023-11-01 16:10:17 +00:00
Tommi
fd3b346e27 Allow absl::Nonnull and absl::Nullable.
This CL includes follow-up changes from
https://webrtc-review.googlesource.com/c/src/+/324280

Bug: none
Change-Id: I6abad16e05cac7197c51ffa7b1d3fb991843df6e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325243
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41030}
2023-10-27 22:00:50 +00:00
Tommi
8da5953fb2 Support initializing PendingTaskSafetyFlag with a specific TaskQueue.
Bug: none
Change-Id: I0f354708e6275372601adc36da3012259bb57303
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324280
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41008}
2023-10-25 20:39:36 +00:00
Markus Handell
a84368c3d3 TaskQueueBase: use C++17.
Fixed: webrtc:15371
Bug: webrtc:15371
Change-Id: I8bdcd733a7f43eb5e91986dfa478ad41e5074afd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/320020
Auto-Submit: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40869}
2023-10-05 10:04:47 +00:00
Tommi
66bf3f472c Make PendingTaskSafetyFlag compatible with component builds
Bug: chromium:1470992
Change-Id: I06cec9cda36c9de75b970eaf709f9ed3b9f466b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317620
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40618}
2023-08-24 14:24:49 +00:00
Per K
18aba66271 Add test to ensure task deleted on TQ
Bug: webrtc:14449
Change-Id: I85757af9c1ad6ad630d9ffe7b2528ca7c7161883
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/308900
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40301}
2023-06-16 14:33:13 +00:00
Markus Handell
ae61aca9b1 Implement support for Chrome task origin tracing. #3.7/4
This CL completes migration to the new TaskQueueBase interface
permitting location tracing in Chrome.

Bug: chromium:1416199
Change-Id: Iff7ff5796752a1520384a3db0135a1d4b9438988
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294540
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39439}
2023-03-01 14:20:03 +00:00
Markus Handell
a1ceae206b Implement support for Chrome task origin tracing. #3.5/4
This CL migrates unit tests to the new TaskQueueBase interface.

Bug: chromium:1416199
Change-Id: Ic15c694b28eb67450ac99fdd56754de1246a4d95
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/295621
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39434}
2023-03-01 11:11:37 +00:00
Markus Handell
2a256c82ec Implement support for Chrome task origin tracing. #2/4
This prepares TaskQueueBase sub classes to be able to migrate to
the location and traits-based API. It re-introduces a Location class
into the webrtc namespace, which is meant to be overridden by Chromium.

Bug: chromium:1416199
Change-Id: I712c7806a71b3b99b2a2bf95e555b357c21c15ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/294381
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39400}
2023-02-27 13:17:38 +00:00
Markus Handell
82da9324bc Ensure task queues delete closures in task queue context.
Bug: webrtc:14449
Change-Id: I90d09d35398c1f8817701662f51cbc6a684a2fe0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275773
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38917}
2022-12-19 10:41:03 +00:00
Florent Castelli
123a0ed604 Revert "Add checks for api/test mocks to make sure they're complete"
This reverts commit e87ec28b80.

Reason for revert: Breaks upstream.

Original change's description:
> Add checks for api/test mocks to make sure they're complete
>
> Also unifies the mock inheritance if they inherited from a ref counted
> interface:
>  - it should only inherit from the interface
>  - it should use make_ref_counted
>
> Bug: webrtc:14594
> Change-Id: I7b0514b632ccd0798028b50f19812ac0a196e13c
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262423
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38602}

Bug: webrtc:14594
Change-Id: I9f2d9c3656b43e3006ec03ae7d792d0a53f47ebd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282940
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#38604}
2022-11-10 13:33:59 +00:00
Florent Castelli
e87ec28b80 Add checks for api/test mocks to make sure they're complete
Also unifies the mock inheritance if they inherited from a ref counted
interface:
 - it should only inherit from the interface
 - it should use make_ref_counted

Bug: webrtc:14594
Change-Id: I7b0514b632ccd0798028b50f19812ac0a196e13c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262423
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38602}
2022-11-10 12:47:31 +00:00
Markus Handell
f76a823132 Enable Chromium's rtc::ThreadWrapper to use TaskQueueTest.
Bug: webrtc:14449
Change-Id: Ie279cb3b2610ba561ca4b2e2a8e1b10ab2c795e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/275943
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38117}
2022-09-19 15:40:19 +00:00
Ali Tofigh
4b6819434d Reland "Add TaskQueueStdlib experiment."
This is a reland of commit 83db78e854

Original change's description:
> Add TaskQueueStdlib experiment.
>
> Bug: webrtc:14389
> Change-Id: I23c6e0ae675748ec35a99c334104dd2654995a33
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265802
> Commit-Queue: Ali Tofigh <alito@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37888}

Bug: webrtc:14389
Change-Id: If84c7043e5f0f63ae8d9eae651daf900a72f2ee3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273320
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37923}
2022-08-29 10:48:42 +00:00
Ali Tofigh
e7e3d5925a Revert "Add TaskQueueStdlib experiment."
This reverts commit 83db78e854.

Reason for revert: Some tests in Chromium's blink no longer compile because of the change in the signature of the CreateDefaultTaskQueueFactory() function.

Original change's description:
> Add TaskQueueStdlib experiment.
>
> Bug: webrtc:14389
> Change-Id: I23c6e0ae675748ec35a99c334104dd2654995a33
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265802
> Commit-Queue: Ali Tofigh <alito@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37888}

Bug: webrtc:14389
Change-Id: If3e63d6b4ab9e838dc5020b88076a73fd29916e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/272920
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37902}
2022-08-25 12:41:05 +00:00
Ali Tofigh
83db78e854 Add TaskQueueStdlib experiment.
Bug: webrtc:14389
Change-Id: I23c6e0ae675748ec35a99c334104dd2654995a33
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265802
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37888}
2022-08-24 11:28:39 +00:00