Commit graph

61 commits

Author SHA1 Message Date
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Jakob Ivarsson
bf0874568c Implement RTCOutboundRtpStreamStats.targetBitrate for audio.
Spec: https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-targetbitrate

Bug: webrtc:13377
Change-Id: I98dd263e0b9d6e2ca94969d2a91857b14cd65f70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237402
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35337}
2021-11-12 09:24:34 +00:00
Artem Titov
cfea2182f8 Use backticks not vertical bars to denote variables in comments
Bug: webrtc:12338
Change-Id: I89c8b3a328d04203177522cbdfd9e606fd4bce4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228246
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34696}
2021-08-10 10:40:03 +00:00
Artem Titov
d00ce747c7 Use backticks not vertical bars to denote variables in comments for /modules/audio_coding
Bug: webrtc:12338
Change-Id: I02613d9fca45d00e2477f334b7a0416e7912e26b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227037
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34621}
2021-08-02 10:45:40 +00:00
Mirko Bonadei
190244bb59 Remove all #include <assert.h>/<cassert> and usage in Obj-C code.
This CL completes the removal of assert() and relative headers from
the codebase (excluded
//examples/objc/AppRTCMobile/third_party/SocketRocket which is in a
third_party sub-directory).

Bug: webrtc:6779
Change-Id: I93ed57168d2c0e011626873d66529488c5f484f2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225546
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34528}
2021-07-22 14:00:26 +00:00
Mirko Bonadei
25ab3228f3 Replace assert() with RTC_DCHECK().
CL partially auto-generated with:

git grep -l "\bassert(" | grep "\.[c|h]" | \
  xargs sed -i 's/\bassert(/RTC_DCHECK(/g'

And with:

git grep -l "RTC_DCHECK(false)" |  \
  xargs sed -i 's/RTC_DCHECK(false)/RTC_NOTREACHED()/g'

With some manual changes to include "rtc_base/checks.h" where
needed.

A follow-up CL will remove assert() from Obj-C code as well
and remove the #include of <assert.h>.

The choice to replace with RTC_DCHECK is because assert()
is because RTC_DCHECK has similar behavior as assert()
based on NDEBUG.

This CL also contains manual changes to switch from
basic RTC_DCHECK to other (preferred) versions like
RTC_DCHECK_GT (and similar).

Bug: webrtc:6779
Change-Id: I00bed8886e03d685a2f42324e34aef2c9b7a63b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/224846
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34442}
2021-07-09 07:49:43 +00:00
Markus Handell
0df0faefd5 Migrate modules/audio_coding, audio_mixer/ and audio_processing/ to webrtc::Mutex.
Bug: webrtc:11567
Change-Id: I03b78bd2e411e9bcca199f85e4457511826cd17e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176745
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31649}
2020-07-07 14:35:58 +00:00
Per Åhgren
d82a02c837 ACM: Corrected temporary buffer size
This CL corrects the temporary buffers size in the
pre-processing of the capture audio before encoding.

As part of this it removes the ACM-specific hardcoding
of the size and instead ensures that the size of the
temporary buffer matches that of the AudioFrame.

Bug: webrtc:11242
Change-Id: I56dd6cadfd4e140e8e159966c33d1027383ea9fa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170340
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30775}
2020-03-12 12:23:20 +00:00
Niels Möller
3bdc5e9a5f Delete ACMVADCallback
This callback is enabled via the method
AudioCodingModule::RegisterVADCallback, which is unused, and deleted
in this cl.

Bug: None
Change-Id: I04c8690fbb673305e69fe5b1c32d88efd6c72d1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148420
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30735}
2020-03-10 09:53:46 +00:00
Minyue Li
dea73ee8f9 Pass absolute capture time from WebRtcVoiceEngine to ACM.
Bug: webrtc:10739
Change-Id: I6f264cb89ce340db642db3ef7dfc2b5d459f749e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167211
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Chen Xing <chxg@google.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30547}
2020-02-18 16:54:48 +00:00
Minyue Li
ff0e4dbd1f Reland "Send absolute capture time through audio coding module."
This is a reland of 48655cfdbf

