ChannelReceive is now owning and interfacing with NetEq directly.
A new ResamplerHelper is added to acm_resampler.cc/.h, to do the
audio resampling that was previously done inside AcmReceiver.
AcmReceiver still remains, since it is used in other places for now.
Bug: webrtc:14867
Change-Id: If3eb6415e06b9b5e729d393713f3fccb31b0570f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361820
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42974}
This is a reland of commit 7fff587a09
Original change's description:
> Return audio stats regarless if we have a codec.
>
> Bug: b/331602608
> Change-Id: I2d12a3ed83645fe1e7cbd8950fd86d5ba2d7c94d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361743
> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
> Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42964}
Bug: b/331602608
Change-Id: I95c89e7059005bc8dd8569ef41bfe9e863b4082f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361762
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42969}
This makes it simpler to use in more contexts.
Bug: b/364184684
Change-Id: I1b08ebd24e51ba1b3f85261eed503a78cd006fd8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361480
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42956}
When Reconfiguring there's a call to ResetSenderCongestionControlObjects followed by a later call to
RegisterSenderCongestionControlObjects which happen on the worker thread, while enqueuing packets is
happening on a different thread.
If packets are enqueued in between these calls we get a null dereference of the `rtp_packet_pacer_`
This change fixes it by pausing processing of incoming audio in the interim state
Bug: webrtc:358290775
Change-Id: I77cebfb131545ce2a6fdb26105dd999da3f7c443
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359080
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42815}
Part of a set of CL to allow video to borrow underused audio bitrate.
Bug: webrtc:35055527
Change-Id: Idb504cbbc5794c06b28bdc21b3d860c9da9df175
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358202
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Dan Tan <dwtan@google.com>
Cr-Commit-Position: refs/heads/main@{#42733}
Passing Environment would allow to propage field trials with it further to NetEq and AudioDecoders
Bug: webrtc:356878416
Change-Id: Ic68420df3b157ed341146207a2c45cb49e59a931
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358501
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42728}
To make Environment available for creating AudioDecoders to use propagated field trials
Bug: webrtc:356878416
Change-Id: I5dc4a3514d1182db6a7a5aa770b87daba529a5c8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357442
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42719}
To make Environment available for creating AudioDecoders to use propagated field trials
Bug: webrtc:356878416
Change-Id: Ic2371f038b75402bbd007c948f43c60cc6cca8a9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358400
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42718}
This CL only adds variables necessary for the feature, which will be
implemented in later CLs.
Bug: webrtc:350555527
Change-Id: I71e56666e629f56168d316bf693150c0df0e2ecf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356740
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Dan Tan <dwtan@google.com>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42698}
MakeAudioEncoder planned to be removed, and Create planned to become pure virtual
While at it, cleanup nearby mock usage:
Remove ON_CALL that by default return default constructed result
Remove EXPECT_CALL().Times(AnyNumber()) for a NiceMock
Remove parameters in EXPECT_CALL when all are wildcard
Remove redundant get to deference a smart pointer
Bug: webrtc:343086059
Change-Id: Ica90a4980350cb82bcebd11df6c63a01b828bb9d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356884
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42622}
This switches from accepting a sample rate and convert to channel
size over to accepting the channel size.
Instead of InitializeIfNeeded:
* Offer a way to explicitly initialize PushResampler via the ctor
(needed for VoiceActivityDetectorWrapper)
* Implicitly check for the right configuration from within Resample().
(All calls to Resample() were preceded by a call to Initialize)
As part of this, refactor VoiceActivityDetectorWrapper (VADW):
* VADW is now initialized in the constructor and more const.
* Remove VADW::Initialize() and instead reconstruct VADW if needed.
Add constants for max sample rate and num channels to audio_util.h
In many cases the numbers for these values are embedded in the code
which has led to some inconsistency.
Bug: chromium:335805780
Change-Id: Iead0d52eb1b261a8d64e93f51401147c8fba32f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353360
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42587}
Also adding more checks around parameter valuesm since the
`sample_rate_hz` argument is technically not needed, but will be
removed in a follow-up CL.
Bug: chromium:335805780
Change-Id: Ia7e50658f8a686ab71980f9c59cce5f097b0af40
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353340
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42581}
To make Environment available for creating AudioEncoders in follow ups
Bug: webrtc:343086059
Change-Id: I0965155915caeee28964ce8406045beeabaa0185
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353741
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42460}
and move usages to webrtc::RefCountInterface
This CL also moves more stuff to webrtc:: and adds backwards
compatible aliases for them.
Bug: webrtc:42225969
Change-Id: Iefb8542cff793bd8aa46bef8f2f3c66a1e979d07
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353720
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42446}
and files that broke when I fixed the first set.
Bug: webrtc:42226242
Change-Id: I321cd63537ab3002098c7bdecd889a6fc5a1eb25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353421
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42429}
This is a minor change for places where we use
AudioFrame::kMaxDataSizeSamples sized intermediary buffers. The change
uses `std::array<>` instead of C style arrays which allows for use
of utility templates that incorporate type based buffer size checking.
Also adding `ClearSamples()` method, which complements CopySamples.
Bug: chromium:335805780
Change-Id: I813feb32937e020ceb9ca4b00632dc90907c93fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351681
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42400}
To make it available for creating AudioEncoders in follow ups
Bug: webrtc:343086059
Change-Id: I24bb8f7e0494e392210cb1001ea0421030d2766b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352601
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42396}
Split out time_util.h and cc from target rtp_rtcp to its own target.
This is to avoid possible circular dependencies and not having all targets using them to depend on the full RtpRcp module.
Bug: webrtc:343076000
Change-Id: I7b3c84456b17f1920f71afdd5a644d27e28caed2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352480
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42392}
From the new header file:
* MonoView<>: A single channel contiguous buffer of samples.
* InterleavedView<>: Channel samples are interleaved (side-by-side) in
the buffer. A single channel InterleavedView<> is the same thing as a
MonoView<>
* DeinterleavedView<>: Each channel's samples are contiguous within the
buffer. Channels can be enumerated and accessing the
individual channel data is done via MonoView<>.
There are also a few utility functions that offer a unified way to check
the properties regardless of what view type is in use.
Bug: chromium:335805780
Change-Id: I28196f8f4ded4fadc72ee32b62af304c62f4fc47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349300
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42377}
reduced-size RTCP, i.e. not prefixing RTCP packets with either a sender report or receiver report has been implemented for a long time but only for video.
This CL adds it for audio as well. This reduces the size of audio NACKs (16 bytes, typically one NACK per packet) sent by not prefixing it with a receiver report (32 bytes).
Other packets are not affected as e.g. transport-cc feedback does not add a RR even though that is technically required.
The effect on NACK can be tested by running Chromium with
--disable-webrtc-encryption --force-fieldtrials=WebRTC-FakeNetworkReceiveConfig/loss_percent:5/
against this fiddle negotiating audio nack:
https://jsfiddle.net/fippo/8ubtLnfx/1/
BUG=webrtc:340041654
Change-Id: I06fb94742ff1b6f9a464c404bfc53913f23498d8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350269
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42330}
This makes the downcasts currently used in eg
modules/rtp_rtcp/source/rtp_sender_video_frame_transformer_delegate.cc
safer.
Bug: webrtc:339815768
Change-Id: Ie6c7ab84666d399dbca4c95846b850aac5327f1a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350361
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42325}
This pass the absolute capture timestamp at the beginning of the frame
to the rtcp module.
Bug: webrtc:42226041
Change-Id: Iae85a56bfd9d33f7eb9eac3c68961235fe16dc6b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350202
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42296}
It is not necessary for the caller to use it and the mute info can be
found on AudioFrame.muted().
Bug: None
Change-Id: I458f1f2e8489c1d8f8a9078b21f889b2540bdab9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349940
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42236}
These methods are unused.
Bug: none
Change-Id: If1499c7c0bc925c2504b7a1318b2d7c4fc4240b1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349500
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42214}
Start introducing ArrayView to AudioFrame and code that flows down
from there. In this first step:
* Add `data_view()` that returns a read-only ArrayView for the
audio buffer. When AudioFrame is not initialized however, data_view()
will return a nullptr whereas the current data() method never returns
nullptr.
* Add `mutable_data()` that requires two arguments for properly setting
the samples per channel and number of channels that's required for
accurately reserving the returned mutable ArrayView.
A notable behavior change is that if the requested number of channels
is larger than supported or the calculated buffer size is too large,
the function will trigger a check.
* Add TODOs for following work.
Bug: chromium:335805780
Change-Id: I2937de800422589ebe6a3840b3caadf3d9ff8b00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347982
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42202}
Calculate the RMS audio level of audio packets being sent before
invoking an encoded frame transform, and pass them with the encode frame
object.
Before this, the audio level was calculated at send time by having rms_levels_ look at all audio samples encoded since the last send. This
is fine without a transform, as this is done synchronously after
encoding, but with an async transform which might take arbitrarily long,
we could end up marking older audio packets with newer audio levels, or
not at all.
This also makes things work correctly if external encoded frames are
injected from elsewhere to be sent, and exposes the AudioLevel on the
TransformableFrame interface.
Bug: chromium:337193823, webrtc:42226202
Change-Id: If55d2c1d30dc03408ca9fb0193d791db44428316
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349263
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tony Herre <herre@google.com>
Cr-Commit-Position: refs/heads/main@{#42193}
Old target and call/simulated.h exist but refer to new target in test/network.
Bug: webrtc:14525
Change-Id: Ida04cef17913f2f829d7e925ae454dc40d5e8240
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349264
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42191}