Commit graph

944 commits

Author SHA1 Message Date
Danil Chapovalov
1932b44aa2 Provide Environment for AudioEncoderOpus in tests when created using the trait
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}
2024-07-30 09:29:11 +00:00
Tommi
d6ef33e59b Remove PushResampler<T>::InitializeIfNeeded
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}
2024-07-04 10:33:21 +00:00
Danil Chapovalov
20b8e33a3f Add AudioEncoderOpus constructors that use field trials from Environment
Deprecate or remove other constructor

Bug: webrtc:343086059
Change-Id: I863a1df1b313f871a0b03763be1588e68ceb84a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355182
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42545}
2024-06-26 15:25:23 +00:00
Danil Chapovalov
1030eaaffe Provide Environment to create an audio encoder in tests
Bug: webrtc:343086059
Change-Id: I73a48770ae67e529eb5065e957ea6420dea44975
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/354881
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42542}
2024-06-26 12:54:36 +00:00
Jakob Ivarsson
0fd67312ea Reset the speech encoder when creating a comfort noise encoder.
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}
2024-06-20 11:02:26 +00:00
Dor Hen
aefed55c25 [iwyu][1\n] Applying to api/[a-s]*
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}
2024-06-19 06:19:20 +00:00
Jesús de Vicente Peña
fc6df056b6 Computing and propagating the audio stats totalprocessingdelay.
Bug: webrtc:344347965
Change-Id: Id7dd74ef085338d14582dcc0db98508d365301e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352680
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42507}
2024-06-18 08:05:28 +00:00
Mirko Bonadei
33e6e80acc Actually skip AudioDecoderG722StereoTest.EncodeDecode on UBSan.
Bug: webrtc:345525069
Change-Id: Ib7f2fec96ccff01a55177180e8429c9b22bcd0d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353962
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42452}
2024-06-07 14:50:45 +00:00
Mirko Bonadei
9f6bb625e6 Skip tests failing with the new version of UBSan.
Bug: webrtc:345525069, webrtc:345674542
Change-Id: I031adfe33ed4057dcd79cc9fb431838f14b315dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353902
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42447}
2024-06-07 10:57:35 +00:00
Mirko Bonadei
1b26b72f30 Disable G722 and iLBC tests failing with the new version of UBSan.
Bug: webrtc:345525069
Change-Id: I04712f297c7d2d5ea4556cd6157d9ee3bcada49b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353920
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42445}
2024-06-07 09:46:24 +00:00
Mirko Bonadei
bd4dd67dde Disable G722 and iLBC tests failing with the new version of UBSan.
Bug: webrtc:345525069
Change-Id: Iebe6a75252393f2bdf1e91b309f1b918708d413c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353860
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42443}
2024-06-07 09:18:10 +00:00
Mirko Bonadei
32fdb04f1f Disable G722 and iLBC tests failing with the new version of UBSan.
Bug: webrtc:345525069
Change-Id: I2d1a817b550f536cd46a0fa4c142e320e32f1701
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/353840
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42442}
2024-06-07 08:54:46 +00:00
Mirko Bonadei
876d0c9881 Fix use-of-uninitialized-value in NetEq tests.
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}
2024-06-05 07:07:37 +00:00
Tommi
19510f861f Delete unused methods
Bug: none
Change-Id: I4ebd0d0c1be0bb1cabc2757cdfe82f0515f8a7da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351544
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42417}
2024-05-30 14:55:10 +00:00
Lionel Koenig
5889cf5888 Propagate arrival time inside NetEq
Bug: webrtc:341266986
Change-Id: I0fdd14e3fc5b09cbc9369497501f399464964211
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352920
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42414}
2024-05-30 14:21:42 +00:00
Lionel Koenig Gélas
61dc3ac202 Revert "Propagate arrival time inside NetEq"
This reverts commit 0a23279e33.

Reason for revert: Breaks internal Google builds.

Original change's description:
> Propagate arrival time inside NetEq
>
> Bug: webrtc:341266986
> Change-Id: I1532ba2329272d6ca1602924f4e9ee61b19ad890
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352201
> Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
> Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42405}

Bug: webrtc:341266986
Change-Id: I92c12df3d1c3f6584f2ead3d965d78988a7b5405
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352822
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Auto-Submit: Lionel Koenig Gélas <lionelk@google.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42410}
2024-05-30 11:06:43 +00:00
Lionel Koenig
0a23279e33 Propagate arrival time inside NetEq
Bug: webrtc:341266986
Change-Id: I1532ba2329272d6ca1602924f4e9ee61b19ad890
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352201
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42405}
2024-05-29 15:36:12 +00:00
Tommi
19c51ea537 Use std::array<> consistently for reusable audio buffers.
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}
2024-05-29 09:20:36 +00:00
Manashi Sarkar
0121ff40da Revert "Propagate arrival time inside NetEq"
This reverts commit 5237cbbe68.