Original change's description:
> Send absolute capture time through audio coding module.
>
> Bug: webrtc:10739
> Change-Id: I44e0305be7c84b253172511c2977b1d700e40c1b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167067
> Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Chen Xing <chxg@google.com>
> Commit-Queue: Minyue Li <minyue@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30363}

Bug: webrtc:10739
Change-Id: I10086d239ad3f1efb8485098bf3b0ad23110962b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167213
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Chen Xing <chxg@google.com>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30380}
2020-01-27 13:18:27 +00:00
Minyue Li
4175914f41 Revert "Send absolute capture time through audio coding module."
This reverts commit 48655cfdbf.

Reason for revert: failing upstream tests

Original change's description:
> Send absolute capture time through audio coding module.
> 
> Bug: webrtc:10739
> Change-Id: I44e0305be7c84b253172511c2977b1d700e40c1b
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167067
> Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
> Reviewed-by: Chen Xing <chxg@google.com>
> Commit-Queue: Minyue Li <minyue@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30363}

TBR=danilchap@webrtc.org,ossu@webrtc.org,minyue@webrtc.org,chxg@google.com

Change-Id: Ia36b9ae899563c9afd8612ffd83871b8a5778a2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:10739
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167212
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30364}
2020-01-23 16:21:06 +00:00
Minyue Li
48655cfdbf Send absolute capture time through audio coding module.
Bug: webrtc:10739
Change-Id: I44e0305be7c84b253172511c2977b1d700e40c1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167067
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Chen Xing <chxg@google.com>
Commit-Queue: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30363}
2020-01-23 16:06:12 +00:00
Per Åhgren
4dd56a3830 ACM: Adding unittests for the remixing functionality
On top of adding unittests for the remixing, the CL
moves the code tested to a separate file in order
to allow it to be tested.

Bug: webrtc:11007
Change-Id: I531736517bbcc715b3c1bf3a4256c42208c5b778
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155740
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29839}
2019-11-20 06:20:22 +00:00
Per Åhgren
bb55c5e2ec Correct the upmixing of mono to stereo in ACM2
This CL is a correction to the former CL that changed the remixing for
surround. A bug in that CL caused the upmixing from mono to stereo to
place zeros in the right channel.

The unittest CL is present in https://webrtc-review.googlesource.com/c/src/+/155740

Bug: b/144458371
Change-Id: I192e587a1b083a7bb55dcac2343f8b6d3942b9ed
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159864
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29805}
2019-11-15 16:07:30 +00:00
Per Åhgren
048b10a9ec Correcting the ACM upmixing from mono/stereo to surround
This CL corrects the upmixing from mono/stereo to surround in the audio
coding module.


Bug: webrtc:11083
Change-Id: Ic529107d59ff54a8e48b0424cbdf2b49b7a65c12
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159705
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29792}
2019-11-13 15:23:19 +00:00
Per Åhgren
4f2e9406c9 ACM: Adding support for more than 2 channels in the send pipeline
This CL adds support in the audio coding module for sending more than
2 channels to the encoder.

Bug: webrtc:11007
Change-Id: I0909b5c37a54c9d2e1353b864e55008cda50ffae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155583
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29385}
2019-10-04 14:38:59 +00:00
henrika
3354157d36 Add support for 192kHz input audio sample rate.
The existing restriction of max 48k seems old and outdated. I am unable to
see any issues by simply extending the support to 96 and utilize the existing
resampler in WebRTC. There are no memory limitations involved either.

It is a rather common case today in Chrome that users need 96k/192k input; hence this
simple change will have a positive impact for many WebRTC clients using gUM.

Bug: webrtc:10958
Test: https://webrtc.github.io/samples/src/content/peerconnection/audio/ using mic @96k
Change-Id: I8123da886ef7d48cbec9482795ec837ec1f61d81
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152162
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29135}
2019-09-10 13:01:58 +00:00
Niels Möller
32472449f1 Delete unused method AudioCodingModule::GetDecodingCallStatistics
Bug: None
Change-Id: I2804e241251d2faa421169085cd3f63972cc395f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151123
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29060}
2019-09-04 10:08:16 +00:00
Niels Möller
5ceb4ac5ed Delete some unused AudioCodingModule methods
Methods deleted:

  ReceiveFrequency, PlayoutFrequency, ReceiveCodec,
  SetMinimumPlayoutDelay, SetMaximumPlayoutDelay,
  SetBaseMinimumPlayoutDelayMs, GetBaseMinimumPlayoutDelayMs,
  PlayoutTimestamp, FilteredCurrentDelayMs, TargetDelayMs.

