Commit Graph

3755 Commits

Author SHA1 Message Date
Miriam Zimmerman
31a3397e96 Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148
Merge conflicts resolved in:
* api/neteq/neteq.h
* audio/channel_receive.cc
* audio/channel_receive.h
* media/engine/simulcast_encoder_adapter.cc
* modules/audio_coding/BUILD.gn
* modules/audio_coding/acm2/acm_resampler.cc
* modules/audio_coding/acm2/acm_resampler_unittest.cc
* modules/audio_processing/audio_processing_impl.h
* modules/video_coding/BUILD.gn
* p2p/base/p2p_transport_channel_unittest.cc
* pc/jsep_transport_controller.cc
* pc/rtp_transport.h
* pc/rtp_transport_internal.h
* unsafe_buffers_paths.txt
2026-05-08 13:42:18 -04:00
Jim Gustafson
a75b0fbe22
Integrate Opus DRED
Co-authored-by: Michael Klingbeil <klingm@amazon.com>
2026-04-30 13:15:32 -07:00
Jim Gustafson
7cb77447b6 Add opus dnn weights support for encoder and decoder 2026-04-20 15:19:18 -07:00
Jim Gustafson
3e0983ebcb Add fields for dred support to the opus encoder configuration 2026-04-20 11:12:30 -07:00
Jim Gustafson
45f30269e4 Add opus decoder configuration plumbing 2026-04-20 11:06:14 -07:00
Adel Lahlou
a5d71d3557 m146 merge fixes 2026-04-06 00:19:39 -07:00
Adel Lahlou
d46d62e9eb Merge remote branch 'upstream/branch-heads/7680' 2026-04-06 00:16:11 -07:00
Danil Chapovalov
52e8522cb7 Replace ArrayView with std::span in api/
ArrayView is an alias to std::span. This change switch to use
std::span directly instead of through the alias.

Search&Replace MakeArrayView and ArrayView with std::span
Search&Replace include "api/array_view.h" with include <span>
Remove <span> include where std::span is not mentioned in the file
Remove build dependencies on array_view target

Updated comment in audio_frame.cc to be more accurate matching one of
the behavior changes between ArrayView and std::span

Bug: webrtc:439801349
Change-Id: Iec42e1bf3ff5539211e8a4c85773ba08cf1412dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/461060
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47315}
2026-04-02 00:13:26 -07:00
Jesús de Vicente Peña
e10cd19640 Audio: Enable dynamic on-the-fly AEC3 configuration updates for the suppressor gain computation
This CL refactors suppression gain to allow dynamic configuration changes without requiring reinitialization. This allows switching to a specific ML-REE configuration once the linear mode is used.

These changes are bitexact when not running the neural residual echo estimator. The refinement in MovingAverageSpectrum does not introduce  any change when the residual residual echo estimator is disabled. When running neural residual echo estimator, there is a reduction of initial echo blips for recordings that manifest such issue.

Bug: webrtc:442444736
No-Iwyu: Not changing the tflite includes.
Change-Id: If7c7bdb55ab5a95bb846ea75d45fe5b6387a2fea
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/456140
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47303}
2026-04-01 01:39:37 -07:00
Danil Chapovalov
5a90c2dc89 Delete deprecated reinterpret_array_view
Bug: webrtc:439801349
Change-Id: I61cdbef2b6f5e30b561766356258a463087db9de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/461280
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47302}
2026-04-01 00:31:09 -07:00
Erik Språng
f1c55505df Move the LibaomAv1Encoder V2 encoder implementation to separate file.
This makes it easier to work with than when it's a prive class in the
encoder factory implementation.

Bug: webrtc:496266459
Change-Id: Ib7f167494f8f19a63ac0a490f5c34212e0765cdc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460380
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47297}
2026-03-30 08:01:31 -07:00
Harald Alvestrand
830e031e2c Use the PayloadType class rather than uint8_t in Codec class
Also replace "int" with "PayloadType" in a number of interfaces, and
make appropriate adjustments.

This is one step towards controlling the issuing and consumption
of PayloadType values.

