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}
We can avoid using the global now that field trials from Environment are
used in NetEq. This allows running multiple instances in parallel with
different settings.
Bug: webrtc:42220378
Change-Id: Icff8539e3ae9b61c86bb393d9a313e786e032b93
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359720
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42894}
This replaces the payload type tracking in AcmReceiver with the one in
NetEq and should be a noop.
Bug: None
Change-Id: Iaf124b5e56a646f994b5c2af65d349ede550b7fd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360840
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Tomas Lundqvist <tomasl@google.com>
Cr-Commit-Position: refs/heads/main@{#42875}
This fixes an edge case where the frame size changes for a DTX packet.
We should avoid having the frame size larger than the timestamp gap.
Bug: None
Change-Id: I0a384cfb06f5aebc1654c1e3d127541fd24e05c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360722
Reviewed-by: Tomas Lundqvist <tomasl@google.com>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42873}
This is currenly tracked in both AcmReceiver and NetEq. Adding this API
enables us to have it in just one place.
Bug: None
Change-Id: Ia537f87f36b0aedf19c00a57bd6cec4425a49df1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/360743
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Tomas Lundqvist <tomasl@google.com>
Cr-Commit-Position: refs/heads/main@{#42872}
Mark old overload deprecated.
This allows to migrate both calls through AudioDecoderFactory and direct calls to AudioDecpderOpus trait.
Bug: webrtc:356878416
Change-Id: I1502aee5b18aac43a8258e77b770c8e73a056f92
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359741
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42793}
Finalize change started in https://webrtc-review.googlesource.com/c/src/+/359243
Remove fallback to old interface and unneeded clock member in the config struct.
Bug: None
Change-Id: I4c2b65a09dd1c8a0d44ee76320b095516e2c61fb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359561
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42782}
to make it available for creating AudioDecoders
Bug: webrtc:356878416
Change-Id: Ibd24a55df70985dfe02d924da037618f13661032
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359241
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42771}
To propagate field trials in addition to clock
Bug: webrtc:356878416
Change-Id: Idefc4848ec4af30c8aed0f93b7fadfc3181bddb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358980
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42761}
To propagate field trials into the NetEq and further towards Audio Decoders
Bug: webrtc:356878416
Change-Id: Ia7cf18451aef70441ca958bf652f492138c6051a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358620
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42739}
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 allow delete old signature of the AudioEncoderOpus::MakeAudioEncoder function and thus guarantee Opus AudioEncoder always has an Environment
Bug: webrtc:343086059
Change-Id: Ib660678aeb5a549dddd1dffa3d8c28b2ec6b9d0b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356981
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42690}
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}
This is to make sure that the two encoders are "in sync" (the CNG
encoder can be created from an existing speech encoder).
This is a speculative fix for a crash in the CNG encoder where a packet
is unexpectedly emitted from the speech encoder.
Bug: webrtc:42225071
Change-Id: I42571e56e032897f7f083f04d785f6a08ebfb813
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355160
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Tomas Lundqvist <tomasl@google.com>
Cr-Commit-Position: refs/heads/main@{#42516}
First batch of applying iwyu to the repo.
Done with:
> ./tools_webrtc/iwyu/apply-iwyu api
> git add api/[a-s]*
> python3 gn_autodeps.py ~/local/webrtc/src out/Default
Last step is a custom script I wrote to automatically apply new required
dependencies for target in gn, which saved tons of time manually going
over the files and fixing.
If this is something that interest others, I can submit it as well.
Bug: webrtc:42226242
Change-Id: Id109e77f50835827495bc4512880c4ec9ae175f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Cr-Commit-Position: refs/heads/main@{#42512}
The new version of MSan (rolled by [1]) detects the following:
```
==39908==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x5591400a52ef in GetPlayoutDelayMs ./../../modules/audio_coding/neteq/decision_logic.cc:466:35
#1 0x5591400a52ef in webrtc::DecisionLogic::ExpectedPacketAvailable(webrtc::NetEqController::NetEqStatus) ./../../modules/audio_coding/neteq/decision_logic.cc:311:36
#2 0x5591400a39e9 in webrtc::DecisionLogic::GetDecision(webrtc::NetEqController::NetEqStatus const&, bool*) ./../../modules/audio_coding/neteq/decision_logic.cc:0:0
#3 0x55913cf590c9 in webrtc::DecisionLogicTest_PreemptiveExpand_Test::TestBody() ./../../modules/audio_coding/neteq/decision_logic_unittest.cc:139:3
#4 0x55913ef28283 in HandleExceptionsInMethodIfSupported<testing::Test, void> ./../../third_party/googletest/src/googletest/src/gtest.cc:0:3
#5 0x55913ef28283 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2710:5
#6 0x55913ef2ab46 in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2856:11
#7 0x55913ef2da34 in testing::TestSuite::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:3034:30
#8 0x55913ef621e8 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5964:44
#9 0x55913ef60f54 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
#10 0x55913ef60f54 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:5543:10
#11 0x55913ee1a944 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2334:73
#12 0x55913ee1a944 in webrtc::(anonymous namespace)::TestMainImpl::Run(int, char**) ./../../test/test_main_lib.cc:203:21
#13 0x55913cbd36b8 in main ./../../test/test_main.cc:72:16
#14 0x7fdb18c73082 in __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:308:16
#15 0x55913cb3e1a9 in _start ??:0:0
```
[1] - https://webrtc-review.googlesource.com/c/src/+/353620
Bug: b/344970813
Change-Id: I9b5d7791e68b4c494168ba9f007a3099ae21fed4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353581
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42433}