Became unused with cl
https://webrtc-review.googlesource.com/c/src/+/111504

Bug: None
Change-Id: Ie50e8e86a622661c3daa9db83a2e66489dcd2d98
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148071
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28918}
2019-08-20 13:42:36 +00:00
Niels Möller
dc5ed5c023 Delete NACK-related methods from AudioCodingModule
Unused since cl https://webrtc-review.googlesource.com/c/src/+/111504

Bug: None
Change-Id: I210f9c286961a2aec73c7e5c4cf8d04160f5a190
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148076
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28827}
2019-08-12 09:41:10 +00:00
Niels Möller
b90d38a978 Delete unused Opus-specific methods of AudioCodingModule
Bug: None
Change-Id: Ib191e4beadf85cd57e765bc52d305e274e50a473
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148400
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28815}
2019-08-09 07:06:36 +00:00
Niels Möller
75caef7a4b Delete unused ACM members isac_decoder_16k_ and isac_decoder_32k_
Unused since https://webrtc-review.googlesource.com/c/103821.

Bug: webrtc:8396
Change-Id: Ia83f02f16d6ea8c260ea765b41506f2691e035bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148072
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28788}
2019-08-07 09:53:22 +00:00
Niels Möller
c653172e74 Delete obsolete method AudioCodingModule::SetBitRate
Bug: None
Change-Id: I2291f7b4b46d269592eacad67a126010b750fac2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148079
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28784}
2019-08-07 08:37:25 +00:00
Jonas Olsson
a4d873786f Format almost everything.
This CL was generated by running

git ls-files | grep -P "(\.h|\.cc)$" | grep -v 'sdk/' | grep -v 'rtc_base/ssl_' | \
grep -v 'fake_rtc_certificate_generator.h' | grep -v 'modules/audio_device/win/' | \
grep -v 'system_wrappers/source/clock.cc' | grep -v 'rtc_base/trace_event.h' | \
grep -v 'modules/audio_coding/codecs/ilbc/' | grep -v 'screen_capturer_mac.h' | \
grep -v 'spl_inl_mips.h' | grep -v 'data_size_unittest.cc' | grep -v 'timestamp_unittest.cc' \
| xargs clang-format -i ; git cl format

Most of these changes are clang-format grouping and reordering includes
differently.

Bug: webrtc:9340
Change-Id: Ic83ddbc169bfacd21883e381b5181c3dd4fe8a63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144051
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28505}
2019-07-08 13:45:15 +00:00
Karl Wiberg
053c371552 Audio coding: Don't choke when RTP timestamp rate > sample rate
Bug: webrtc:10631
Change-Id: If0422786172502f039acc2cac5e8c13b637af54c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137048
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27998}
2019-05-21 03:10:49 +00:00
Niels Möller
c35b6e675a Deprecate RTPFragmentationHeader argument to AudioPacketizationCallback::SendData
It appears unused everywhere. It will be deleted in a followup cl.

Bug: webrtc:6471
Change-Id: Ief992db6e52aee3cf1bc77ffd659ffbc072672ba
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134212
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27787}
2019-04-26 12:58:14 +00:00
Niels Möller
c936cb6a86 Make AudioFrameType an enum class, and move to audio_coding_module_typedefs.h
Bug: webrtc:5876
Change-Id: I0c92f9410fcf0832bfa321229b3437134255dba6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128085
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27190}
2019-03-19 16:59:27 +00:00
Niels Möller
87e2d785a0 Prepare for splitting FrameType into AudioFrameType and VideoFrameType
This cl deprecates the FrameType enum, and adds aliases AudioFrameType
and VideoFrameType.

After downstream usage is updated, the enums will be separated
and be moved out of common_types.h.

Bug: webrtc:6883
Change-Id: I2aaf660169da45f22574b4cbb16aea8522cc07a6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/123184
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27011}
2019-03-07 10:12:57 +00:00
Alex Loiko
65438812ba 2nd reland of https://webrtc-review.googlesource.com/c/src/+/114883
The difference to the original is new bitexactness strings.  The
reason for reland is breaking downstream projects.