Reason for revert: Breaks build.

Original change's description:
> Propagate arrival time inside NetEq
>
> Bug: webrtc:341266986
> Change-Id: I313ded76b884e9ee0f00f43541c8e9aebc406001
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351340
> Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
> Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#42381}

Bug: webrtc:341266986
Change-Id: I3c067b95055a8b3e7208cc6e45a5b581f8d65be6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351541
Commit-Queue: Manashi Sarkar <manashi@google.com>
Reviewed-by: Lionel Koenig <lionelk@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Lionel Koenig Gélas <lionelk@google.com>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42387}
2024-05-27 17:17:04 +00:00
Lionel Koenig
5237cbbe68 Propagate arrival time inside NetEq
Bug: webrtc:341266986
Change-Id: I313ded76b884e9ee0f00f43541c8e9aebc406001
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351340
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42381}
2024-05-27 12:48:00 +00:00
Tommi
5d3e6805f2 Add audio view classes
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}
2024-05-24 18:08:37 +00:00
Florent Castelli
99c519b3fd Mass removal of absl_deps in all BUILD.gn files
Bug: webrtc:341803749
Change-Id: Id73844ba8d63b9f2f2c9391d8d8116ad0864c36d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/351540
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42372}
2024-05-23 15:09:46 +00:00
Philipp Hancke
3643acbd77 neteq test: add opus/red with default payload type
BUG=webrtc:42221750

Change-Id: I272bcb84ce8deb73497e93d3ffe6549019040d02
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350868
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42351}
2024-05-20 15:39:11 +00:00
Philipp Hancke
57dbb1e53e Reland "Split digest methods from ssl target into digest target"
This is a reland of commit 47bfe39ecf

Original change's description:
> Split digest methods from ssl target into digest target
>
> in an attempt to break up the monolithic ssl target.
>
> BUG=None
>
> Change-Id: I38f5b3e2828742d5d918460db1af0a5797d6a5c2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349764
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Cr-Commit-Position: refs/heads/main@{#42249}

Bug: webrtc:339300437
Change-Id: I31bb79bbc6cc55a2634176f95ec67de195974e1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350260
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42304}
2024-05-15 06:40:16 +00:00
Jakob Ivarsson
28a4ec36a0 Fix use of uninitialized value in NetEq test.
Bug: chromium:339308502
Change-Id: Iee2a6ca190fdd2dee498afa6e36fa0eb1f7dd9b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350304
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42283}
2024-05-13 09:32:31 +00:00
Lionel Koenig
a656b9d781 Use absolute capture timestamp from the beginning of payload
This ensure the absolute capture timestamp from the first audio sample
encoded in the payload is used for the corresponding rtp header.

Bug: webrtc:42226041
Change-Id: Ib8f2e3a5df5c82c5806171bd5b36a26d92fbea72
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349265
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42281}
2024-05-13 08:10:56 +00:00
Mirko Bonadei
fc57037462 Revert "Split digest methods from ssl target into digest target"
This reverts commit 47bfe39ecf.

Reason for revert: Breaks downstream project.

Original change's description:
> Split digest methods from ssl target into digest target
>
> in an attempt to break up the monolithic ssl target.
>
> BUG=None
>
> Change-Id: I38f5b3e2828742d5d918460db1af0a5797d6a5c2
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349764
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@meta.com>
> Cr-Commit-Position: refs/heads/main@{#42249}

Bug: None
Change-Id: Ice6f901cd8c2aecf4cf44d3728ec76568b19a7ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350180
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42255}
2024-05-08 06:42:32 +00:00
Philipp Hancke
47bfe39ecf Split digest methods from ssl target into digest target
in an attempt to break up the monolithic ssl target.

BUG=None

