279 Commits

Author SHA1 Message Date
Boris Tsirkin
dadb9f4643 Format /modules folder
Formatting done via:

git ls-files | grep -E '^modules\/.*\.(h|cc|mm)' | xargs clang-format -i

No-Iwyu: Includes didn't change and it isn't related to formatting
Bug: webrtc:42225392
Change-Id: I5154c8e290591a6a0599b53802eaf152038c5f47
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373703
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43677}
2025-01-08 03:46:30 -08:00
Alessio Bazzica
cd013b1d59 Opus decoder: stereo decoding by default (behind field trial)
- Add `WebRTC-Audio-OpusDecodeStereoByDefault` field trial
- Behind that field trial, `AudioDecoderOpus::SdpToConfig` uses 2
  instead of 1 as default number of channels when the `stereo` codec
  param is unspecified
- Instead of wiring up `FieldTrialsView` to `SdpToConfig`, which
  requires API changes that break downstream projects, a change in
  `AudioDecoderOpus::Config` is made to signal when the number of
  channels is forced via SDP config

Bug: webrtc:379996136
Change-Id: If70eb19bc7e3bc74dd0423610cb04ae33ea602fe
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368860
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43440}
2024-11-22 07:37:10 +00:00
Alessio Bazzica
4c9dbd508d Remove/update TODOs assigned to alessiob
Bug: webrtc:379542219
Change-Id: I1da54a9a13187d9e7d836dd4e1a85e49b685d971
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368540
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43420}
2024-11-18 21:06:18 +00:00
Alessio Bazzica
ebb11c4c87 With stereo decoding and mono packets produce mono after CN/PLC
The workaround in https://webrtc-review.googlesource.com/c/src/+/367740
is incomplete because it does not fix the issue for the first decoded
mono packet after CN/PLC. This CL extends the workaround to such a case
and adds a unit test for it.

Note: it was verified that the 2nd packet after CN/PLC is trivial
stereo.

Credits: jakobi@webrtc.org for raising the concern

Bug: webrtc:376493209
Change-Id: Ide27e411781693f14629cf9db8b6c0c0fc762a17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368160
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43393}
2024-11-13 14:47:29 +00:00
Alessio Bazzica
c7824dba06 With stereo decoding and mono packets produce mono DTX/concealment
Adding a temporary workaround in the WebRTC Opus decoder wrapper to fix
https://issues.webrtc.org/376493209. Once the issue is fixed in libopus,
the workaround must be removed (TODO added in the code).

The workaround keeps track of the number of channels for the last
decoded packet and, if the decoder operates in stereo mode and the last
packet was a mono one, the left channel is copied into the right one
when comfort noise / PLC audio is generated.

Bug: webrtc:376493209
Change-Id: Iad3bfb1b393bd68833decf51b69b5238cb0ec4b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367740
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43371}
2024-11-07 16:11:32 +00:00
Alessio Bazzica
a287ffa681 Add unit tests for AudioDecoderOpusImpl for stereo
- With mono encoding and stereo decoding check that the decoded
  signal is trivial stereo
- DTX tests
  - With mono encoding and stereo decoding check that the comfort
    noise generated by Opus is NOT(*) trivially stereo
  - With stereo encoding and stereo decoding check that the comfort
    noise generated by Opus is not trivially stereo

*: the test shows the behavior described in [1] and that needs to
be fixed.

[1] https://issues.webrtc.org/376493209

Bug: webrtc:376493209
Change-Id: I34aacd4bd7c79be9df05c242e912c9981896a73d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367206
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43363}
2024-11-06 15:00:04 +00:00
Alessio Bazzica
db40c1cd5f Opus wrapper: remove misleading comment
- WebRTC does use the libopus DTX implementation
- The removed detail is anyways irrelevant in a docstring

Bug: webrtc:376493209
Change-Id: I3dfe1521259e596dbfa0db97f91ffb75deeb16b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/367200
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43344}
2024-11-01 07:56:18 +00:00
Dor Hen
c118881416 Comment unused variables in implemented functions 12\n
Bug: webrtc:370878648
Change-Id: Ia9b1db4f6c393a016c3769cd57c540704e9ca4f7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366526
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43329}
2024-10-29 17:26:38 +00:00
Dor Hen
a154b73097 Comment unused variables in implemented functions 11\n
Bug: webrtc:370878648
Change-Id: Ic31d7744cc8516e4c014bc044fbe2dba9e4d835b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366525
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Dor Hen <dorhen@meta.com>
Cr-Commit-Position: refs/heads/main@{#43328}
2024-10-29 17:25:36 +00:00
Alessio Bazzica
4a482a2160 Add TODO in the Opus encoder where the application param is set
Bug: webrtc:376071290
Change-Id: Idd9017435bab9f8b53771c0dd642fd4ce3db048e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366981
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43323}
2024-10-29 13:58:21 +00:00
Alessio Bazzica
e8c8218f1b Clean-up iLBC nits
Bug: webrtc:372395680
Change-Id: Ic33295bdc6e14abe35404dd969d5d51008e698f6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366602
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43322}
2024-10-29 12:40:33 +00:00
Alessio Bazzica
01a9264959 Remove the iLBC audio codec
Bug: webrtc:372395680
Change-Id: I228777281a26ada5336aefc9168b2537e029aca3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365101
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43234}
2024-10-14 12:13:31 +00:00
Dor Hen
f653f476f0 Remove unused parameters from "WebRtcSpl_FilterAR"
Bug: webrtc:370878648
Change-Id: Ia7c9046a7c0f415e1f28df9610f818af402e055f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364503
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43158}
2024-10-03 10:37:49 +00:00
Lionel Koenig
098c128a15 Explicitly use the Opus DTX encoder state.
Use the DTX state from inside the Opus encoder instead of trying to
mimic the logic outside.