Bug: webrtc:360058654
Change-Id: I146bc4e3e9966b98864277eee6f52b75ba10d89a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460021
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47286}
2026-03-27 07:22:47 -07:00
Tommi
fe2da40be5 Audio: Reduce max channels to 16 to prevent buffer overflow
Lowers kMaxNumberOfAudioChannels from 24 to 16 to fit within the statically allocated AudioFrame buffer (7680 max samples) when resampling at 48kHz (7680 = 16 channels * 480 samples). Also implies safe channel capping in resampler to prevent buffer overflows.

Bug: webrtc:495018167
Change-Id: I60b30832b34508deff036a3a63fcabac1a35c889
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460680
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47284}
2026-03-27 05:19:06 -07:00
Harald Alvestrand
53987851c6 Convert kMax constants in video_codec_constants to size_t
There was a pattern of having to cast these to size_t when comparing
them to sizes of things. Since these are mostly used for sizing
arrays and lists, it seems logical to make them size_t.

Bug: None
Change-Id: I77e0642dfc0937e6367034af10b27f1ba95b495b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/459400
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47281}
2026-03-27 05:02:29 -07:00
Tommi
bb96cbad59 Spring cleanup of WATCHLIST and OWNER files
Bug: none
Change-Id: I168e1f456905c96e57066721543ed9cd8925e4b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460420
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47269}
2026-03-26 09:19:09 -07:00
Jakob Ivarsson
84c9fda5cb Initialize NetEqNetworkStatistics fields.
Bug: None
Change-Id: I40fd4039db67d92de41ea637832840b1623c76ce
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460000
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47260}
2026-03-25 05:32:52 -07:00
Evan Shrubsole
8551776812 Add gtest-parallel skill
Bug: webrtc:465491622
Change-Id: I94531c0098b71093ff439f68d82b36db6a6a6964
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/459720
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47259}
2026-03-25 04:19:57 -07:00
Shaofan Qi
9f4a5163fa Use subset profile matching for H.264 decoder support
Bug: webrtc:347724928
Change-Id: Ia71b907b7f5af1e3acb9ed4959bd52378e80ccb9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/432780
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47253}
2026-03-25 02:07:47 -07:00
Tommi
5e177d2171 Harden SimpleStringBuilder safety checks
Replace RTC_DCHECK with RTC_CHECK in SimpleStringBuilder to ensure
safety constraints are enforced in all build configurations, including
release builds. This change prevents undefined behavior or silent
truncation by crashing when a buffer overflow is detected, rather than
only performing these checks in debug modes.

The modifications include:
* Updating SimpleStringBuilder to use RTC_CHECK for consistency and
  bounds verification.
* Simplifying RtpExtension::ToString and VideoReceiveStream2 by
  migrating from SimpleStringBuilder to StringBuilder.
* Simplify+clarify the StringBuilder::Release implementation.
* Update unit tests to reflect that overflow now consistently results
  in a crash.

Bug: chromium:486536241
Change-Id: Ia067508e2b9409154ad4afdbe4c0971a1dd32e1e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/459441
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47251}
2026-03-25 01:02:30 -07:00
Jeremy Leconte
a875e8cb67 build: clean up api/BUILD.gn libjingle_peerconnection_api target
this is a follow up for https://webrtc-review.git.corp.google.com/c/src/+/455821

Bug: webrtc:467294026
Change-Id: I3d7c5129e58b9f5fd6d2ccb958458823de89ac00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/457900
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#47250}
2026-03-25 00:43:29 -07:00
Harald Alvestrand
e68d24dceb Replace LOG_AND_RETURN_ERROR with "return LOG_ERROR"
Deletes the LOG_AND_RETURN_ERROR and LOG_AND_RETURN_ERROR_EX macros.
This makes for code that is easier to read.

Bug: None
Change-Id: I9ce0de3c2f6337def0ae8a3d626fd3374d4bebe0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/459600
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47240}
2026-03-24 03:52:49 -07:00
kwasniow
1aacbbfc7a Sframe API support for sender and receiver
This CL introduces the public API surface for Sframe (Secure Frame)
encryption and decryption on RTP senders and receivers. The actual
pipeline wiring is deferred to a follow-up CL; all factory methods
currently return nullptr.

New API headers (api/sframe/):

- sframe_types.h: shared enums SframeMode (per-frame / per-packet)
  and SframeCipherSuite (AES-CTR-HMAC variants, AES-GCM-128/256).
- sframe_encrypter_interface.h: SframeEncrypterInit config struct
  and SframeEncrypterInterface for sender-side key management
  (SetEncryptionKey).
