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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
* 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}
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}
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}
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}
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}
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}
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}