Bug: None
Change-Id: I852044fee261a5b7f9255c557a27adfd0b1701bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/362640
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43034}
2024-09-17 13:28:45 +00:00
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Danil Chapovalov
24823c502b Add AudioDecoderOpus::MakeAudioDecoder overload taking Environment
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}
2024-08-16 15:10:30 +00:00
Danil Chapovalov
e0fe4200eb Provide Environment to consturct AudioDecoder in tests
Bug: webrtc:356878416
Change-Id: Id2803736d06445b536f2ced02509eaaaf8fd804c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359361
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42792}
2024-08-16 14:34:37 +00:00
Danil Chapovalov
759f8d80f0 Delete expired and unused field trial WebRTC-Audio-OpusPlcUsePrevDecodedSamples
Bug: b/143582588, webrtc:42221607
Change-Id: I49f477ab785801c8ef7143ab8b8654dd7379dfbd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/359560
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42783}
2024-08-14 17:21:39 +00:00
Danil Chapovalov
05309c5236 Delete AudioEncoderOpus constructor that doesn't provide Environment
Bug: webrtc:343086059
Change-Id: I55573eff8a13c504c7e14f370398bba1a6eae906
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/358060
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42692}
2024-07-30 11:40:34 +00:00
Danil Chapovalov
c2160b14b1 Delete expired field trial Audio-OpusAvoidNoisePumpingDuringDtx
Bug: webrtc:42222522, chromium:40174928
Change-Id: I2391b3078e5fff93edca3c3e6e568560b2a1c1cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/357742
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42691}
2024-07-30 09:43:52 +00:00
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
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
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
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
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 63d03f586bb668f72113b61030ec0930aa192010

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 63d03f586bb668f72113b61030ec0930aa192010.

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
Philipp Hancke
240e783d7f Stop using invalid payload type 200 in audio/red unit test
and fix the follow-up mistake in the test

BUG=None

Change-Id: Id7a20769cc1d03dd8154564f948e8138ff8c4e74
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315220
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40528}
2023-08-09 08:13:52 +00:00
Philipp Hancke
82e5f91a2b audio: fix handling of RED packets where the primary encoding is too large
by falling back to the primary encoding. This can happen with
opus stereo packets at the maximum bitrate which results in
1276 encoded bytes.

BUG=chromium:1470261

Change-Id: I3fd9bb30773963a519bbb5da44fe71db5dec2bd7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/315141
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40524}
2023-08-08 13:40:26 +00:00
Jared Siskin
c018bae807 Format /modules
git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -e  "^modules/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I2c3cd28740062794f8c10e39d8406aadb9e9a35a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301620
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Jared Siskin <jtsiskin@meta.com>
Cr-Commit-Position: refs/heads/main@{#39901}
2023-04-20 02:02:45 +00:00
Jakob Ivarsson
757da3cf70 Stop setting OPUS_SIGNAL_VOICE when DTX is enabled.
This was done in crbug.com/webrtc/4559 since "CELT-only mode does not have DTX", but that should not be the case anymore (support was added in Opus v1.2.1).

One exception where DTX does not work is with OPUS_APPLICATION_AUDIO (used with stereo) and low complexity settings. This should not be a common config.

Bug: None
Change-Id: I1476083b836bcabeb73df83d5bf06c3878146d28
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288420
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38923}
2022-12-20 11:06:48 +00:00
Per Kjellander
e0b4cab69c Remove default enabled field trial WebRTC-SendSideBwe-WithOverhead
Bug: webrtc:6762
Change-Id: I520188a13ee5f50c441226574ccb3df54f842835
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285300
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Jakob Ivarsson‎ <jakobi@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38783}
2022-11-30 20:19:36 +00:00
Jakob Ivarsson
918eb19303 Fix crash when Opus maxptime < 20ms.
A follow up cl will be created to better handle nullopt frame length range in AudioSendStream.

Note that maxptime is still not used for setting the frame length (only ptime is).