- sframe_decrypter_interface.h: SframeDecrypterInit config struct
  and SframeDecrypterInterface for receiver-side key management
  (AddDecryptionKey, RemoveDecryptionKey).

Interface changes:

- RtpSenderInterface gains CreateSframeEncrypter(SframeEncrypterInit)
- RtpReceiverInterface gains CreateSframeDecrypter(SframeDecrypterInit)
- Both proxy files updated with corresponding PROXY_METHOD entries.

New RtpReceiverBase class introduced inheriting RtpReceiverInternal,
providing CreateSframeDecrypter. This mirrors the existing RtpSenderBase
pattern. AudioRtpReceiver and VideoRtpReceiver now inherit
RtpReceiverBase instead of RtpReceiverInternal, eliminating future code
duplication.

Bug: webrtc:479862368
Change-Id: I2d62b61f2d10325d8dca9f15f08a0eb0509eed01
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/452260
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47224}
2026-03-22 01:34:08 -07:00
Henrik Boström
dcb0c0d4b9 Make Evan and Guido peer_connection/webrtc_sdp co-owners.
Bug: None
Change-Id: If284d998572e31c82439d975cbe8b090c24feb4a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/458280
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47204}
2026-03-19 06:01:26 -07:00
Henrik Boström
c055986891 Make Evan co-owner of WebRTC stats directories.
Bug: None
Change-Id: Ibdd2e7fe0463ddc8626a87a5fd63e656f920b4e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/458260
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Auto-Submit: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47203}
2026-03-19 05:52:19 -07:00
Evan Shrubsole
210a0991ff Revert "Removed the configuration options for multi_channel processing"
This reverts commit db6adf2e9f.

Reason for revert: Breaks webrtc=>chrome roll https://crrev.com/c/7672366

Original change's description:
> Removed the configuration options for multi_channel processing
>
> This CL removes the explicit configuration options for whether
> the audio processing should be performed in a multi- or
> single-channel manner.
> This change means that the choice of whether to do multi- or
> single-channel audio processing will be made based on the
> content of the audio sent to APM for processing, and the
> audio output requested by APM.
>
> Bug: chromium:464314991
> Change-Id: I55a53f2565c81a7d7ad2e378f944ffcf07c71f4f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/453000
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#47175}

Bug: chromium:464314991
Change-Id: If2888c379fe3a5bfdac6c12225a12705a1377c30
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/457640
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47182}
2026-03-17 07:42:18 -07:00
Evan Shrubsole
60f506109e Remove use of ScopedFakeClock in video_encoder_software_fallback_wrapper_unittest
The fake clock was not used so was completely removed.

Bug: webrtc:469327588,webrtc:42223992
Change-Id: I5cd06b94801fc0f3d5fc91734719ce636a6a6964
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/457241
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47181}
2026-03-17 07:40:46 -07:00
Per Åhgren
db6adf2e9f Removed the configuration options for multi_channel processing
This CL removes the explicit configuration options for whether
the audio processing should be performed in a multi- or
single-channel manner.
This change means that the choice of whether to do multi- or
single-channel audio processing will be made based on the
content of the audio sent to APM for processing, and the
audio output requested by APM.

Bug: chromium:464314991
Change-Id: I55a53f2565c81a7d7ad2e378f944ffcf07c71f4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/453000
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47175}
2026-03-16 14:55:44 -07:00
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
Philipp Hancke
2d4de9fc65 build: clean up api:enable_media deps
which requires fixing a transitive dependency

Bug: webrtc:467294026
Change-Id: Ia227d593de825efe84ac2a93522d1b6977112df9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/456142
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#47145}
2026-03-13 01:57:14 -07:00
Philipp Hancke
3e0a723522 build: gn_check_autofix should retain blank lines, comments and # keep tagged lines
Bug: webrtc:467294026
Change-Id: I613ef701e678563a3f9e41e7a008b42540137916
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/456141
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#47139}
2026-03-12 07:49:22 -07:00
Anton Podavalov
9c1612bf5b Encapsulate and make RTP sequence number available in RtpPacketInfo.
Bug: b/462514208
Change-Id: I63f9235253f229a8059f752d6186409fc1eb24f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/452722
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47128}
2026-03-12 03:07:15 -07:00
Philipp Hancke
ed82d23c96 build: clean up api/BUILD.gn
using
  xargs tools_webrtc/gn_check_autofix.py -r api/BUILD.gn