Original CL description:

Tests for multi-stream Opus.

This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
tests are in audio_coding_unittest.cc. Some refactoring of
AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
possible. A few checks for "channels \in {1, 2}" are replaced with
"channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
other changes are made to be able to write and read multi-channel WAV
files.

The SDP changes are NOT included; as of this CL there is no way to set
up a multi-stream opus en/de-coder from SDP strings.

TBR=ossu@webrtc.org

Bug: webrtc:8649
Change-Id: I6261b18c69fd666d43ab34ed8f1bc9d5cc82b21f
Reviewed-on: https://webrtc-review.googlesource.com/c/123882
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26809}
2019-02-22 09:59:01 +00:00
Alex Loiko
8b3db59b6e Revert "Reland of https://webrtc-review.googlesource.com/c/src/+/114883"
This reverts commit 5341aaccdb.

Reason for revert: Order of initialization of global static strings.

Original change's description:
> Reland of https://webrtc-review.googlesource.com/c/src/+/114883
> 
> The difference to the original is new bitexactness strings AND
> global static file string constants. The reason for reland is breaking
> downstream projects.
> 
> Original CL description:
> 
> Tests for multi-stream Opus.
> 
> This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
> tests are in audio_coding_unittest.cc. Some refactoring of
> AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
> possible. A few checks for "channels \in {1, 2}" are replaced with
> "channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
> other changes are made to be able to write and read multi-channel WAV
> files.
> 
> The SDP changes are NOT included; as of this CL there is no way to set
> up a multi-stream opus en/de-coder from SDP strings.
> 
> Bug: webrtc:8649
> Change-Id: I9fd47c790c241c1876c4a731b0840bec30b4f1b2
> Reviewed-on: https://webrtc-review.googlesource.com/c/123387
> Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
> Commit-Queue: Alex Loiko <aleloi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26774}

TBR=aleloi@webrtc.org,ossu@webrtc.org

Change-Id: I88060f2050ccee83d6091b042a10f79b3c4edc47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8649
Reviewed-on: https://webrtc-review.googlesource.com/c/123580
Reviewed-by: Alex Loiko <aleloi@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26777}
2019-02-20 15:17:49 +00:00
Alex Loiko
5341aaccdb Reland of https://webrtc-review.googlesource.com/c/src/+/114883
The difference to the original is new bitexactness strings AND
global static file string constants. The reason for reland is breaking
downstream projects.

Original CL description:

Tests for multi-stream Opus.

This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
tests are in audio_coding_unittest.cc. Some refactoring of
AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
possible. A few checks for "channels \in {1, 2}" are replaced with
"channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
other changes are made to be able to write and read multi-channel WAV
files.

The SDP changes are NOT included; as of this CL there is no way to set
up a multi-stream opus en/de-coder from SDP strings.

Bug: webrtc:8649
Change-Id: I9fd47c790c241c1876c4a731b0840bec30b4f1b2
Reviewed-on: https://webrtc-review.googlesource.com/c/123387
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26774}
2019-02-20 14:57:01 +00:00
Ruslan Burakov
b35baccd6f Fix NetEq minimum and maximum delay always reset on acm creation.
Bug: webrtc:10305
Change-Id: Iecc55c3b4bb8416e2fd0cf26532b43dcd70a7cca
Reviewed-on: https://webrtc-review.googlesource.com/c/122280
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Ruslan Burakov <kuddai@google.com>
Cr-Commit-Position: refs/heads/master@{#26771}
2019-02-20 14:04:51 +00:00
Mirko Bonadei
ffd1f93a8d Revert "Tests for multi-stream Opus."
This reverts commit 9c31ac2323.

Reason for revert: Breaks downstream project.

Original change's description:
> Tests for multi-stream Opus.
> 
> This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
> tests are in audio_coding_unittest.cc. Some refactoring of
> AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
> possible. A few checks for "channels \in {1, 2}" are replaced with
> "channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
> other changes are made to be able to write and read multi-channel WAV
> files.
> 
> The SDP changes are NOT included; as of this CL there is no way to set
> up a multi-stream opus en/de-coder from SDP strings.
> 
> Bug: webrtc:8649
> Change-Id: I1d93a9b8eecc3f6e19896ff2e2ce9b63da77a23c
> Reviewed-on: https://webrtc-review.googlesource.com/c/114883
> Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
> Commit-Queue: Alex Loiko <aleloi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#26742}

TBR=aleloi@webrtc.org,ossu@webrtc.org

Change-Id: I0ac48b7320d31d3e7af33bf8714c3db6c807b82e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8649
Reviewed-on: https://webrtc-review.googlesource.com/c/123385
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26747}
2019-02-18 23:10:05 +00:00
Alex Loiko
9c31ac2323 Tests for multi-stream Opus.
This CL (mainly) adds bit-exactness tests for multi-stream Opus. The
tests are in audio_coding_unittest.cc. Some refactoring of
AcmSendTestOldApi, AcmSenderBitExactnessOldApi is done to make it
possible. A few checks for "channels \in {1, 2}" are replaced with
"channels \in {1, 2, 4, 6, 8}" in the WebRTC Opus codec wrapper. A few
other changes are made to be able to write and read multi-channel WAV
files.