Bug: chromium:1109337
Change-Id: Id21fd8c76a6c4a0c85719a955116f8d16001a3d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/284501
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38702}
2022-11-22 01:21:24 +00:00
Alessio Bazzica
17887eb04a Reland "[ACM] iSAC audio codec removed"
This is a reland of commit b46c4bf27ba5c417fcba7f200d80fa4634e7e1a1

Original change's description:
> [ACM] iSAC audio codec removed
>
> Note: this CL has to leave behind one part of iSAC, which is its VAD
> currently used by AGC1 in APM. The target visibility has been
> restricted and the VAD will be removed together with AGC1 when the
> time comes.
>
> Tested: see https://chromium-review.googlesource.com/c/chromium/src/+/4013319
>
> Bug: webrtc:14450
> Change-Id: I69cc518b16280eae62a1f1977cdbfa24c08cf5f9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282421
> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38652}

Bug: webrtc:14450
Change-Id: Ia22c4d7724b6022238235fede93e36e570a49376
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283843
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38665}
2022-11-17 12:52:35 +00:00
Alessio Bazzica
fbeb76ab51 Revert "[ACM] iSAC audio codec removed"
This reverts commit b46c4bf27ba5c417fcba7f200d80fa4634e7e1a1.

Reason for revert: breaks a downstream project

Original change's description:
> [ACM] iSAC audio codec removed
>
> Note: this CL has to leave behind one part of iSAC, which is its VAD
> currently used by AGC1 in APM. The target visibility has been
> restricted and the VAD will be removed together with AGC1 when the
> time comes.
>
> Tested: see https://chromium-review.googlesource.com/c/chromium/src/+/4013319
>
> Bug: webrtc:14450
> Change-Id: I69cc518b16280eae62a1f1977cdbfa24c08cf5f9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282421
> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
> Reviewed-by: Sam Zackrisson <saza@webrtc.org>
> Reviewed-by: Henrik Boström <hbos@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38652}

Bug: webrtc:14450
Change-Id: Ice138004e84e8c5f896684e8d01133d4b2a77bb7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283800
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: 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@{#38655}
2022-11-16 20:40:52 +00:00
Alessio Bazzica
b46c4bf27b [ACM] iSAC audio codec removed
Note: this CL has to leave behind one part of iSAC, which is its VAD
currently used by AGC1 in APM. The target visibility has been
restricted and the VAD will be removed together with AGC1 when the
time comes.

Tested: see https://chromium-review.googlesource.com/c/chromium/src/+/4013319

Bug: webrtc:14450
Change-Id: I69cc518b16280eae62a1f1977cdbfa24c08cf5f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282421
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38652}
2022-11-16 16:42:55 +00:00
Mirko Bonadei
9d9c2d5795 Make header files self contained.
This CL adds #includes to header files in order to make them
self contained after the preprocessor pass.

Bug: b/251890128
Change-Id: I81c3ba38fb8ab8a2bbd151ba99aa871fae9f1b1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278422
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38327}
2022-10-08 08:38:36 +00:00
Artem Titov
e39115a0ca Migrate audio perf tests on new perf metrics export API
Bug: b/246095034
Change-Id: Id659e43c116428cab47d334c93a6036f74dbb8e1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276626
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38192}
2022-09-25 18:55:50 +00:00
Ali Tofigh
714e3cbb48 Adopt absl::string_view in modules/audio_coding/
Bug: webrtc:13579
Change-Id: Ifec66fb6ba9724d18539de7245a358c2d13c7939
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268547
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37573}
2022-07-20 13:34:23 +00:00
Oleh Prypin
cc7bd85748 Don't add libopus to public_deps, its headers are only used directly
Bug: webrtc:8603
Change-Id: I2ce1f96a80dd23e420b3693b899d2b14382fd2d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266765
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Cr-Commit-Position: refs/heads/main@{#37363}
2022-06-28 19:13:14 +00:00
Niels Möller
e66b83f8ad Never pass a signed char to ctype macros like isdigit()
Bug: None
Change-Id: I451bb2c1f175a77aefbc8363009bf35a769fe941
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264442
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37037}
2022-05-30 13:05:03 +00:00
Niels Möller
ea1e6f44f8 Delete rtc_base/format_macros.h
It defined RTC_PRIuS, which was needed for compatibility with MSVC
prior to version 2015.

Bug: webrtc:6424
Change-Id: I5668d473376201cad3e8da65927c967fc397804b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261314
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36814}
2022-05-09 12:03:21 +00:00
Henrik Lundin
47a9e6e94e Fix an msan issue in G722 decoder
If feeding an odd length payload to the G722 stereo decoder, the codec
would end up reading from uninitialized memory.

Bug: chromium:1302494
Change-Id: I2222377530fee31555e17a0c60ecf33261364b71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261303
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Minyue Li <minyue@google.com>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36810}
2022-05-09 09:46:34 +00:00