followed by
  tools_webrtc/gn_check_autofix -C out/Default

The removal of the "call" dep from the "enable_media" target
and "stats/rtcstats" from the "create_modular_peer_connection_factory"
targets were reverted due to linker failures.

Changes to the libjingle_peerconnection legacy target were reverted.

Bug: webrtc:467294026
Change-Id: Iac9c6b0bdac23cfd5441bd0d9968202c15f70b1e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/455821
Reviewed-by: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47126}
2026-03-12 01:46:07 -07:00
Jeremy Leconte
77cd0a7759 Make the targets leaking through 'libjingle_peerconnection_api' public
Change-Id: Id8fbe6d5476c1c7559a72afa79c658d514932813
Bug: webrtc:467294026
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/456061
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#47125}
2026-03-12 01:43:15 -07:00
Erik Språng
d095dd2d18 Clean up some video-related OWNERS files.
This removes some folk who are not that active in libwebrtc anymore.

Bug: None
Change-Id: I798a5c079ab8cb9119ac8708caa59597c16dbe01
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/453260
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47097}
2026-03-10 02:16:08 -07:00
Harald Alvestrand
d4ef54417d Emit CCFB parameters per codec, not wildcard
This works around the inability of some parsers to handle wildcards.

Bug: webrtc:489794442
Change-Id: I4633e1d27139e13ec571bbd169ed38c324922248
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/455280
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47096}
2026-03-10 01:35:52 -07:00
Tommi
06a10bde23 Replace EncoderSwitchRequestCallback with absl::AnyInvocable
This refactoring replaces the EncoderSwitchRequestCallback interface
with absl::AnyInvocable in VideoStreamEncoderSettings.

To ensure the callback survives stream recreation, the callback binding
has been moved to RecreateWebRtcStream, relying on a new `send_channel_`
back-pointer within WebRtcVideoSendStream.

Bug: b/478050997
Change-Id: I1f587d563553c4f2f3d8fd02c4d9ed4473829dc4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/454480
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47087}
2026-03-09 07:02:19 -07:00
Harald Alvestrand
924dd2ecf8 Reduce the number of webrtc:: prefixes in code
This is achieved by moving most anonymous namespaces inside the
webrtc namespace and modifying as appropriate.

Bug: None
Change-Id: Iff299c45f92ae5aaa736722ed6630df9ad5525bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/454240
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47077}
2026-03-06 06:29:19 -08: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
Danil Chapovalov
8ec8cf9c14 Fix configuring initial bwe in scream controller
Set it when initial probing is configured to true, rather than std::optional initial probing is set to some value.

Bug: None
Change-Id: I326c9a12399f2364f48544b45a150fecb3e8d575
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/453320
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47048}
2026-03-04 09:01:30 -08:00
Harald Alvestrand
cc9f553304 Regularize wildcard handling for rtcp-fb attributes.
Make the code indifferent to whether rtcp-fb section-wide
attributes are signalled using * or repeated for all codecs.

Bug: webrtc:489633228
Change-Id: I965a881361256f184cefd68ae1f41adeee2a5a70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/453640
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47047}
2026-03-04 07:20:38 -08:00
Danil Chapovalov
1d1753600d Alias ArrayView to be std::span
Bug: webrtc:439801349
Change-Id: I63dc91abfc8c3aee0eb95f31934246def2c16d87
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/451941
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47032}
2026-03-03 07:10:15 -08:00
Harald Alvestrand
012ba18eab Delete external authentication code.
The callers to this functionality seem to have disappeared over the 5 years since it was last looked at.

Bug: webrtc:487743907
Change-Id: I4f6b8d2ecaec4c0d97d9e1b44cb42870f0190de6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/452400
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47009}
2026-02-27 06:34:17 -08:00
Danil Chapovalov
bb1e977e06 Fix remaining differences between ArrayView and std::span usage
In tests explicitly ignore arguments std::span marks as no discard.
Add missing includes that currently rely on array_view.h transitive
includes.
Remove assumption 2nd template parameter of the ArrayView is signed
integer, instead migrate test helper ExpectEq to a standard matcher.
Remote assumption empty ArrayView::data() is nullptr.
Deprecate reinterpret_array_view as unused in WebRTC.