The SDP changes are NOT included; as of this CL there is no way to set
up a multi-stream opus en/de-coder from SDP strings.

Bug: webrtc:8649
Change-Id: I1d93a9b8eecc3f6e19896ff2e2ce9b63da77a23c
Reviewed-on: https://webrtc-review.googlesource.com/c/114883
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26742}
2019-02-18 17:09:59 +00:00
Niels Möller
afb5dbbf4e Update ACM to use RTPHeader instead of WebRtcRTPHeader
Bug: webrtc:5876
Change-Id: Id3311dcf508cca34495349197eeac2edf8783772
Reviewed-on: https://webrtc-review.googlesource.com/c/123188
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26729}
2019-02-18 08:01:31 +00:00
Ruslan Burakov
3b50f9f9ce Propagate base minimum delay to audio_receiver_stream
Bug: webrtc:10287
Change-Id: Id7914976ef5b7eb708802119932b554d9ce4879e
Reviewed-on: https://webrtc-review.googlesource.com/c/121563
Commit-Queue: Ruslan Burakov <kuddai@google.com>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26563}
2019-02-06 11:07:42 +00:00
Steve Anton
10542f21c8 (4) Rename files to snake_case: update BUILD.gn, include paths, header guards, and DEPS entries
Mechanically generated by running this command:

tools_webrtc/do-renames.sh update all-renames.txt && git cl format

Then manually updating:

tools_webrtc/sanitizers/tsan_suppressions_webrtc.cc

Bug: webrtc:10159
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I54824cd91dada8fc3ee3d098f971bc319d477833
Reviewed-on: https://webrtc-review.googlesource.com/c/115653
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26226}
2019-01-11 17:11:39 +00:00
Fredrik Solenberg
f693bfae5f Remove CodecInst pt.2
The following APIs on AudioCodingModule are deprecated with this CL:
  static int NumberOfCodecs();
  static int Codec(int, CodecInst*);
  static int Codec(const char*, CodecInst*, int, size_t);
  static int Codec(const char*, int, size_t);
  absl::optional<CodecInst> SendCodec() const;
  bool RegisterReceiveCodec(int, const SdpAudioFormat&);
  int RegisterExternalReceiveCodec(int, AudioDecoder*, int, int, const std::string&);
  int UnregisterReceiveCodec(uint8_t);
  int32_t ReceiveCodec(CodecInst*);
  absl::optional<SdpAudioFormat> ReceiveFormat();

As well as this method on RtpRtcp module:
  int32_t RegisterSendPayload(const CodecInst&);

Bug: webrtc:7626
Change-Id: I1230732136f1fe9048cf74afdeab767ca57ac9ce
Reviewed-on: https://webrtc-review.googlesource.com/c/113816
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26025}
2018-12-17 10:33:55 +00:00
Karl Wiberg
49c33ce528 AudioCodingModule: Remove support for creating encoders
After this CL, all audio encoders have to be injected by the caller.
This means that there is no special "built-in" set of codecs, and
users won't have to pay the binary size and security costs of codecs
they aren't using.