Change-Id: I38f5b3e2828742d5d918460db1af0a5797d6a5c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349764
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#42249}
2024-05-07 16:52:48 +00:00
Jakob Ivarsson
1e5f88c5be Make muted param in GetAudio optional.
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}
2024-05-06 18:07:34 +00:00
Tommi
1f3679884c Start using ArrayView in AudioFrame, update PushResampler
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}
2024-04-30 15:33:08 +00:00
Emil Lundmark
50c1b66df6 Remove expired field trial UseTwccPlrForAna
Bug: webrtc:7058
Change-Id: I432d0df9cdf53d2de4e4b33a59807787c5a55772
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345480
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42064}
2024-04-15 14:26:33 +00:00
Emil Lundmark
4d598037a8 Remove expired WebRTC-Audio-NetEqFecDelayAdaptation
Bug: webrtc:13322
Change-Id: I50d2ffb16656bd485658cd6c379fa7e834ca1cf8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345702
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42009}
2024-04-06 08:57:52 +00:00
Jakob Ivarsson
e0f08a325a Add SSRC filter and NetEq accessor to NetEq simulator.
Bug: None
Change-Id: I6b3f9c564199d75adf5830a7d0f58aeb50674c39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345440
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42002}
2024-04-05 10:02:38 +00:00
Emil Lundmark
6932042050 Remove expired WebRTC-Audio-OpusSetSignalVoiceWithDtx
Bug: webrtc:4559
Change-Id: I060ee6a6d4bbb3329dfdf7d6819a3d346da6a8b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345720
Commit-Queue: Emil Lundmark <lndmrk@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42000}
2024-04-05 07:49:33 +00:00
Joachim Reiersen
5075cb4a60 Expose AudioLevel as an absl::optional struct in api/rtp_headers.h
Start migrating away from `hasAudioLevel`, `voiceActivity`, `audioLevel` fields in RTPHeaderExtension and switch usages to a more modern absl::optional<AudioLevel> accessor instead.

The old fields are preserved for compatibility with downstream projects, but will be removed in the future.

Bug: webrtc:15788
Change-Id: I76599124fd68dd4d449f850df3b9814d6a002f5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336303
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41947}
2024-03-22 10:07:47 +00:00
Tomas Lundqvist
aaa123debb Reland "Remove post-decode VAD"
This is a reland of commit 89cf26f1e0

Original change's description:
> Remove post-decode VAD
>
> Bug: webrtc:15806
> Change-Id: I6acf8734a70703085cfc1ccf82a79ee0931f59a4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336460
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Tomas Lundqvist <tomasl@google.com>
> Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41653}

Bug: webrtc:15806
Change-Id: I1c2c0ce568c3c1817ff5c65bee91b9f961d46559
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337442
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Tomas Lundqvist <tomasl@google.com>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41688}
2024-02-07 16:33:51 +00:00
Jakob Ivarsson
5ff04d1b60 Avoid zero duration packets in NetEq test with replacement audio.
Fixes a crash when the timestamp difference between two packets is zero,
which can happen due to probing for example.

Bug: none
Change-Id: If04dfaed0b10aecd7b1a1e5487161c2d82ad9e44
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/338020
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <hlundin@google.com>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41669}
2024-02-05 14:48:25 +00:00
Jakob Ivarsson
f6ae657b07 Adapt NetEq delay to received FEC (both RED and codec inband).
This is achieved by notifing NetEq controller of all received packets
after splitting, which then does deduping so that only useful packets
are counted.

The goal is to reduce underruns when FEC is used.

The behavior is default enabled with a field trial kill-switch.

Bug: webrtc:13322
Change-Id: I2a1a78ead1a58940ef92da0d43413eda5ba1caf3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337440
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41665}
2024-02-05 12:33:27 +00:00
Jeremy Leconte
687ef0a136 Revert "Remove post-decode VAD"
This reverts commit 89cf26f1e0.

Reason for revert: breaking upstream projects

Original change's description:
> Remove post-decode VAD
>
> Bug: webrtc:15806
> Change-Id: I6acf8734a70703085cfc1ccf82a79ee0931f59a4
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336460
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Commit-Queue: Tomas Lundqvist <tomasl@google.com>
> Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#41653}

Bug: webrtc:15806
Change-Id: I20e383a6b6d625d86830ecec1be01b42b22e86a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337420
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Jeremy Leconte <jleconte@google.com>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41657}
2024-02-01 15:16:26 +00:00
Jakob Ivarsson
53e41a2bc6 Ignore old, duplicate and overlapping packets in packet arrival history.
This should mostly be a noop, but in a follow up cl we will insert all
packets after splitting, which will allow for adapting the delay to FEC
(both RED and codec inband) that is useful for decoding (i.e. not
already covered by primary packets).

A slight behavior change is that reordered packets are no longer
included in max delay calculation.