Bug: webrtc:439801349
Change-Id: I70c020d5ef6129396ed118ae7d32c5dc18101d9d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/452500
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47006}
2026-02-27 04:48:49 -08:00
Tommi
6f7ad28e16 Add AbslStringify to RtpParameters, disable DCHECK
* Temporarily disables the `RTC_DCHECK(cached_filtered == result)`
  in `RtpSenderBase::GetParameters` while tracking down the exact
  sequence of events triggering it in a downstream project.
* Add `AbslStringify` overloads for `RtpParameters`,
  `RtpEncodingParameters`, `RtpCodecParameters`, and
  `RtcpParameters` to facilitate detailed logging.
* Log an error in `rtp_sender.cc` when the cache doesn't seem to be
  correct.

Bug: b/478050997
Change-Id: I7f2fbcf8ffdffcaf0c0a4a5aa19e023542022fed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/452000
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Sameer Vijaykar <samvi@google.com>
Cr-Commit-Position: refs/heads/main@{#46992}
2026-02-25 06:07:36 -08:00
Erik Språng
89561f13f6 Remove frame references in corruption detection on frame drops.
The `FrameInstrumentationGenerator` needs both the raw input frame (in
order to do sampling) and the corresponding encoded frame (in order to
map the QP to a filter size). For that reason it holds on to a small
queue of the last two input frames. This was needed in order to deal
with asynchronous encoders, especially in simulcast mode.

In webrtc:467444018 a new callback scheme was introduced where encoders
always announce when all spatial/simulcast layers are done with a frame
either through the `EncodeImage` or through a new `OnFrameDropped`
callback method.

This CL wires the new callback up through `VideoStreamEncoder` to the
`FrameInstrumentationGenerator` so that raw frame handles can be
released as soon as possible.

Bug: webrtc:467444018, webrtc:358039777
Change-Id: Icdb57bdf9c0c8efc2a3153ae204cc852e8f6cd42
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/451880
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46988}
2026-02-24 10:47:53 -08:00
Markus Handell
10e303c4f2 Add and populate content type in VideoFrame.
This change adds a content type optional field to the VideoFrame.
It's populated in generic decoder to make the content type
available in Chromium's MediaStreamRemoteVideoSource, for the
purposes of identifying screenshare content.

Bug: chromium:470337728
Change-Id: I3ceed08c9903376372c929e9eb3b1c68abd6a097
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/451840
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46982}
2026-02-24 05:47:25 -08:00
Danil Chapovalov
b4ba35203b Restrict ArrayView constructor from genertic range
Add constrains matching similar std::span constructor

Update classes that don't fulfill that constraints:
Classes that represent a single range got `begin` and `end` accessors.
Classes that represent more than a single range got single accessor
returning desired ArrayView.

Bug: webrtc:439801349
Change-Id: Ic0e6b4964582d91e0904ef814ce446be5e0ead2d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/451220
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46980}
2026-02-24 04:48:22 -08:00
Danil Chapovalov
700ef22406 Mark one of the constructor explicit for ArrayView with static extent
to match similar std::span constructor restriction.

Update users of that constructor to use it explicitly, or rely on other
means to create an ArrayView with static extent

Bug: webrtc:439801349
Change-Id: If5836af3d42c6eb43e109f9418a460332d78d744
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/450920
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46968}
2026-02-20 19:09:50 -08:00
Danil Chapovalov
453d89919e Add ArrayView::supspan variants to create spans with static extent
This functions match std::span api and provide concise way to create
spans with static extent. Note that most std::span constructors for
spans with static extent are explicit and thus can't be used through
braced initialization.

This change includes examples where those new functions are most
helpful.

Bug: webrtc:439801349
Change-Id: I4158ba12f28d0271fe9f9577533b2b36f3cd9222
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/450680
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46962}
2026-02-20 04:45:51 -08:00
Erik Språng
33d3cea2ce Add OnFrameDropped stubs for remaining EncodedImageCallbacks.
This adds noop implementations for the `OnFrameDropped` method in all
implementations of EncodedImageCallback in libwebrtc. This in in
preparation of eventually making it pure virtual.

Bug: webrtc:467444018
Change-Id: Ie45255bec2dbe001de9dcab24b0222fee0514738
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/450260
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Auto-Submit: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46958}
2026-02-20 01:29:03 -08:00