Bug: webrtc:8396
Change-Id: Idb0959ce395940c8bb3bbb49256cdcd84fc87bb6
Reviewed-on: https://webrtc-review.googlesource.com/c/103821
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25600}
2018-11-12 14:02:11 +00:00
Yves Gerey
988cc0870b [Cleanup] Add missing #include. Remove useless ones.
This CL is the result of running include-what-you-use tool on part
of the code base (audio target and dependencies) plus manual fixes.

bug: webrtc:8311
Change-Id: I277d281ce943c3ecc1bd45fd8d83055931743604
Reviewed-on: https://webrtc-review.googlesource.com/c/106280
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25311}
2018-10-23 11:32:56 +00:00
Niels Möller
2edab4c026 Delete use of STR_CASE_CMP, replaced with absl::EqualsIgnoreCase.
Bug: webrtc:5876
Change-Id: Ica2d47ca45b8ef01a548d8dbe31dbed740a0ebda
Reviewed-on: https://webrtc-review.googlesource.com/c/106820
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25306}
2018-10-23 09:24:15 +00:00
Niels Möller
eddd3665a2 Delete unused method AudioCodingModuleImpl::SetOpusApplication.
Bug: None
Change-Id: I8fc1b4b9a4521444867c8b34ee54187c86dd6027
Reviewed-on: https://webrtc-review.googlesource.com/c/102040
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24993}
2018-10-04 13:46:31 +00:00
Niels Möller
764c14c87d Delete unused AudioCodingModule methods.
Methods deleted: IsCodecValid (static), QueryEncoder, SendFrequency.

Bug: None
Change-Id: Id63ea7cdc364583e896d3301d04fa9caae1e4d94
Reviewed-on: https://webrtc-review.googlesource.com/95486
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24440}
2018-08-27 10:00:59 +00:00
Niels Möller
18f1adc0da Delete AudioCodingModule::LeastRequiredDelayMs and related NetEq code.
Bug: None
Change-Id: I2f68502d19415899b3694f7bf5da523da831b223
Reviewed-on: https://webrtc-review.googlesource.com/95640
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24439}
2018-08-27 09:58:19 +00:00
Niels Möller
ec93075c00 Delete deprecated methods on AudioCodingModule
Bug: None
Change-Id: I05f1ab6cdd6ac52972835af7ea94aacf5f64d673
Reviewed-on: https://webrtc-review.googlesource.com/95482
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24388}
2018-08-22 13:26:17 +00:00
Yves Gerey
665174fdbb Reformat the WebRTC code base
Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
2018-06-19 14:00:39 +00:00
Danil Chapovalov
b602123a5a Replace rtc::Optional with absl::optional in modules/audio_coding
This is a no-op change because rtc::Optional is an alias to absl::optional

This CL generated by running script with parameter 'modules/audio_coding'

find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+

find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"[\./api]*:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;

git cl format

Bug: webrtc:9078
Change-Id: Ic980ee605148fdb160666d4aa03cc87175e48fe8
Reviewed-on: https://webrtc-review.googlesource.com/84130
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23659}
2018-06-19 12:46:20 +00:00
Fredrik Solenberg
bbf21a3fd6 Remove dependencies on modules:module_api from AudioProcessing.
- Directly include api/audio/audio_frame.h everywhere AudioFrame is used.
- This *will* remove transient dependencies on libjpeg and a bunch of other things from the e.g. APM.
- audio_frame.h still included from module_common_types.h for backwards compatibility with clients.

Bug: webrtc:9139, webrtc:7504
Change-Id: Id96f9268c01667fbcc29a01f5c1dd25a37836897
Reviewed-on: https://webrtc-review.googlesource.com/62464
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22845}
2018-04-12 22:05:27 +00:00
Karl Wiberg
5817d3dfaa AudioCodingModule::Create(): Require caller to supply an AudioDecoderFactory
So that we don't have to be capable of creating one ourselves, which
requires a dependency on the audio decoders.

BUG=webrtc:5801, webrtc:8396

Change-Id: I80749ec3b86cba73994307046d05964f59167d44
Reviewed-on: https://webrtc-review.googlesource.com/18440
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22774}
2018-04-06 15:10:27 +00:00