webrtc/api/task_queue
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
..
test Reformat gn files 2025-07-31 15:58:59 -07:00
BUILD.gn Disable TQ coroutine experimental tests in chromium builds 2025-11-13 16:31:50 -08:00
default_task_queue_factory_gcd.cc Comment unused variables in implemented functions 7\n 2024-10-28 12:04:15 +00:00
default_task_queue_factory_stdlib.cc Reland "Add TaskQueueStdlib experiment." 2022-08-29 10:48:42 +00:00
default_task_queue_factory_unittest.cc
default_task_queue_factory_win.cc Reland "Add TaskQueueStdlib experiment." 2022-08-29 10:48:42 +00:00
default_task_queue_factory.h Reland "Add TaskQueueStdlib experiment." 2022-08-29 10:48:42 +00:00
DEPS Fix malformed DEPS files in WebRTC. 2026-02-17 09:47:27 -08:00
pending_task_safety_flag_unittest.cc Use webrtc name specifier instead of rtc/cricket in api 2025-04-15 22:17:02 -07:00
pending_task_safety_flag.cc Use webrtc name specifier instead of rtc/cricket in api 2025-04-15 22:17:02 -07:00
pending_task_safety_flag.h Add encoder switch request callback to VideoMediaSendChannel 2026-03-13 03:44:12 -07:00
task_queue_base.cc Apply include-cleaner to api/task_queue 2024-08-06 13:32:04 +00:00
task_queue_base.h Apply include-cleaner to api/task_queue 2024-08-06 13:32:04 +00:00
task_queue_factory.h TaskQueueFactory: Add kAudio and kVideo priorities 2026-01-26 06:18:27 -08:00
task_queue_test.cc Implement cooperative yielding and high-priority tasks in Thread 2026-03-04 23:05:37 -08:00
task_queue_test.h Disable TQ coroutine experimental tests in chromium builds 2025-11-13 16:31:50 -08:00