Implementation details:
- A map ordered by RTP timestamp is used to store the arrivals.
- When inserting new packets, we check if the timestamp is too old, already exists or if the packet is fully covered by another packet (based on timestamp and packet duration).
- Separate deques are used to keep track of "min" and "max" arrivals (as defined by ordering operators). The queues maintain a strictly increasing/decreasing order so that min/max is always at begin().

Bug: webrtc:13322
Change-Id: I8b6cf5afff77b4adc3c29745b95627e955715b5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337184
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41656}
2024-02-01 15:05:19 +00:00
Tomas Lundqvist
89cf26f1e0 Remove post-decode VAD
Bug: webrtc:15806
Change-Id: I6acf8734a70703085cfc1ccf82a79ee0931f59a4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336460
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Tomas Lundqvist <tomasl@google.com>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41653}
2024-02-01 12:37:23 +00:00
Henrik Lundin
1d3e286c7f Fix a fuzzer-found issue in G.722 decoder
Bug: chromium:1521407
Change-Id: I913108232f195856a9e2693dc1350ec0937fa923
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337182
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41647}
2024-01-31 17:38:30 +00:00
Henrik Lundin
26ad5b82ce Fix a fuzzer-found issue in PCM/G.711 decoder
Bug: chromium:1521415
Change-Id: Ia955b59ee40c57bdbbb2a32fa1bf80475df8c743
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337201
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41646}
2024-01-31 17:02:47 +00:00
Henrik Lundin
9b7f3649af Fix a fuzzer-found issue in PCM16 decoder
Bug: chromium:1521761
Change-Id: Id5292e80fd6ecae2c39a446dec010b0383bd805e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337200
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41645}
2024-01-31 17:00:04 +00:00
Jakob Ivarsson
c3624d02d0 Add field trial that enables Opus PLC.
Low-Coverage-Reason: EXPERIMENTAL_CODE Code is behind field trial that will only be used for testing.
Bug: webrtc:13322
Change-Id: Ie306be808381b3a20b4e0d58349927bf3524018a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/335840
Reviewed-by: Tomas Lundqvist <tomasl@google.com>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41608}
2024-01-25 12:01:57 +00:00
Philipp Hancke
de17252e8e Reland "Unify access to SDP codec parameters"
This is a reland of commit 63d03f586b

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I5f8f45688df232eb37b12fa3e56a893a1c754e17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331402
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41467}
2024-01-03 12:03:11 +00:00
Mirko Bonadei
6c9c958c69 Revert "Unify access to SDP codec parameters"
This reverts commit 63d03f586b.

Reason for revert: Breaks downstream project (not backwards compatible API change)

Original change's description:
> Unify access to SDP codec parameters
>
> which come from the a=fmtp:<pt> lines in the SDP and were used as either
>   std::map<std::string, std:string>
> with three aliases,
>   cricket::CodecParameterMap
>   SdpAudioFormat::Parameters
>   SdpVideoFormat::Parameters
>
> Use webrtc::CodecParameterMap in all places.
>
> BUG=None
>
> Change-Id: If47692bde7347834c349c6539b43309d8770e67b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
> Reviewed-by: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Harald Alvestrand <hta@webrtc.org>
> Commit-Queue: Philipp Hancke <phancke@microsoft.com>
> Cr-Commit-Position: refs/heads/main@{#41375}

Bug: None
Change-Id: I841735d98533d3b66850b9cfcf7ee0a99ddde078
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/331400
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Owners-Override: Mirko Bonadei <mbonadei@webrtc.org>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#41377}
2023-12-13 16:28:44 +00:00
Philipp Hancke
63d03f586b Unify access to SDP codec parameters
which come from the a=fmtp:<pt> lines in the SDP and were used as either
  std::map<std::string, std:string>
with three aliases,
  cricket::CodecParameterMap
  SdpAudioFormat::Parameters
  SdpVideoFormat::Parameters

Use webrtc::CodecParameterMap in all places.

BUG=None

Change-Id: If47692bde7347834c349c6539b43309d8770e67b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330420
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#41375}
2023-12-13 14:22:15 +00:00
Jakob Ivarsson
526187708d Refactor NetEq insert packet list.
Move some logic from PacketBuffer to NetEqImpl.

Bug: webrtc:13322
Change-Id: I88b1e55c0cd69700730d9ed41be04fcf1effa03f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328861
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41270}
2023-11-29 09:53:21 +00:00
Jakob Ivarsson
9305b108bd Fix integer overflow.
Bug: chromium:1501500
Change-Id: Ie13edbc90926c70cd37059a99cd539b15d0fb3a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327320
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41146}
2023-11-13 17:10:55 +00:00