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} |
||
|---|---|---|
| .. | ||
| test | ||
| BUILD.gn | ||
| default_task_queue_factory_gcd.cc | ||
| default_task_queue_factory_stdlib.cc | ||
| default_task_queue_factory_unittest.cc | ||
| default_task_queue_factory_win.cc | ||
| default_task_queue_factory.h | ||
| DEPS | ||
| pending_task_safety_flag_unittest.cc | ||
| pending_task_safety_flag.cc | ||
| pending_task_safety_flag.h | ||
| task_queue_base.cc | ||
| task_queue_base.h | ||
| task_queue_factory.h | ||
| task_queue_test.cc | ||
| task_queue_test.h | ||